Upload files to box folder

Hi Team,

I have some box folders on https://gehealthcare.box.com and I am trying to upload files on the same using python scripts which are executed via jenkins.

I am currently using JWT without SDK approach and I am able to get the token but when I pass that token to my box URL where the files needs to get uploaded I am getting below error message:

upload_response.text: {“type”:“error”,“status”:404,“code”:“not_found”,“context_info”:{“errors”:[{“reason”:“invalid_parameter”,“name”:“parent”,“message”:“Invalid value ‘d_139168108673’. ‘parent’ with value ‘d_139168108673’ not found”}]}

Here 139168108673 is my folder id where the file needs to get uploaded.

Kindly help as it is quite urgent.

Looking forward to hear from you.

Shailendra Jetpuria

Welcome to the community, @shailendraj :grinning:

Is it possible to share the piece of code you’re using ?
It looks like the system reeives “d_139168108673” instead of 139168108673.
That would explain the 404.

Hi @CodeBoxSeb,

The 404 means something hasn’t been found.
In your case I suspect the folder is not visible to the underlying user associated with the token for the API call.

Depending on how you have your app configured and what type of authentication you are using, you can try to use the as-user header and have the service account associated with the token impersonate a user that does have access to the folder in question.

Another option is to login the service account using the end user id.

Another approach would be to have the folder in question shared with the service account.

Let us know.