Skip to content

Instantly share code, notes, and snippets.

@dpim
Last active February 6, 2018 17:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dpim/6686a5d03bd095166f40eaf7040a00a7 to your computer and use it in GitHub Desktop.
Save dpim/6686a5d03bd095166f40eaf7040a00a7 to your computer and use it in GitHub Desktop.
Sample requests

Samples requests to storage APIs in the Microsoft Graph

OneDrive/SharePoint APIs

Create new document

PUT https://graph.microsoft.com/v1.0/me/drive/root:/Demos/Test1.txt:/content
Headers Content-type: text/plain
Body hello world

List folders

GET https://graph.microsoft.com/v1.0/me/drive/root:/Demos

List folders and children

GET https://graph.microsoft.com/v1.0/me/drive/root:/Demos?$expand=children

Search folder (root)

GET https://graph.microsoft.com/v1.0/me/drive/root/search(q='hello world')

Get delta link

GET https://graph.microsoft.com/v1.0/me/drive/root/delta

See changes

GET https://graph.microsoft.com/v1.0/me/drive/root/delta?token=<your delta token>

Extensions

Get registered schema extensions

GET https://graph.microsoft.com/v1.0/schemaextensions

Using a schema extension

PATCH https://graph.microsoft.com/v1.0/me
Headers Content-type: application/json
Body {"adatumisv_courses": {"id": 321,"name": "english","type": "elective"}}

Querying with a schema extension

GET https://graph.microsoft.com/v1.0/me?$select=adatumisv_courses

Using an open extension

PATCH https://graph.microsoft.com/v1.0/me/extensions
Headers Content-type: application/json
Body {"favoriteColor": "green"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment