When I have a zap of more than 1 step, and the trigger is Webhooks by Zapier with Catch Hook. When I send the response to the webhook, it provides back to the source this kind of payload response:
{"id": "548299ef-bb3a-4769-885a-fb001407c049", "request_id": "5f197542-b118-4fe9-9b45-f1e10b4ac710", "attempt": "5f197542-b118-4fe9-9b45-f1e10b4ac710", "status": "success"}
Is there a way that the connection of the Zap is kept alive and rather than providing the response up, it provides the response of the last step of the Zap?
Short answer: no, it's not possible. You'll always get the json payload you posted when you send a webhook (unless you disable it, but then you just get nothing).
Long answer: No, because the zap execution happens separately from the webhook ingestion. Think of this operation less like a webserver (where the caller is waiting for a response) and more asynchronously (where the caller asks that a thing be done, the server confirms it will do it, and then the thing happens eventually).
What you want to use here is Make, as they support webhook responses.
Check out https://www.make.com/en/help/tools/webhooks
No affiliation, I just assumed Zapier could do this (and am slightly annoyed they can't).
Related
I am creating NestJs application where I am hitting to some third party api form where I am getting resposne some like this:
{
"success": true,
"data": {
"status": "PENDING"
}
}
In this resposne status has two values ALLOWED or PENDING.
Now when I am hitting api for the very first time its shows above response where status is pending.Now I don't want to hit api again and again manually to check whether status is allowed or not.
Is there any way so that it can automatically check whether status in response is ALLOWED or not.
Given that is a third party API over which you have no control, unless they expose some sort of persistent socket connection, the short answer is NO.
At the moment, it seems like your only choice is to poll the API at a certain interval and check.
EDIT: If it is not required to send a response when status changes to ALLOWED, then you can perform CRON jobs as well, but the basic concept remains the same regardless, you're gonna have to hit the API at a certain interval to get updated values.
I'm creating a bot in botcomposer(v1.4.0) which involves an http request. What I'm looking for is an asynchronous call so that I don't have to wait for the response from the http call, while the user can continue to chat with the bot.
Also, I want to prompt the user when the response comes.
Thank you in advance.
Proactive messages would be the best option. Unfortunately, they are not implemented in Composer at this time. You might be able to create a custom action and accomplish your goal (my assumption without knowing more of what your requirements are).
I'm updating a webapp to Stripes SCA ready flow with PaymentIntent.
So far I have working (on my local test server):
Generate Intent on frontend and pass secret to form
Use Elements to collect card into
Use handleCardPayment to create the charge
Now here's the part where I am unsure. The handleCardPayment responses all seem to indicate a succeeded event, but the documentation warns to not use this repsonse, but instead wait for the Webhook response and only then fulfill customer orders.
Step 5: Asynchronously fulfill the customer’s order
You can use the PaymentIntent returned by Stripe.js to provide
immediate feedback to your customers when the payment completes on the
client. However, your integration should not attempt to handle order
fulfillment on the client side because it is possible for customers to
leave the page after payment is complete but before the fulfillment
process initiates. Instead, you will need to handle asynchronous
events in order to be notified and drive fulfillment when the payment
succeeds. Documentation
So far so good, I've set up test webhooks and tunneling through ngrok I can actually receive the paymentIntent from the Stripe webhook.
Now, my question comes at this point, where the Stripe documentation ends. How should I deal with the UI from the point of the "Pay" button being pressed, and how do I in the frontend detect that the webhook has been triggered?
I am wondering if I should poll my own server, which in turn retrieves a database result that indicated if the webhook for this order has been received? Or what is a reasonable way to deal with this, technically and from an UX perspective?
Any pointers?
I just implemented this, and I decided to poll my own server for the update and ask the user to wait. The webhook marks our internal representation as "paid", so we don't need to poll Stripe. If the webhook doesn't come within 30 seconds, we tell the user that it's ok to leave the page, and we'll email them the result.
Technically, these webhooks can take up to 7 days to come in, so that's why Stripe doesn't want you to have the user wait. In reality, it almost always comes in within 5 seconds, and I would rather just have the user wait and see a final confirmation in the same session.
I'm implementing a Mail to Webhook Zapier integration. When testing the webhook during the creation process, the test is stuck and won't move on to the next step in the creation process.
When looking at my app logs, I see that the webhook is being sent over and over again, and doesn't stop, even though the app sends '200 ok' in the response.
Why does this happen? What response do I need to send to make it finish?
David here, from the Zapier Platform team.
It's hard to say for sure, but I believe the response needs to include some content. At minimum, that's {} (valid JSON), but it could also be {"ok": true} or something.
That said, an empty response is something we should handle so if you could write into partners#zapier.com with your zap id, we can take a closer look!
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.