RESTful API Changes
Get all updates since specified checkpoint
Changes API (Sync)
This API lets you keep up with the changes in a customer account. Calling getChanges periodically will give the delta of the previously known state and the new state, which are instructions on how to update your local state to match the cloud state.
Method | Http Request | Description |
---|---|---|
get | POST : /changes
<td>Sync changes |
The contract of the API guarantees that all updates that have occurred since the specified checkpoint will be returned (subject to pagination). However, updates that occurred prior to the specified checkpoint may be returned. The client can determine that it is up-to-date when the service returns no new updates. If no checkpoint is passed in it will stream the changes from the start.
POST : /changes
Body Parameters
checkpoint |
optional | A token representing a frontier of updated items. |
chunkSize |
optional | The number of nodes to be returned within each Changes object in the response stream. |
maxNodes |
optional | The threshold of number of nodes returned at which the streaming call will be ended. This is not intended to be used for strict pagination as the number of nodes returned may exceed this number. |
includePurged |
optional | If true then it will return the purged nodes as well. Default to false. |
cURL Request
curl -v -X POST
https://cdws.us-east-1.amazonaws.com/drive/v1/changes
--header "Authorization: Bearer
Atza|IQEBLjAsAhQ5zx7pKp9PCgCy6T1JkQjHHOEzpwIUQM"
--compressed
Sample JSON Response
HTTP /1.1 200 OK
{
"checkpoint" :
"CPX_zMzIKBD1_8zMyCgalgSs7QAFc3IALWNvbS5nb29nbGUuY29tbW9uLmhhc2guQmxvb21GaWx0ZXIkU2VyaWFsRm9ybQA",
"reset" : true,
"nodes":[
{
"id" : "kuVKiKs46qQsI88sOVJFyI"
"name" : "Camera"
"kind" : "FOLDER",
"version" : 1,
"modifiedDate" : "2014-03-07T22:31:12.173Z",
"creationDate" : "2014-03-07T22:31:12.173Z",
"labels" : ["ALBUM"],
"createdBy" : "ApplicationId1",
"parents" : ["ck4m_aTyBFy7lvbjilLgWs","sd58qqlW9yqXaFHRG-zCLH"],
"status" : "TRASH",
"restricted" : false
},
{
"id" : "MVHdLnwCJYU8svQbVDPvxQ"
"name" : "foo.zip"
"kind" : "FILE",
"version" : 1,
"modifiedDate" : "2014-03-07T22:31:12.173Z",
"creationDate" : "2014-03-07T22:31:12.173Z",
"labels" : ["ZIP File"]
"description" : "All My Data".
"createdBy" : "ApplicationId2",
"status" : "TRASH"
"restricted" : false
},...
],
}
Ending JSON - client should check if received ending JSON to decide to resume or to finish.
{ "end" : true }
Response codes
Code | Description |
---|---|
200 | OK. Account setup or TOU updated if already setup. |
400 | Bad input parameter. Error message should indicate which one and why. |
403 | Forbidden |
Support
If you have any questions, see the Developer Forum.