Search code examples
microsoft-graph-apibotframeworkchatbot

ms botframework attachment can not generate sharelink


I use botframework api to send message to users. the message contains attachment. So I send the activity like this

{
  "attachments": [{
    "contentType": "application/vnd.microsoft.teams.card.file.info",
    "contentUrl": "https://contoso.sharepoint.com/personal/johnadams_contoso_com/Documents/Applications/file_example.txt",
    "name": "file_example.txt",
    "content": {
      "uniqueId": "1150D938-8870-4044-9F2C-5BBDEBA70C8C",
      "fileType": "txt",
    }
  }]
}

And I send bot message to user like this message sent to bot

And I want to generate sharelink by clicking this button generate link by clicking button

But I got a error that told me I can's generate sharelink error

Does anyone knows the reason?


Solution

  • This issue is confirmed by the original post that it's caused by incorrect uniqueID. The uniqueID is not the itemID in one drive.

    For more information about different IDs for botframework, please refer to document here: https://learn.microsoft.com/en-us/previous-versions/azure/bot-service/bot-service-resources-identifiers-guide?view=azure-bot-service-3.0