The error code 400
typically indicates a bad request. This could be due to an incorrect URL or missing parameters.
In your case, it seems like the URL for creating the upload session might be incorrect. The URL should point to the specific item in the drive where you want to upload the file.
Here’s the correct format for the URL:
POST /drives/{driveId}/items/{itemId}/createUploadSession
POST /groups/{groupId}/drive/items/{itemId}/createUploadSession
POST /me/drive/items/{itemId}/createUploadSession
POST /me/drive/items/{parentItemId}:/{fileName}:/createUploadSession
POST /sites/{siteId}/drive/items/{itemId}/createUploadSession
POST /users/{userId}/drive/items/{itemId}/createUploadSession
You need to replace {site-id}
, {item-id}
, and {fileName}
with the actual values. {site-id}
is the ID of the site that contains the drive. {item-id}
is the ID of the drive item under which you want to upload the file. {fileName}
is the name of the file you want to upload.
For further information please check this documentation.
Please try using this format and let me know if you still encounter issues. I’m here to help!
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".