Sharepoint app
Onze sharepoint app toevoegen
In a Web Browser open Graph Explorer (https://developer.microsoft.com/en-us/graph/graph-explorer) and log in as someone who has the necessary privileges to create/modify sharepoint access permissions.
Execute the following GET request, replace '' with the name of your site, leave the body empty...
https://graph.microsoft.com/v1.0/sites?select=webUrl,Title,Id&$search="<site-name>"You should see something like this - make a note of the value.id property (the 'site id') as you'll need it later...
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites",
"value": [
{
"id": "XXX.sharepoint.com,XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX,XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
"webUrl": "https://XXX.sharepoint.com/sites/SiteName",
"displayName": "SiteName"
}
]
}We now need to make a POST request (though this time we need to put something in the body) to give the above application permissions to read and write to the site, via an URL like this (replacing '' with the 'site id' you made a note of above)...
https://graph.microsoft.com/v1.0/sites/<site-id-from-above-GET-request>/permissionsSo for the above site for example, the URL would look like this...
https://graph.microsoft.com/v1.0/sites/XXX.sharepoint.com,XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX,XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/permissions
...with this as the body, changing XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX to the 'application (client) id' you made a note of earlier in step 7...
{
"roles": [
"manage"
],
"grantedToIdentities": [
{
"application": {
"id": "ad916092-4fef-492d-80ac-31b34e96f2de",
"displayName": "Omnidesk Assistant Sharepoint"
}
}
]
}Last updated