From a4194efaf15488eba233f5d66ae0a946a56909e0 Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Thu, 7 Nov 2013 22:22:37 +0100 Subject: [PATCH 1/2] Fixed #1981 - uncomplete HTTP API documentation --- doc/api/http_api.md | 59 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/doc/api/http_api.md b/doc/api/http_api.md index 5ed18f8c..21a1c459 100644 --- a/doc/api/http_api.md +++ b/doc/api/http_api.md @@ -294,6 +294,65 @@ returns the text of a pad formatted as HTML * `{code: 0, message:"ok", data: {html:"Welcome Text
More Text"}}` * `{code: 1, message:"padID does not exist", data: null}` +#### setHTML(padID, text) + * API >= 1 + +sets the html of a pad + +*Example returns:* + * `{code: 0, message:"ok", data: null}` + * `{code: 1, message:"padID does not exist", data: null}` + * `{code: 1, message:"text too long", data: null}` + +#### getAttributePool(padID) + * API >= 1.2.8 + +returns the attribute pool of a pad + +*Example returns:* + * `{ "code":0, + "message":"ok", + "data": { + "pool":{ + "numToAttrib":{ + "0":["author","a.X4m8bBWJBZJnWGSh"], + "1":["author","a.TotfBPzov54ihMdH"], + "2":["author","a.StiblqrzgeNTbK05"], + "3":["bold","true"] + }, + "attribToNum":{ + "author,a.X4m8bBWJBZJnWGSh":0, + "author,a.TotfBPzov54ihMdH":1, + "author,a.StiblqrzgeNTbK05":2, + "bold,true":3 + }, + "nextNum":4 + } + } + }` + * `{"code":1,"message":"padID does not exist","data":null}` + +#### getRevisionChangeset(padID) + * API >= 1.2.8 + +get the changeset at a given revision, or last revision if 'rev' is not defined. + +*Example returns:* + * `{ "code" : 0, + "message" : "ok", + "data" : "Z:1>6b|5+6b$Welcome to Etherpad!\n\nThis pad text is synchronized as you type, so that everyone viewing this page sees the same text. This allows you to collaborate seamlessly on documents!\n\nGet involved with Etherpad at http://etherpad.org\n" + }` + * `{"code":1,"message":"padID does not exist","data":null}` + +#### createDiffHTML(padID, startRev, endRev) + * API >= 1.2.7 + +returns an object of diffs from 2 points in a pad + +*Example returns:* + * `{"code":0,"message":"ok","data":{"html":"Welcome to Etherpad!

This pad text is synchronized as you type, so that everyone viewing this page sees the same text. This allows you to collaborate seamlessly on documents!

Get involved with Etherpad at http://etherpad.org
aw

","authors":["a.HKIv23mEbachFYfH",""]}}` + * `{"code":4,"message":"no or wrong API Key","data":null}` + ### Chat #### getChatHistory(padID, [start, end]) * API >= 1.2.7 From 5bccfdf060303ccaad8d7e4765f8310d5616044e Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Thu, 7 Nov 2013 22:46:35 +0100 Subject: [PATCH 2/2] Forgot a small chunck of documentation for getRevisionChangeset --- doc/api/http_api.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/api/http_api.md b/doc/api/http_api.md index 21a1c459..41ab8cde 100644 --- a/doc/api/http_api.md +++ b/doc/api/http_api.md @@ -332,7 +332,7 @@ returns the attribute pool of a pad }` * `{"code":1,"message":"padID does not exist","data":null}` -#### getRevisionChangeset(padID) +#### getRevisionChangeset(padID, [rev]) * API >= 1.2.8 get the changeset at a given revision, or last revision if 'rev' is not defined. @@ -343,6 +343,7 @@ get the changeset at a given revision, or last revision if 'rev' is not defined. "data" : "Z:1>6b|5+6b$Welcome to Etherpad!\n\nThis pad text is synchronized as you type, so that everyone viewing this page sees the same text. This allows you to collaborate seamlessly on documents!\n\nGet involved with Etherpad at http://etherpad.org\n" }` * `{"code":1,"message":"padID does not exist","data":null}` + * `{"code":1,"message":"rev is higher than the head revision of the pad","data":null}` #### createDiffHTML(padID, startRev, endRev) * API >= 1.2.7