Onedrive

Manage OneDrive files and folders via Microsoft Graph. Upload, download, and share files.

kbarbel640-del Updated 1 repo stars

File contents

OneDrive

Microsoft cloud storage.

Environment

export MICROSOFT_ACCESS_TOKEN="xxxxxxxxxx"

List Root Files

curl "https://graph.microsoft.com/v1.0/me/drive/root/children" -H "Authorization: Bearer $MICROSOFT_ACCESS_TOKEN"

Upload File

curl -X PUT "https://graph.microsoft.com/v1.0/me/drive/root:/filename.txt:/content" \
  -H "Authorization: Bearer $MICROSOFT_ACCESS_TOKEN" \
  -H "Content-Type: text/plain" \
  --data-binary @localfile.txt

Download File

curl "https://graph.microsoft.com/v1.0/me/drive/items/{itemId}/content" \
  -H "Authorization: Bearer $MICROSOFT_ACCESS_TOKEN" -o downloaded.txt

Links

kbarbel640-del/skills/tree/main/skills/mrgoodb/onedrive commit b0b33f8187

Frequently asked questions

npx skillmds@latest add kbarbel640-del/onedrive