Hi everyone!
I follow Doc API and was able to upload a file to my Enterprise web app. I can view file already.
from boxsdk import JWTAuth
from boxsdk import Client
import json
auth = JWTAuth.from_settings_file(r'')
access_token = auth.authenticate_instance()
from boxsdk import Client
client = Client(auth)
file_path = r''
file_name = 'toan'
folder_id =***phone number removed for privacy***' # I change to shared folder id to upload file
user_id = '116510981726'
user = client.user(user_id=user_id).get()
print(user.login)
user_to_impersonate = client.user(user_id=user_id)
user_client = client.as_user(user_to_impersonate)
Now I want to upload file to a folder which is shared by my colleague.
How can I do that? File name 'toan' is the file I uploaded
I got a message like this:
File "C:\Users\nguye\AppData\Local\Programs\Python\Python38\lib\site-packages\boxsdk\session\session.py", line 406, in _prepare_and_send_request
self._raise_on_unsuccessful_request(network_response, request)
File "C:\Users\nguye\AppData\Local\Programs\Python\Python38\lib\site-packages\boxsdk\session\session.py", line 320, in _raise_on_unsuccessful_request
raise BoxAPIException(
boxsdk.exception.BoxAPIException: Message: Not Found
Status: 404
Code: not_found
Appreciate your help
Thank you very much!