question

JAPNAMSINGH-6684 avatar image
0 Votes"
JAPNAMSINGH-6684 asked 35247258 edited

MSGraph Api- how to get filename of the word file when sending word file as a binary using postman

Hi Team,

how do I get the filename based on https://graph.microsoft.com/v1.0/sites/site-id/drive/root:/{filename}:/content

while in postman because I am sending in the body as binary file and content type="text/plain" for the word file

microsoft-graph-files
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Danstan-MSFT avatar image
0 Votes"
Danstan-MSFT answered

In the example https://graph.microsoft.com/v1.0/sites/site-id/drive/root:/{filename}:/content, the filename is the name of a new file. Quoting from the docs

This example uploads the string "The contents of the file goes here." to a file in the signed-in user's drive under FolderA named FileB.txt.

 PUT /me/drive/root:/FolderA/FileB.txt:/content
 Content-Type: text/plain
    
 The contents of the file goes here.

In your case, the content will be the binary and filename will be something.docx.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.