Onedrive-api-docs: ODB/SPO: Add permissions for a group on a drive item

Created on 6 Mar 2018  Â·  3Comments  Â·  Source: OneDrive/onedrive-api-docs

I have been trying to add permissions for a group on a drive item following the documentation. The DriveReceipient docs say:

When using invite to add permissions, the DriveRecipient can specify email, alias, or objectId. Only one of these values is required.*

However, sending the following request does not work:

{
    "requireSignIn": true,
    "sendInvitation": false,
    "roles": [ "read"],
    "recipients": [
        { "objectId": {group_guid} }
    ]
}

Response:

SPClientServiceRequestDuration →163
SPRequestDuration →197
SPRequestGuid →22fa509e-40dc-5000-5289-2c2e4c383d55
request-id →22fa509e-40dc-5000-5289-2c2e4c383d55

{
    "error": {
        "code": "itemNotFound",
        "message": "One of the provided recipients could not be found"
    }
}

The group GUID that I'm using is what I obtain using the Graph API /groups endpoint, the id field for the group. Using alias: {group_name} does not work either.

Is sharing to groups supported by the unified API? If so, what should I change to implement it properly? We're trying to move away from the SPO API and to use the unified API and this is a big blocker. Thank you.

* by the way, it's not just that only one of these values is required, but it is required to send one and only one value (sending two will make it error--I tried adding both alias and objectId to see if the endpoint would find the group, but it didn't work).

bug

Most helpful comment

Thanks for reporting this issue. This is indeed a bug. I am working on fixing it.

All 3 comments

This not only affects groups but also users.

Thanks for reporting this issue. This is indeed a bug. I am working on fixing it.

katahir notifications@github.com
Hi guys,
We made an attempted fix. Can you please try again and let me know what you see?

Received that mail above on 24th April. Don't know why it doesn't show up here or if it has been removed. But the issue is still not fixed.

Was this page helpful?
0 / 5 - 0 ratings