question

geniusnut avatar image
geniusnut asked

DELETE file returns status code 200 and failed.

I want to delete a file from the amazon cloud, and use something like curl -v -X DELETE -H "Connection: Keep-Alive" -H "Authorization: Bearer accesstoken" ' https://cdws.us-east-1.amazonaws.com/drive/v1/nodes/jhhjs5Z5T1iffZNTJETQzw/children/kG6sC69ATFm7o5sWLKuL0Q' But I get the status code HTTP/1.1 200 OK and the json result like : {"parents":["jhhjs5Z5T1iffZNTJETQzw"],"kind":"FILE","version":11,"id":"kG6sC69ATFm7o5sWLKuL0Q","name":"comment-2595051.jpg","createdDate":"2015-01-20T01:47:39.759Z","contentProperties":{"extension":"jpg","md5":"b123287f543de5f34d82a8cbfd8890da","image":{"height":220,"width":242},"contentType":"image/jpeg","version":2,"size":4583},"status":"AVAILABLE","labels":[],"restricted":false,"modifiedDate":"2015-01-20T03:02:34.772Z","createdBy":"CloudDriveWeb","isShared":false} The file still exists!( If you delete a file whose parent is not root, the file will be moved to its parent's parent.) Can anyone tell me how to delete a file permanently? Or should I use the trash api to delete a file ?
amazon drive
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

S. Baxi avatar image
S. Baxi answered
The example that you provided will not delete the but remove a node from its parent. Currently I don't see in the documentation a way to delete a node, but you can trash a node by making the below call. PUT : https://cdws.us-east-1.amazonaws.com/drive/v1/trash/{nodeId}
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

geniusnut avatar image
geniusnut answered
Thanks, I know the google drive has the delete api which will delete the file permanently and the trash api. After all, I use the trash API to delete the files.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

mice777 avatar image
mice777 answered
The command for "Remove a Child Membership" is documented poorly. First it uses DELETE http method, making impression that we delete the entry, while we can only move it to different parent. Then there's usually returned code 200, not mentioned in Docs, and "parents" property doesn't change at all, file stays in parent from which I intended to "delete" it. This part is pretty confusing.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sean Callahan avatar image
Sean Callahan answered
Thank you for your post. As of right now permanently deleting content is not available through the Amazon Cloud Drive API. You can however use the "trash" API to soft delete a node putting contents in the customer's recycle bin. Thank you for brining this to our attention that it is unclear. I will work with the team to better describe this within our API documentation. https://developer.amazon.com/public/apis/experience/cloud-drive/content/trash
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.