API Reference

Create a new file

Description

Creates a new file. Requires name and kind. kind must be one of Document, Spreadsheet, Presentation, or Folder and is case-sensitive.

POST /files

🚧

Required OAuth Scopes:

file:write

Parameters

ParameterInTypeRequiredDescription
bodybodyFiletrueThe properties of the file to create

Body parameter example

{
  "container": "V0ZEYXRhRW50aXR5HkZvbGRlcjpyMTY0NEU1ZkY2OTA1QkM5QTSCMyZCRkRzQzNDO1FGNC",
  "kind": "Document",
  "name": "Year-end review"
}

Code Samples

curl -X POST https://api.app.wdesk.com/platform/v1/files  \ 
-H 'Content-Type: application/json' \ 
-H 'Accept: application/json' \ 
-H 'Authorization: Bearer {access-token}'
http POST https://api.app.wdesk.com/platform/v1/files  \ 
Content-Type:application/json \ 
Accept:application/json \ 
Authorization:"Bearer {access-token}"
wget --method=POST "https://api.app.wdesk.com/platform/v1/files" \
 --output-document -  \ 
 --header 'Content-Type: application/json' \ 
 --header 'Accept: application/json' \ 
 --header 'Authorization: Bearer {access-token}'
import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('https://api.app.wdesk.com/platform/v1/files', headers = headers)

print(r.json())

Returns

201 - Created

Returns a File object containing details for the newly created File.

Example Responses


{
  "container": "",
  "created": {
    "dateTime": "2019-10-28T15:03:27Z"
  },
  "name": "2019 Year-End Summary",
  "id": "124efa2a142f472ba1ceab34ed18915f",
  "kind": "Document",
  "modified": {
    "dateTime": "2019-10-28T15:03:27Z"
  },
  "type": "Document",
  "template": false
}