Are AdaptiveCards supported with MS Teams & the WebHook Connector? - microsoft-teams

Each time I try to send any example json from the documentation I get a HTTP 400 saying that "summary" or "text" is missing (which is indeed the case), however once I make a successful request, Teams displays an empty card
Is this thing supported at all??

Late answer, still, today with Postman app, I was able to post an adaptive card json as a message attachment to Teams incoming webhook [1] url. Microsoft Documentation is also available at link.

Looks like still, webhooks are not supporting adaptiveCards. But there is a trick to send adaptive cards via incoming webhooks like below,
Note: ${Replace it with Your AdapticveCARDShema Json Payload} would be your adaptive card Json payload
{
"type":"message",
"attachments":[
{
"contentType":"application/vnd.microsoft.card.adaptive",
"contentUrl":"null",
"content":{
${Replace it with Your AdapticveCARDShema Json Payload}
}
}
]
}

Webhooks do not yet support Adaptive Cards. We plan to add support for Adaptive Cards shortly.

Related

How manage payment in Google Action using Transactions API

I have developed a Google Actions Application to buy physical goods. I followed this guide: https://developers.google.com/assistant/transactions/physical/dev-guide-physical-gpay
I get the correct request / response flow:
"paymentInfo": {
"displayName": "Mastercard *ommited for security*",
"googleProvidedPaymentInstrument": {
"instrumentToken": "*ommited for security*"
},
"paymentType": "PAYMENT_CARD"
}
and finally Google returns me an instrumentToken in base64, which I think I can decode and use the ID inside it to call the Stripe API: https://stripe.com/docs/api/charges/create#create_charge-source. I tested it and it works, but seems extrange to me... Do I have to do this for every order that is successful?
My question is: Do I have to call the Stripe API myself? Is there no way Google will do it for me? In case I have to send it, should I do it when I receive the request with this field "userDecision": "ORDER_ACCEPTED" and then update the order if the payment is successful?
I have read all the official Google documentation for Actions and I cannot understand the entire flow of interaction.
As #taintedzodiac mentioned in the comment, if you use Stripe as your payment processor then you will have to use Stripe explicitly each time. This is not something that the platform will do automatically.

Using Bot Framework Composer with Audiocodes Voice AI Gateway

I created a simple Bot with Bot Framework Composer and connected it to the Direct Line API
Via Web Chat I can receive the Welcome message as expected
Now I want to use the Audiocodes Voice AI Gateway to create a Voicebot. The integration is described here:
https://www.audiocodes.com/media/14549/voiceai-gateway-integration-guide.pdf
My problem is, that the call is not answered. I can see the ActivityEvent coming in, but it seems that the response send by the bot is not working.
Could it be the case, that the standard send response which is build via LG-format is conflicting with the json format that the Voice AI-Gateway is expecting:
{
"type": "message",
"text": "Hi, how may I assist you?"
}
Is there a chance to override the LG Format and send a custom JSON ?
Additionally I would like to understand, if it is possible to get access to the plain json data that is coming from the Audiocodes Gateway to post it in a body to an external HTTP Server.
Any hints would be appreciated

Can Botframework add a reaction to a user message?

Can bot add a reaction to a user message?
I tried to send an activity like this:
{
"type": "messageReaction",
"reactionsAdded": [{ "type": "like" }],
"replyToId": 1579278444192
}
on this URL - /v3/conversations/{conversationId}/activities/{activityId}
It depends entirely on the channel you are wanting to implement this on. If channel x (Facebook, Slack, etc.) sends "reactions" as part of the activity and the service allows you to scope to it, then it is possible to return bot responses based on those.
The Botbuilder-Samples GitHub 25.message-reaction Javascript sample demonstrates how this is achieved for Teams. The C# version can be referenced here. You would need to adjust the code to look for the appropriate context/activity data points and filter on those to send a response back.
Hope of help!

How can I mute a slack channel/group using slack API?

I'm trying to mute notifications particular group in Slack workspace. Is there any API method available to do?
I've tried using the web-API method mentioned in this GitHub page https://github.com/ErikKalkoken/slackApiDoc/blob/master/users.prefs.set.md.
It causes no error in response but the channels I provided in the 'muted_channels' parameter wasn't muted.
In my case, I didn't have to send a prefs payload as ErikKalkoken described, but instead this one. Found it out thanks to this Tweet: https://twitter.com/slackhq/status/457711460425027584
{
"name": "plain_text_mode",
"value": True
}

Markdown is not working in the Bot Framework Twilio channel

I am trying to create a simple bot that sends images and hyperlinks by SMS using Twilio (trial account).
I do get the reply from the bot , but none of the markdown is working, even simple markdown elements like text or bing
Sample code I am using to send the message through Twilio SMS channel:
public async Task<Message> Post([FromBody]Message message)
{
if(message.Text == "Hello")
{
string messageText = "![Sample Image](http://aka.ms/Fo983c)";
return message.CreateReplyMessage(messageText);
}
Am I missing something? The emulator displays the image and other markdown properly, but when I test using my android phone and text the Twilio number to connect to the bot, it delivers raw HTML and not the rich content.
Twilio developer evangelist here. As pointed our earlier SMS is text only, so markdown or any other formatting will not work.
I just tried sending a message from a bot, and while I get the image correctly on the emulator or webchat, on SMS I only get the URL of the image (i.e. http://aka.ms/Fo983c).
According to the documentation, this is the expected behavior as it states:
Not all channels can represent all markdown fields. As appropriate
channels will fallback to a reasonable approximation, for example,
bold will be represented in text messaging as bold
So I guess for images, it will always fallback to the URL of the image.
As for sending MMS, it appears right now the botframework doesn't support it. To be clear, Twilio itself does support MMS for US and Canada, but it seems Microsoft's implementation didn't take advantage of that right now.
Hope this helps you.
I did this when I was first trying out the framework. Sorry but I don't have that code anymore however I don't recall having to do anything special. I simply sent a picture from my phone to my twilio number and then in the message properties for the message received by the bot there was an attachment field with a URL pointing to the image sent from my phone. Then I used a regular web request to pull down the image.
The details for the attachment objects and content url fields are outlined here.
Because there's no way to emulate the SMS channel you'll have to publish the code live to be able to test it out.
Have fun!

Resources