Add a file to onedrive

Sanjeev Kumar 0 Reputation points


I having created a integration with office to add files to oneDrive.

I am making a PUT request to endpoint '{userid}/drive/root:/{file}:/content'

This is adding files to Sharepoint instead of OneDrive. What could be the possible reasons here?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,321 questions
A Microsoft file hosting and synchronization service.
951 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Diya Ahuja 5 Reputation points

    The possible reasons for the PUT request to the endpoint '{userid}/drive/root:/{file}:/content' adding files to Sharepoint instead of OneDrive could be:

    1. The userid in the endpoint is not the correct userid for the OneDrive account.
    2. The endpoint is not the correct endpoint for the OneDrive account.
    3. The permissions for the OneDrive account are not set correctly.
    4. The file is too large for the OneDrive account.
    5. The file is not in the correct format for the OneDrive account.
    0 comments No comments