diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2016-04-26 21:44:27 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2016-04-26 21:44:27 +0200 |
commit | 0876b859f18a13c150062ad4d7830dd76773635b (patch) | |
tree | 235e0e99052c173026fb51e98e8804a6640b5362 /docs | |
parent | fc75552ebd0fb5451783be9224ea8c79869d52ae (diff) |
add patch and delete methods
Diffstat (limited to 'docs')
-rw-r--r-- | docs/api/v2/README.md | 72 |
1 files changed, 70 insertions, 2 deletions
diff --git a/docs/api/v2/README.md b/docs/api/v2/README.md index eef7c8d5e..ec1293da1 100644 --- a/docs/api/v2/README.md +++ b/docs/api/v2/README.md @@ -276,9 +276,77 @@ In case of an HTTP 200, the deleted folder is returned in full in the response, } ``` ### Creating A Folder -TBD +To create a folder, use the following request: +* **Method**: POST +* **Route**: /folders + +with the following request body: +```json +{ + "name": "Folder name" +} +``` + +The following response is being returned: + +Status codes: +* **200**: Folder was created successfully +* **400**: Folder creation error, check the error object: + * **code**: 1 folder name is empty +* **409**: Folder with given name exists already +* Other ownCloud errors, see **Response Format** + +In case of an HTTP 200 or 409, the created or already existing folder is returned in full in the response, e.g.: + +```json +{ + "data": { + "folder": { + "id": 3, + "name": "funny stuff" + } + } +} +``` ### Changing A Folder -TBD +The following attributes can be changed on the folder: +* **name** + +To change any number of attributes on a folder, use the following request and provide as much attributes that can be changed as you want: +* **Method**: PATCH +* **Route**: /folders/{id} +* **Route Parameters**: + * **{id}**: folder's id + +with the following request body: +```json +{ + "name": "New folder name" +} +``` + +The following response is being returned: + +Status codes: +* **200**: Folder was created successfully +* **400**: Folder creation error, check the error object: + * **code**: 1 folder name is empty +* **409**: Folder with given name exists already +* Other ownCloud errors, see **Response Format** + +In case of an HTTP 200 or 409, the changed or already existing folder is returned in full in the response, e.g.: + +```json +{ + "data": { + "folder": { + "id": 3, + "name": "funny stuff" + } + } +} +``` + ## Feeds Feeds are represented using the following data structure: |