How to send adaptive card templates with Graph API ?

BERKAY ŞAHİN 20 Reputation points
2023-02-03T07:46:38.57+00:00

Hi. I am trying to send adaptive card to a chat with graph api and i am using .net core web api. I want to try with different adaptive card. This question https://learn.microsoft.com/en-us/answers/questions/158736/how-to-send-an-adaptive-card-through-microsoft-gra works but when i select template card from https://adaptivecards.io/samples/ these adaptive cards have no id but the card which in first link has an id . When i tried to send without id it gives me an error. Can i send it without an id or how can i find their ids.

Developer technologies | ASP.NET | ASP.NET Core
Microsoft Security | Microsoft Graph
Microsoft Teams | Microsoft Teams for business | Other
0 comments No comments
{count} votes

Accepted answer
  1. Gopinath Chennamadhavuni 2,446 Reputation points
    2023-02-03T10:15:21.96+00:00

    Hi @BERKAY ŞAHİN

    Hope you are doing well.

    Attachment's ID in Adaptive card can be a new randomly generated GUID and must be unique. However, the attachment's ID must be the same in the body and attachments elements. ID is required when sending a card as a message.

    I have executed the same example provided at: https://learn.microsoft.com/en-us/graph/api/chatmessage-post?view=graph-rest-1.0&tabs=http#example-3-send-message-containing-cards with my own randomly generated ID in GUID format. Card message has been successfully posted on Team's Channel. Please find the below screen shot.

    Reference link:https://learn.microsoft.com/en-us/graph/api/chatmessage-post?view=graph-rest-1.0&tabs=http

    Adaptive_resp

    Adaptive_resp_UI

    Please check and validate the same from your end.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.

    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful

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.