0
votes

I am using Box 2.0 API to delete a file. Using Postman, i enter the following:

https://api.box.com/2.0/files/2605672883

specifying the DELETE action. I've set the authorization header appropriately. When I submit the request, I get the following error:

{ "type": "error", "status": 400, "code": "bad_request", "help_url": "http://developers.box.com/docs/#errors", "message": "Could not parse JSON", "request_id": "4934716064fff2a0a70988" }

This makes me think that i need a JSON object as part of the message body, the documentation specifies that the File ID is the only thing necessary as part of the request. Is this a bug or am I doing something wrong ?

thanks

1

1 Answers

3
votes

DELETE /files/{id} requests require (as of last week) an If-Match header with the sha1 of the file in order to prevent race conditions. You can see the updated documentation here: http://developers.box.com/docs/#files-delete-a-file

EDIT: There is a bug in POSTMAN in how it sends DELETE requests. If you send an empty JSON object {} as the body, it should work successfully.