Skip to main content
Question

Where is the files?

  • May 21, 2025
  • 4 replies
  • 25 views

Forum|alt.badge.img

Hi everybody, I try upload a new file using the token using cURL and PHP 

 

curl https://upload.box.com/api/2.0/files/content -H "Authorization: Bearer THE_TOKEN" -X POST -F attributes='{"name":"THE FILE", "parent":{"id":"0"}}' -F file=@THE_FILE

 

I get this response . . . 

 

{"total_count":1,"entries":[{"type":"file","id":"***number removed for privacy***682","file_version":{"type":"file_version","id":"***number removed for privacy***842","sha1":"b4ec089a25f0f68da825762d8891bb00cf5bd1cd"},"sequence_id":"1","etag":"1","sha1":"b4ec089a25f0f68da825762d8891bb00cf5bd1cd","name":"a2QQ0000000wRu9MAE.png","description":"","size":941,"path_collection":{"total_count":2,"entries":[{"type":"folder","id":"0","sequence_id":null,"etag":null,"name":"All Files"},{"type":"folder","id":"2***phone number removed for privacy***","sequence_id":"0","etag":"0","name":"afc_upload_batch_1702139668_0_1495465412_a24dfe62-14fb-4fa4-aec5-10799bf84309"}]},"created_at":"2017-05-24T10:19:20-07:00","modified_at":"2017-05-24T10:19:20-07:00","trashed_at":null,"purged_at":null,"content_created_at":"2017-05-24T10:19:20-07:00","content_modified_at":"2017-05-24T10:19:20-07:00","created_by":{"type":"user","id":"***number removed for privacy***8","name":"xcaret","login":"***email address removed for privacy***"},"modified_by":{"type":"user","id":"***number removed for privacy***8","name":"xcaret","login":"***email address removed for privacy***"},"owned_by":{"type":"user","id":"***number removed for privacy***8","name":"xcaret","login":"***email address removed for privacy***"},"shared_link":null,"parent":{"type":"folder","id":"2***phone number removed for privacy***","sequence_id":"0","etag":"0","name":"afc_upload_batch_1702139668_0_1495465412_a24dfe62-14fb-4fa4-aec5-10799bf84309"},"item_status":"active"}]}

But, I can't find the new files in the box enviornment. 

 

Where is the files? 

4 replies

Forum|alt.badge.img

Are you sure you used the same account to get the Tokens and that you looked into same account's root view? It should be in the root view, of the same account that generated the Tokens. 


Forum|alt.badge.img

Hi, I am sure, I used the same account, maybe the kind of account is developer, I get the token for an application using the same account  😞 

 


Forum|alt.badge.img

I am note sure what happened. 

You can try using Postman application to validate as well. 

 

get postman here at:

https://www.getpostman.com/

 

You can also get predefined box api for postman:

https://cloud.box.com/v/postman-box-content

 

You just need to paste "AccessToken" value on the Authorization header.

 

You can give it a try by first renaming file and deleting folder etc. and if it works , try uploading file as well. Based on the result of this try, we can determine the next step. 

 

thanks, 

Bibek


Forum|alt.badge.img

Good afternoon ,

 

have you used an app user to upload the document or a service account? are you using the developer token obtained on the developer console page?

 

If the document is being succesfully uploaded and you can not see it on the root page through the web UI it means you are using different users 🙂

 

Thanks