0

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?

kindall
  • 178,883
  • 35
  • 278
  • 309
The1
  • 5
  • 4

1 Answers1

2

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/

Dragan Panjkov
  • 4,302
  • 4
  • 28
  • 26