send POST from action.submit in Teams - json

here's a newb question. I created an adaptive-card for use in outlook that has an action.http that sends a POST to a webhook url with a single variable entered by the user, which is an email address. This is working great, now i want to use that to send the same message to the user in Teams and as a notification in Windows. I am using Flow and selected the "Post your own adaptive card as the Flow bot to a user". I then entered my json code that i used for the adaptive card for outlook but it doesnt work. So I would assume since the action.http seems to only be available for outlook that I have to change that action for teams to be an action.submit, but then im stuck, where is it submitting to? how do i have it do a POST to my webhook url with the variable data entered by the user?
I did make sure i have the flow bot added to teams and logged in and approved for use for my user for testing. I have also added App Studio to teams and then used it's "card editor" to tweak and practice with the code for the adaptive-card in Teams. I changed my action to be action.submit and finally got a button to appear in the card in Teams but i dont know how to deliver the data which should be the email the user enters, "{\"email\":\"{{email.value}}\"}" to a url using a POST. I dont know what happens when they hit the action.submit button. I have also scoured the internet and microsoft docs for a better understanding but there are no examples of this that I have been able to find.
I used this in the original Adaptive.Card for outlook
{
"type": "ActionSet",
"horizontalAlignment": "Center",
"actions": [
{
"type": "Action.Http",
"title": "Button Text",
"method": "POST",
"body": "{\"email\":\"{{email.value}}\"}",
"url": "mywebhookurl"
}

You are correct that Action.Http is currently not supported in non-Outlook Adaptive Cards. Therefore, you currently have no way of using a Teams Adaptive card to reach your webhook URL.
Action.Submit is generally meant to go to a bot. In this case, it would be Flow, but this isn't currently supported in Flow.
Thankfully,
The fully-custom / interactive card is a scenario we have on our radar.
So unfortunately, you're not doing anything wrong. It just isn't supported yet. I'd imagine that this is why the "Post your own adaptive card..." flow is still in preview:

Related

How to post data including images to kobotoolbox form using the Kobo API?

so this is similar question to :
How to post data to kobotoolbox form using the Kobo API?
but in my case, I want to post a form that includes one or multiple image files.
I'm trying to submit the requests through POSTMAN since I have multiple submissions to make from an old csv, based on these instructions: https://www.linkedin.com/posts/islamburcu_postman-kobo-kobotoolbox-activity-7012761732402065408-1R_L?utm_source=share&utm_medium=member_android
from that article, the request inside POSTMAN should be of the form:
Body:
{
"id": "aaaaaaaaaaaaaaaaaaa", // form ID from the kobo
"submission": {
"q1": "{{q1}}" , // q1 is a question in the form
"meta": {
"instanceID": "uuid:{{_uuid}}" // uuid is the unique submission in the form
}
}
}
Which as I understand, structures the link between my old csv and the form I am submitting to.
So this seems straightforward enough for text based questions, but how to handle images??
Lets say q1 in the above is a "photo" type of question in kobo, in that case the data for each response in the csv will be the name of an image. In a folder next to the csv, I have all the corresponding images. How can I post the right image along with the JSON when I submit the forms?
I'm not really expert (at all) in all of this POST/GET type of requests, so sorry if the question isn't very clear. I will rephrase if needed as I get to understand better.
Thanks for your suggestions!
*update:
I tried converting the image to base64 and submitting that, so now my POSTMAN JSON looks like this:
{
"id": "aaaaaaaaaaaaaaaaaaa", // form ID from the kobo
"submission": {
"q1": "{{q1}}" ,
"image": "data:image/jpg;base64,/9j/4AAQSkZJx..............==",
"meta": {
"instanceID": "uuid:{{_uuid}}"
}
}
}
... which successfully submits, but when I click on the image icon inside kobotoolbox, nothing loads. If I look in the devtools, the icon is linked to https://kobo.humanitarianresponse.info/undefined and returning 404, compared to clicking on a working icon which links to https://kobo.humanitarianresponse.info/api/v2/assets/<_uuid>/data/<_id>/attachments/<unknown_id_9digit>/ and returns 200.
Any ideas what is wrong?

Actionable messages via email is showing empty content in outlook

I am using powershell script and smpt server to send email.
I am reading the html file from local path to send the actionable message for email.
Below is my html file:
<script type="application/adaptivecard+json">{
"type":"AdaptiveCard",
"version":"1.0",
"hideOriginalBody":true,
"body":[
{
"type":"TextBlock",
"text":"Visit the Outlook Dev Portal",
"size":"large"
},
{
"type":"TextBlock",
"text":"Click **Learn More** to learn more about Actionable Messages!"
},
{
"type":"Input.Text",
"id":"feedbackText",
"placeholder":"Let us know what you think about Actionable Messages"
}
],
"actions":[
{
"type":"Action.Http",
"title":"Send Feedback",
"method":"POST",
"url":"https://...",
"body":"{{feedbackText.value}}"
},
{
"type":"Action.OpenUrl",
"title":"Learn More",
"url":"https://learn.microsoft.com/outlook/actionable-messages"
}
]
}</script>
Visit the Outlook Dev Portal to learn more about Actionable Messages.
reference :https://learn.microsoft.com/en-us/outlook/actionable-messages/send-via-email#feedback
only body tag part is visible in outlook not the json part.
Why the Json is not working?
What is the correct way to use this code?
What is file name i should use either filename.html or filename.Json?
JSON is working in codeplayground and not working if i save the filename as .html and .JSON.
Kindly guide me.
It would be grateful if someone help this out.
Thanks.
"The originator property must be set to a valid provider ID generated by the Actionable Email Developer Dashboard. Leaving this property empty when sending to others results in the card being removed."
If you just want to test the sender and the recipient has to be the same account.

Getting carousel list of dialogflow's V2 in Skype

I have been trying to get the carousel list on Skype. I have used the JSON specified in
https://dialogflow.com/docs/reference/api-v2/rest/v2beta1/projects.agent.intents#CarouselSelect
but the Skype isn't rendering it or the facebook messenger. If I'm sending a list of cards using
https://dialogflow.com/docs/reference/api-v2/rest/v2beta1/projects.agent.intents#Card
then the Skype is rendering a vertical listview and Messenger is rendering a carousel list. And the carousel select is working fine in V1 of Dialogflow using the message object
https://dialogflow.com/docs/reference/agent/message-objects#custom_payload_message_object_2 using which I'm able to send a custom payload to get the individual platforms, and also sending it in a payload in V2 didn't help.
Is there's a way to achieve the carousel list in Skype using DialogFlow V2? If it's possible to make this happen using payload, please reply with the JSON.
Thanks in advance!
Finally, I cracked it!
The default list view in messenger in a carousel and the default list view of Skype is normal vertical list view. For most of the official documents that I have seen for Skype bot development, Skype encourages its developers to use defined libraries using which the JSON is created and sent to the bot. Messenger, on the other hand, has many resources on the JSON format.
in DialogFlow V1:
In the message object, we get to add the details like the type of payload and the platform we are expected to send it to. More can be read at
https://dialogflow.com/docs/reference/agent/message-objects
So, the carousel in Skype is achieved by adding the Skype bot's attribute attachmentType
This specifies if the item is of carousel else is of normal list view.
The JSON format is specified at
https://miningbusinessdata.com/dialogflow-api-ai-skype-integration/
This is how a custom payload data is sent to Skype bot. Here, we can send a list of items in attachments array with the type and Skype shall interpret it.
in DialogFlow V2-Beta:
There are 2 ways I have identified using which we can send data to Skype/Messenger using V2-Beta.
Using the predefined templates given by dialogflow
https://dialogflow.com/docs/reference/api-v2/rest/v2beta1/projects.agent.intents#Message
This provides the card, image, carousel views. When a list of card objects is sent to Skype, it displays it as a vertical list and when sent to Messenger, it displays it as Carousel list. But, the Skype and Messenger didn't seem to support the carousel template
So the other option we are left with is sending data in the custom payload.
For sending it in a custom payload, there are 2 payloads in V2.
Inside Message object of the webHookResponse
https://dialogflow.com/docs/reference/api-v2/rest/v2beta1/projects.agent.intents#Message
The other payload is in the webHookResponse we shall send.
https://dialogflow.com/docs/reference/api-v2/rest/v2beta1/WebhookResponse
Both of these are JSON objects and sending it in the Message object actually works and with a proper JSON format. The JSON format of the Skype when being sent as a custom payload has very fewer resources available.
"platform":"SKYPE",
"payload":
{
"skype":
{
"attachmentLayout":"carousel",
"attachments":[
{
"contentType":"application/vnd.microsoft.card.hero",
"content":{
"title":
"subtitle":
"images":[{"url":}],
"buttons":[{
"type":"postBack",
"title":
"value":
}]
}
]
}
}
Using this the list of cards are sent to Skype and the list is displayed as Carousel list. On later searching I found out
https://tsmatz.wordpress.com/2016/08/31/microsoft-bot-framework-messages-howto-image-html-card-button-etc/
It has the list of different JSONs that we can send to Skype
Happy Coding!

href whatsapp link to number

I'm having an issue trying to send Whatsapp messagges through browser using this code:
click
Using this code, Whatsapp opens correctly but the number is not recognized (i'm trying with my number, which is registered in Whatsapp) saying something like "You're trying to reach a non-Whatsapp number. Invite him or send SMS".
My international code (Italy) is +39.
I've tried 003912345, +3912345, 3912345, 12345, but with no success.
Anyone experienced this? Thanks for the help!
You get the message"You're trying to reach a non-Whatsapp number. Invite him or send SMS" because the number you want to use for sending the message to must be present into your phone contact list.
Anyway the attached code you use for the link won't work on iOS.
Try to use: href="whatsapp://send/?text=<>" data-action="share/whatsapp/share" . The link will open WhatsApp but you will have to manually select the consignee of the message from your contact list, otherwise you could use the ABID code to send the message directly to your contact.
Here you'll find more info about this technique: https://www.macstories.net/tutorials/use-whatsapps-url-scheme-with-drafts-launch-center-pro-or-a-bookmarklet/

Insert RSS Feed Content Into Marketo HTML Email Content

I was wondering if it is possible to Insert content from an RSS feed into the content of an email in Marketo?
We also have an API that returns content in JSON format, is it possible to insert content from that feed into the content of an email in Marketo?
Can’t seem to find much info about it online or on Marketo support forums so hope someone can advise.
Thanks.
Assuming you're trying to generate a newsletter type email from your RSS content, you'd probably want to use the Schedule Campaign call to insert your content via a My Token: https://developers.marketo.com/documentation/rest/schedule-campaign/ It would work similarly to the process described here, except you need to use a batch campaign instead of a requestable trigger campaign and you would need to have a my token(s) in your email to replace your content with. Your call would ultimately look something like this:
{
"input":
{
"runAt": "2014-03-26T18:04:10+0000",
"tokens" : [
{
"name": "{{my.RSSContent}}",
"value": <RSSContent>
},
]
}
}
There are also some launpoint partners which implement this, like Digesto
If you're using Marketo or Pardot FeedOtter may be of help as well