OneDrive / onedrive-api-docs

Official documentation for the OneDrive API
MIT License
454 stars 230 forks source link

Missing sharing link when creating a permission to a file stored in SharePoint #815

Closed DanHopkins-TGI closed 1 year ago

DanHopkins-TGI commented 6 years ago

I am not sure if this is an issue with the documentation or I am simply misunderstanding something. I am currently attempting to manipulate the permissions of files that are stored in a SharePoint document library. When I use /invite to grant permission to an email address outside of the SharePoint site organization (i.e. an external user), I get the following response:

Success - Status Code 200
{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(permission)",
    "value": [
        {
            "@odata.type": "#microsoft.graph.permission",
            "grantedTo": {
                "user": {
                    "displayName": "{email}"
                }
            },
            "id": "{permissionId}",
            "roles": [
                "write"
            ]
        }
    ]
}

Looking at the file permissions from SharePoint, I can see that it successfully created a share link for the provided email address that grants the requested permission. My goal is to access that share link using the Graph Api. However, the link is not provided in the response and the newly created permission is not listed when I query the file's permissions from Graph like so: GET https://graph.microsoft.com/v1.0/drives/{driveId}/items/{itemId}/permissions. Furthermore, if I request the permission using the returned permission id (GET https://graph.microsoft.com/v1.0/drives/{driveId}/items/{itemId}/permissions/{permissionId}), then I receive the following response:

{
    "error": {
        "code": "itemNotFound",
        "message": "The resource could not be found.",
        "innerError": {
            "request-id": "0efaf915-bacf-4cfc-983c-8bc3af716c34",
            "date": "2018-03-23T18:53:40"
        }
    }
}

I was under the impression that the response should contain a 'link' facet with the sharing url when I first create the permission and that I could access the permission after it was created via /permissions or /permissions/{permissionId}. Is this incorrect? If so, is there any way to access the share url associated with permissions created using /invite?

DanHopkins-TGI commented 6 years ago

I just wanted to check on the status of this issue and see if there are currently any known workarounds. Any help would be greatly appreciated!

patrick-rodgers commented 1 year ago

As part of a repository clean up effort we are closing older issues. If this issue remains, please: open a new issue, reference this issue, and provide any additional details that may help in resolution. Thank you for your understanding as we work to improve our responsiveness.