0
votes

I am working with graph api, using which I want to share a drive item via link with password and expiration date set on it. The documentation said to use this api: '''https://graph.microsoft.com/v1.0/drives/{driveId}/items/{itemId}/createLink'''. The body for the request is '''{

"type" : "view",
"scope": "anonymous",
"password": "XXXXXXX"

}'''. But when I make a post request, I am getting an error '''{

"error": {
    "code": "-1, Microsoft.SharePoint.Client.InvalidClientQueryException",
    "message": "The parameter password does not exist in method createLink.",
    "innerError": {
        "date": "XXXXXX",
        "request-id": "XXXXXX",
        "client-request-id": "XXXXXX"
    }
}

}'''.

The drive that I am using is a business account user drive(user@company.com). Any help in this regard to resolve the issue is highly appreciated.

1
In the documentation it is specified that you should use password field only on Personal OneDrive.Shiva Keshav Varma
Are you still looking for help?Shiva Keshav Varma
Moving this to Answer :)-Shiva Keshav Varma

1 Answers

0
votes

As it is specified in the document that you should use password field or password property only on the Personal OneDrive.

If you want to use you Work account to create link, you can remove the password field and its value and use the call, it will work.

POST https://graph.microsoft.com/v1.0/drives/{driveId}/items/{itemId}/createLink

Request Body:

{
    "type" : "view",
    "scope": "anonymous"
}