0

I am changing my file overwrite code that will be required by oct 1st. However, even though I have added the is-match header and included the hash of the file it is returning a status 409 "item name in use".

Perhaps I am using the wrong hash of the file. Am I supposed to provide a NEW hash of the updated file? because that doesnt work either. I am sending the exact same hash(etag) that the file currently has.

Also, I have never written a delete file method, so if you could not refer me to that documentation that would help. I have read through it and still am lost.

the url I am posting to is, https://api.box.com/2.0/files/{file id}

Echofiend
  • 63
  • 9

1 Answers1

1

Great question. Looks like our doc for upload new version hadn't gotten the refresh... just posted the update on the docs.

The delete example is in the doc at: http://developers.box.com/docs/#files-delete-a-file

essentially a call like:

curl https://api.box.com/2.0/files/FILE_ID \
-H "Authorization: BoxAuth api_key=API_KEY&auth_token=AUTH_TOKEN" \
-H "If-Match: a_unique_sha1" -X DELETE

Uploading a new version of a file is documented here: http://developers.box.com/docs/#files-upload-a-new-version-of-a-file

and looks like this in curl:

curl https://api.box.com/2.0/files/FILE_ID/data \
-H "Authorization: BoxAuth api_key=API_KEY&auth_token=AUTH_TOKEN" \
-H "If-Match: ETAG_OF_ORIGINAL
-F filename=@FILE_NAME
Peter
  • 2,551
  • 1
  • 14
  • 20