Regarding the issue where response 500 is returned when uploading a file Dear Customer Support
This is Kyosuke from Baroque Japan Limited based in Japan.
When I upload a file using the program below, a <response 500> is returned.
How can I modify it so that I can upload the file?
■Source code
with open(fr"C:\408138_20231115.PDF", 'rb') as f: files = f.read() binary_file_b64 = base64.b64encode(files) SendFile_ep = fr"https://upload.box.com/api/2.0/files/content" headers = {'Authorization': 'Bearer {}'.format(AccessToken)} payload = { 'attributes': { 'content_created_at': '', 'content_modified_at': '', 'name': fr"408138_20231115.PDF", 'parent': { 'id': fr"241581751084" } }, 'file': fr"{binary_file_b64}" } res = requests.post(SendFile_ep, payload, headers=headers) code = res.status_code if code == 200 : print(f"Success to post files : \n{res.text}\n") else : print(f"Failure to post files : \n{res.text}\n")