Logic Apps custom action similar to Request Response - webhooks

Is it possible to create a Logic Apps custom action similar to the Request Response action? If so, can you please guide me how I would do this? The Request Response action is different from other actions as it doesn't call an API, but instead responds to the trigger.
I'd like to create a specific version of the Request Response action that forces a certain status code and response structure, so that people using the connector understand how to use it. The action is to be used in conjunction with a custom trigger, which is basically a webhook. The API that call the webhook requires the response to be in a specific format. Right now I can make it work with the Request Response action, but I need to make sure I return the correct JSON structure.

Update, try Azure Api-Management. Otherwise, I would validate that all values are present and if not I would reply which values are missing.

Related

Zapier Zap for retrieving customer data from stripe

I have created a Zapier Zap with the following steps:
Catch Hook (Trigger): A webhook which catches post requests with a param customer_id
Find Customer (Action): Stripe integration which takes the customer_id parameter from (1) and retrieves the customer from Stripe
The setup works correctly in the Zapier setup flow, however, when I post to the endpoint from (1) I simply get a 200 return from step (1) alone. Instead I want to receive the data as returned by step (2).
Is this possible using Zapier?
You can't get data back directly when sending a webhook to Zapier. You can read this answer for more info, but the idea is that your zap steps happen asynchronously instead of right away.
You can either add a 3rd step to send the result somewhere (perhaps to the server that's making the initial request to Zapier?) or, run a little webserver yourself that can reply to your initial request with the response you expect.

Pass query parameter while making POST request from twilio webhook

When the call ends, I want to send data to Microsoft teams. For that purpose, I am making a POST request using the Twilio webhook. I have added the link for HTTP request in CALL STATUS CHANGES. But I also want to send data collected during calls. Is there any way to do that?
Article here(https://www.twilio.com/docs/usage/webhooks/voice-webhooks) doesn't mention anything about passing data.
My POST request URI looks something like this:-
https://xyz?Name=Himanshu&Phone=1234567890
I want Name and Phone data to be collected from Memory.
Twilio developer evangelist here.
When Twilio sends a webhook request about a voice call it will send a whole bunch of parameters including CallSid, To, From (the number user called from), AccountSid, CallStatus and more all of which are listed here.
I would not recommend making the Twilio webhook directly to Microsoft Teams as Twilio expects there to be a response to the request. Also, Twilio cannot know the name of your caller either.
Instead, I would recommend setting up the webhook request to go to your own application where you can parse out the data you need from the request, collect other data like name, and then make the request to Teams to complete your interaction.

Make Web Activity work with response that's not a proper Json

I'm using Web Activity to make a POST request to a slack webhook.
The problem is that the slack webhook responds with a 200 and an "ok" string as the body of the response and the web activity doesn't seems to like that because I'm getting the error:
{
"errorCode": "2108",
"message": "Response Content is not a valid JObject",
"failureType": "UserError",
"target": "activityName"
}
So my question is if there is a workaround for this or is there is an alternative to use web activity. For the time being I know I can use a custom activity and even I'm thinking of setting up an azure function that acts as a proxy and thus returns a proper Json.
Note: I'm using this slack integration to alert when something goes wrong. Of course I'm also open to suggestions on how to alert my team when something is not working in ADF (sending an email wouldn't work because our inboxes are completely cluttered, so slack seemed like a good alternative for a change).
You can use a lookup activity with an HTTP dataset. You can define the dataset to be a REST call, and I don't think the lookup activity is picky about the response format.
Another option might be to use an Azure Logic App to update Slack. You can either use it as a 'proxy' to be called by ADF, or see if it can be set up to perform the monitoring you want as well.
According to the official doc, REST endpoints that the web activity invokes must return a response of type JSON. The activity will timeout at 1 minute with an error if it does not receive a response from the endpoint.
So currently I think your workaround should be the right way.
And besides of email, I think ADF also provides other approaches to monitor your data factory. Please find this doc for more details.

What is the alternative for catch hook in microsoft FLOW

I know this question is bit ambiguous. Let me clear that up. First thing is, this question is about integrating two services using an integration service(Zapier, Flow or IFTTT.. But um focusing on ms flows in here). I need to connect one of my services via a wehbook URL given by ms flows so that i can send my request to flow.
So in Zapier we have something called Webhooks by Zapier which gives us a public URL catch hook to trigger a particular zap. But in flows we dont have such thing. I was wondering whether we have an alternative in ms flows to fire a trigger.
Problem Solved!
The thing is, i did not find a way to setup exact catch hook from ms flows. But there is an alternative. In ms flows they provides us a connector called request which generates a post url. This url is continuously listening just like catch hooks in zapier.
.One drawback of this alternative is, we have to manually setup the payload of the incoming request in order to use data in actions in JSon schema format which is a headache.

How to get dynamic response based on the result of the action performed in Api.ai?

I'm trying out few examples in Api.ai console. I see there are examples where the agent responds by using the values that are extracted from the user query or from the context. But is there a way to display response that is formed using the output of the action performed?
For example -
User: Is my pizza order confirmed?
Action: check order status
Response: Yes, it's confirmed (or "No, it's not")
You will have to use some custom webhook to do this, either integrating with a 3rd party API or will a server side call of your own to a database- in this case the webhook would take the user's ID and query if their pizza is ready or not, and this would then be passed back to API.ai.
Here is an example using a 3rd party webhook to do what you are asking:
https://github.com/api-ai/apiai-weather-webhook-sample
Yes you can do this with webhooks.
Typically, you would save the status of the order in your db, then you could have an intent that would:
Understand the query of your user (Is my pizza order confirmed)
The intent would call your webhook
the webhook would return the status order.
Api.ai would then give the answer.
When you use webhooks you need to return the speech response, the displayText, optionally the data that your apps need, the contextOut and the source.
I guess you would also need to have implement some context in api.ai so that you could now who is asking about the satus of the order. You would then be able to use the sessionId
Matt is correct here. You must use a webhook. Unfortunately the documentation from API.AI is currently very poor. Here's a screenshot example of an incoming post request. My message function will return an object with a desired response. In this case, I am using a Telegram chat bot. If you are not using any messenger, you can drop the data key: value. FollowupEvent is also optional.
Node.JS code with Restify
On your API.AI intent, make sure to check off Webhook. If you end getting the text response 'Broken' here, then something went wrong and you should check your error codes.
API.AI intent
And lastly, under the fulfillment tab, make sure to enable the webhook and point it at the right endpoint.

Resources