Search code examples
outlookmicrosoft-graph-apionedrive

Copy an attachment file from outlook to onedrive using Ms Graph Api without download it


I have a robot that check email in outlook using Graph Api (v1).

I would like to copy the attachments files from the email on a onedrive folder without download it.

I know that i can use Flow to that, but it's no convenient for my task.

so i try that :

POST https://graph.microsoft.com/v1.0/me/drive/root/children Content-Type: application/json Prefer: respond-async

{
"@microsoft.graph.fileAttachment": "https://graph.microsoft.com/v1.0/me/messages/{message_id}/Attachments/{attachment_id}/$value",
"name": "test.pdf",
"file": {}}

This create the file but without the data inside... (0 byte file)

Ref : https://learn.microsoft.com/fr-fr/onedrive/developer/rest-api/api/driveitem_upload_url?view=odsp-graph-online


Solution

  • Not currently support...

    Ref : Microsoft Support