Description
Replaces the details of a file given its properties. It is recommended to provide all properties in the body, as this endpoint performs a full replacement, not a partial update.
PUT
/files/{fileId}
Required OAuth Scopes:
file:write
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
fileId | path | string | true | The unique identifier of the file |
body | body | File | true | All properties for the file, not just those to update |
Body parameter example
{
"container": "V0ZEYXRhRW50aXR5HkZvbGRlcjpyMTY0NEU1ZkY2OTA1QkM5QTSCMyZCRkRzQzNDO1FGNC",
"kind": "Document",
"name": "Year-end review"
}
Code Samples
curl -X PUT https://api.app.wdesk.com/platform/v1/files/{fileId} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
http PUT https://api.app.wdesk.com/platform/v1/files/{fileId} \
Content-Type:application/json \
Accept:application/json \
Authorization:"Bearer {access-token}"
wget --method=PUT "https://api.app.wdesk.com/platform/v1/files/{fileId}" \
--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.put('https://api.app.wdesk.com/platform/v1/files/{fileId}', headers = headers)
print(r.json())
Returns
200 - OK
Returns a File
object containing details about the updated File
.
Example Responses
{
"container": "",
"created": {
"dateTime": "2019-10-28T15:03:27Z"
},
"name": "1989 Year-End Summary",
"id": "124efa2a142f472ba1ceab34ed18915f",
"kind": "Document",
"modified": {
"dateTime": "2020-04-01T11:31:06Z"
},
"type": "Document",
"template": false
}