From 0876b859f18a13c150062ad4d7830dd76773635b Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Tue, 26 Apr 2016 21:44:27 +0200 Subject: add patch and delete methods --- docs/api/v2/README.md | 72 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 70 insertions(+), 2 deletions(-) (limited to 'docs/api') 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: -- cgit v1.2.3