Updated API (markdown)

El RIDO 2015-10-18 16:53:30 +02:00
parent 6f38e13fb8
commit d1977a2ffa

16
API.md

@ -7,14 +7,14 @@ All JSON-API requests need to be sent with the HTTP header `X-Requested-With: JS
Action | Type | Query String | Data to send | Result ([JSON-LD](http://json-ld.org/))
----------------------------------|------|--------------|--------------|-------------------
retrieve paste (and its comments) | GET | `[pasteID]` | (no data) | [paste.jsonld](https://raw.githubusercontent.com/elrido/ZeroBin/master/js/paste.jsonld)
create paste | PUT | `[pasteID]` | `data=[cipherdata]&expire=[expireID]& formatter=[formatID]&burnafterreading=[1/0]& opendiscussion=[1/0]` | [paste.jsonld](https://raw.githubusercontent.com/elrido/ZeroBin/master/js/paste.jsonld) (including deletetoken)
create paste | POST | (empty query string) | `data=[cipherdata]&expire=[expireID]& formatter=[formatID]&burnafterreading=[1/0]& opendiscussion=[1/0]` | [paste.jsonld](https://raw.githubusercontent.com/elrido/ZeroBin/master/js/paste.jsonld) (including deletetoken)
create comment | PUT | `[commentID]` | `data=[cipherdata]&parentid=[parentID]& pasteid=[pasteID]&nickname=[cipherdata]` | `{"status":0, "id":"[commentID]"}`
create comment |d POST | (empty query string) | `data=[cipherdata]&parentid=[parentID]& pasteid=[pasteID]&nickname=[cipherdata]` | `{"status":0, "id":"[commentID]"}`
delete paste (burn after reading) | DELETE | (empty query string) | `pasteid=[pasteID]&deletetoken=burnafterreading` | `{"status":0, "id":"[pasteID]"}`
delete paste (burn after reading) | POST | (empty query string) | `pasteid=[pasteID]&deletetoken=burnafterreading` | `{"status":0, "id":"[pasteID]"}`
delete paste | DELETE | (empty query string) | `pasteid=[pasteID]&deletetoken=[deletetoken]` | `{"status":0, "id":"[pasteID]"}`
delete paste | POST | (empty query string) | `pasteid=[pasteID]&deletetoken=[deletetoken]` | `{"status":0, "id":"[pasteID]"}`
create paste | PUT | `[pasteID]` | `data=[cipherdata]& expire=[expireID]& formatter=[formatID]& burnafterreading=[1/0]& opendiscussion=[1/0]` | [paste.jsonld](https://raw.githubusercontent.com/elrido/ZeroBin/master/js/paste.jsonld) (including deletetoken)
create paste | POST | (empty query string) | `data=[cipherdata]& expire=[expireID]& formatter=[formatID]& burnafterreading=[1/0]& opendiscussion=[1/0]` | [paste.jsonld](https://raw.githubusercontent.com/elrido/ZeroBin/master/js/paste.jsonld) (including deletetoken)
create comment | PUT | `[commentID]` | `data=[cipherdata]& parentid=[parentID]& pasteid=[pasteID]& nickname=[cipherdata]` | `{"status":0, "id":"[commentID]"}`
create comment |d POST | (empty query string) | `data=[cipherdata]& parentid=[parentID]& pasteid=[pasteID]& nickname=[cipherdata]` | `{"status":0, "id":"[commentID]"}`
delete paste (burn after reading) | DELETE | (empty query string) | `pasteid=[pasteID]& deletetoken=burnafterreading` | `{"status":0, "id":"[pasteID]"}`
delete paste (burn after reading) | POST | (empty query string) | `pasteid=[pasteID]& deletetoken=burnafterreading` | `{"status":0, "id":"[pasteID]"}`
delete paste | DELETE | (empty query string) | `pasteid=[pasteID]& deletetoken=[deletetoken]` | `{"status":0, "id":"[pasteID]"}`
delete paste | POST | (empty query string) | `pasteid=[pasteID]& deletetoken=[deletetoken]` | `{"status":0, "id":"[pasteID]"}`
Error on any of the above | N/A | N/A | N/A | `{"status":1, "message":"[errormessage]"}`
## Until Version 0.21.1