Search code examples
microsoft-graph-apimicrosoft-teamsadaptive-cards

Opening Task module from Adaptive Card using Action.OpenUrl


we are posting an Adaptive card in channel using following Graph API https://learn.microsoft.com/en-us/graph/api/channel-post-chatmessage?view=graph-rest-beta&tabs=cs

Our payload is

{
  "body":{
    "contentType":"html",
    "content":"<attachment id="attachmentId"></attachment>"  // for attachmentId see attachments section below
  },
  "attachments":[
    {
      "id":"attachmentId",
      "content":cardData // this is JSON.stringify of actual Adaptive card data 
    }
  ]
}

Also our Adaptive card is like

{
  "type":"AdaptiveCard",
  "$schema":"http://adaptivecards.io/schemas/adaptive-card.json",
  "body":"some body",
  "actions":[
    {
       "type":"Action.OpenUrl",
       "title":"Suggest Item",
       "url":"https://teams.microsoft.com/l/task/2a05d07c-d194-400e-8122-cad64cfe1cef?url=https%3A%2F%2Flocalhost%3A44349%2Fteams%2F%23%2Fsuggest%2Fee31b3aa-f60f-4594-a964-a01fcc461ceb%3Ffrom%3Dcard&height=540&width=800&title=*Suggest%20item"
    }
  ]
}

If i post task module Url in chat and click it works, But it is not working from Adaptive Card Action.OpenUrl Previously it used to work


Solution

  • There was a * in my url for title, after removing that it works again