You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: StackSync_API_Specifications.md
+97Lines changed: 97 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -830,3 +830,100 @@ Content-Length: 248
830
830
<File content…. >
831
831
832
832
```
833
+
#Folder
834
+
## Create a folder
835
+
836
+
An application can create a folder by issuing an HTTP POST request to the URL of the containing folder resource. In addition, the application needs to provide as input, JSON that identifies the display name of the folder to be created.
837
+
838
+
### Request
839
+
840
+
#### URL structure
841
+
842
+
**/folder**.
843
+
844
+
#### Method
845
+
POST
846
+
847
+
#### Request Headers
848
+
849
+
The request header includes the following information:
850
+
851
+
FIELD | DESCRIPTION
852
+
--- | ---
853
+
**StackSync-API** | API version. The value must be **v2**.
854
+
**Content-Length** | The length of the request body.
855
+
**Content-Type** | The content type and character encoding of the response. The content type must be **application/json**, and the character encoding must be **UTF-8**.
856
+
857
+
#### Request Query arguments
858
+
JSON input that contains a dictionary with the following keys:
859
+
860
+
FIELD | DESCRIPTION | REQUIRED
861
+
--- | --- | ---
862
+
**name** | The user-visible name of the folder to be created. | Yes
863
+
**parent** | ID of the folder where the folder is going to be uploaded. If no ID is passed, it will use the top-level folder. This parameter should **not** point to a file. | No
864
+
865
+
#### HTTP Request Example
866
+
867
+
```
868
+
POST /folder
869
+
870
+
StackSync-API: v2
871
+
Content-Type: application/json
872
+
873
+
{
874
+
“name”: “clients”,
875
+
“parent”:681465736
876
+
}
877
+
```
878
+
879
+
880
+
### Response
881
+
#### Response Header
882
+
883
+
The response header includes the following information:
884
+
885
+
FIELD | DESCRIPTION
886
+
--- | ---
887
+
**Content-Length** | The length of the retrieved content.
888
+
**Content-Type** | The content type and character encoding of the response.
889
+
**Location** | The location of the newly created file.
890
+
891
+
#### Response Body
892
+
ELEMENT | DESCRIPTION
893
+
--- | ---
894
+
**filename** | The user-visible name of the file to be created.
895
+
**path** | The absolute path to the file.
896
+
**id** | A unique identifier for a file or folder.
897
+
**parent_id** | ID of the folder’s parent.
898
+
**is_folder** | Flag indicating whether it is a folder or not.
899
+
**status** | Possible values are “NEW”, “CHANGED”, “DELETED”. Indicating the status of the file in this specific version.
900
+
**version** | A unique identifier for the current version of a file. Can be used to detect changes and avoid conflicts.
901
+
**checksum** | The file’s checksum.
902
+
**size** | The file size in bytes.
903
+
**mimetype** | The media type of the file. http://www.iana.org/assignments/media-types
904
+
**modified_at** | This is the modification time set by the server at the time of processing the file.
0 commit comments