Reputation: 5
I have this code here to read a file on onedrive:
PATCH /me/drive/items/{item-id}
Content-type: application/json
{
"name": "new-file-name.docx"
}
And to update a file:
PUT /me/drive/items/{item-id}/content
Content-Type: text/plain
The contents of the file goes here.
But where to I login to my microsoft account?
Upvotes: 0
Views: 579
Reputation: 4332
As you are using JavaScript, you would need to create the application that would perform these operations. There is a SDK that you can use to access Microsoft Graph, and you can use MSAL libraries for JavaScript which makes it easier to perform authentication.
Complete process is a bit too long to be described in a single reply. For that reason, I strongly recommend that you follow this tutorial on Microsoft Learn: https://learn.microsoft.com/en-us/learn/modules/msgraph-manage-files/
Upvotes: 2