Hi,
The app that I have created is ‘Authenticated’ using: OAuth 2.0 (User or Client Authentication)
I have a free developer account and I am trying to upload a file using boxsdk. However, I am getting the below error:
boxsdk.exception.BoxAPIException: Message: Not Found
Status: 404
Code: not_found
Request ID: 5g33vbho4p64txku
Headers: {'Server': 'nginx', 'Date': 'Tue, 26 Mar 2024 13:05:47 GMT', 'Content-Type': 'application/json', 'Content-Length': '324', 'cache-control': 'no-cache, no-store', 'x-envoy-upstream-service-time': '505', 'strict-transport-security': 'max-age=31536000', 'X-Box-Original-Ingress-ADC-Host': 'prod-b-traffic-manager-0q2f', 'Via': '1.1 google', 'Alt-Svc': 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000'}
URL: https://upload.box.com/api/2.0/files/content
Method: POST
Context Info: {'errors': s{'reason': 'invalid_parameter', 'name': 'parent', 'message': "Invalid value 'd_254434451261'. 'parent' with value 'd_254434451261' not found"}]}
I have ensured the my folder_id is correct.
Below is my code. The ‘Access Token’ is being generated. However, the error is coming when uploading the file
def upload_file_main(client_id, client_secret, access_token, file_to_upload, destination_folder_id):
# Set up authentication
auth = OAuth2(
client_id = client_id,
client_secret=client_secret,
access_token=access_token,
)
# Initialize Box client
client = Client(auth)
client.folder(destination_folder_id).upload(file_to_upload)
My app is not authorized and I am unable to view the ‘Authorization’ tab in my Developer Console: