Graph createLink method not returning any url when type is embed

Daniel Sousa | Flexmeester 1 Reputation point
2022-02-18T16:17:20.03+00:00

Hey there,

I've been trying to use graph.microsoft.com/v1.0 to retrieve an iframe HTML in order to be able to embed a Word document in edit mode on a web app. But so far all I get is this error:

{
"error": {
"code": "notSupported",
"message": "Requested sharingLink type is not yet available.",
"innerError": {
"date": "2022-02-18T15:48:38",
"request-id": "ad9ac825-42b6-429c-89b0-8ec623f918b7",
"client-request-id": "ad9ac825-42b6-429c-89b0-8ec623f918b7"
}
}
}

Strange part is that I can get a valid link when using type "edit" or "view".

I'm doing a Post request to the URL:
https://graph.microsoft.com/v1.0/drives/{DRIVEID}/items/{ITEMID}/createlink

and using the JSON body:
{
"type": "embed"
}

Any help? Cheers,
Daniel

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,036 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Srinivasa Rao Darna 6,721 Reputation points Microsoft Vendor
    2022-02-18T17:45:46.417+00:00

    Hi @Daniel Sousa | Flexmeester ,

    As per documentation driveitem-createlink, it is currently supported for OneDrive Personal only.

    Clip from the documentation:
    175923-createlink-embed.jpg

    When you attempt createLink for OneDrive for Business or SharePoint Online, it will return this error message "notSupported".

    Hope this helps.
    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.