Sep 09 2021 09:05 AM
All,
Using the beta version of the API, with the help of the documentation, I'm able to use graph to send a team mention to a channel and I'm also able to send an adaptive card to a channel but I can't send a team mention to a channel in an adaptive card, any help?
{
"importance": "high",
"subject": "This is a mention",
"body":
{
"contentType": "html",
"content": "Text goes here. <br/> <at id ='0'></at> <br/><br/>"
} ,
"mentions": [
{
"id": 0,
"mentionText": "test",
"mentioned": {
"conversation": {
"id": "",
"displayName": "test",
"conversationIdentityType": "team"
}
}
}
]
}
{
"subject": null,
"body": {
"contentType": "html",
"content": "<attachment id=" + randomKey + "></attachment>"
},
"attachments": [{
"id": randomKey,
"contentType": "application/vnd.microsoft.card.thumbnail",
"contentUrl": null,
"content": {
"title": "Test title",
"text": "textgoes here",
"buttons": [{
"type": "openUrl",
"title": "Button",
"value": "https://microsoft.com"
},
{
"type": "openUrl",
"title": "Button2",
"value": "https://google.com"
}
]},
"name": null,
"thumbnailUrl": null
}]
}
Sep 09 2021 11:22 AM
Sep 10 2021 06:09 AM
I've attempted to build a JSON script to perform this action:
{
"importance":"high",
"subject":"This is a mention",
"body":{
"contentType":"html",
"content":"Text goes here. <br/> <at id ='0'></at> <br/><br/>"
},
"mentions":[
{
"id":0,
"mentionText":"",
"mentioned":{
"conversation":{
"id":"0",
"displayName":"teamName",
"conversationIdentityType":"team"
}
}
}
],
"attachments":[
{
"id":"randomKey",
"contentType":"application/vnd.microsoft.card.thumbnail",
"contentUrl":null,
"content":{
"title":"Test title",
"text":"textgoes here",
"buttons":[
{
"type":"openUrl",
"title":"Button",
"value":"https://microsoft.com"
},
{
"type":"openUrl",
"title":"Button2",
"value":"https://google.com"
}
]
},
"name":null,
"thumbnailUrl":null
}
]
}
The error I receive is:
Method failed: (/beta/teams/) with code: 400
{"error":{"code":"BadRequest","message":"Invalid request body was sent.",
Sep 11 2021 09:14 AM
Sep 11 2021 09:58 AM
Sep 13 2021 01:26 AM
Sep 25 2021 10:53 AM - edited Sep 25 2021 11:22 AM
@beepboop - Could you please let us know whether it is resolved or still looking for it's solution?
Thanks,
Chetan Sharma
------------------------------------------------------
If the response is helpful, please click "**Mark as Best Response**" and like it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.