How do I get an HTML response from a Zapier catch hook - zapier

I have a zap that gets invoked by a URL sent to a user in an email. The user clicks on the url, that invokes the zap. The zap then does some work removing items from a google calendar. All that works perfectly. However, the user gets a JSON response like:
{ "status": "success", "attempt": "58f76ead-ffa8-4807-b4a4-9cb31537ace0", "id": "556d2bd7-e413-4fe0-9602-af4bfbba1f48", "request_id": "zjd5zKTwCgtdDYS0" }
I would prefer that the user got an HTML response. Is this a javascript/python coding issue? Is there some unusually named zapier function that does this already?

It's not possible to define the response content returned by requests made to a Zapier webhook URL. The response will always be a JSON response with basic status/meta data.
To get what you're looking for, you'd need to link your users to a webpage that will in turn make an HTTP request to Zapier when they visit.

Related

how to prevent message creation api to resend complete message

I use graph api to create a message with attachment(s).
All runs fine but the server send back the complete message in response, including the attachments.
Is there a way to only get the message id in the response ?
I try with :
string webApiUrl = $"{_apiUrl}v1.0/users/{senderId}/messages?$select=id"
but I still get the whole message with 98ko of attachment.
You can do it using the prefer:return=minimal header in the request which will mean you will just get a 204 response. However the id of the item that was created will be returned in the location header (the response should really have the OData-EntityId if they are following the oData spec to the letter, also I'm not sure why it return the Outlook v2 location rather then the graph but the message Id is the same between them)

Twitter API v1.1 media INIT error code 32

I am trying to get the media_id for a media upload. See docs here.
When using postman, my request is processed successfully and I get a response like this:
{
"media_id": 1222234872222222401,
"media_id_string": "1222734822222102201",
"expires_after_secs": 86399
}
Unfortunately, using postman for our app is not an option. However, when I post a tweet with just text, the tweet is posted successfully using our own native code. I have also recreated the request from postman, and can successfully recreated the same oauth_signature needed for the media upload authorization. So I know that the backend is working in that I can create valid credentials, but I think I need some help structuring the POST request itself.
Here is the code (Lucee ColdFusion):
mediaEndpoint = "https://upload.twitter.com/1.1/media/upload.json?command=INIT&total_bytes=10240&media_type=image/jpg&oauth_consumer_key=consumerKeyHere&oauth_token=tokenHere&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1653075352&oauth_nonce=UU5V18WLaPN&oauth_version=1.0&oauth_signature=verifiedSignature";
cfhttp(url=mediaEndpoint, method="POST", result="init") {
cfhttpparam(type="header", name="Content-Type", value="application/x-www-form-urlencoded");
cfhttpparam(type="header", name="Accepts", value="*/*");
cfhttpparam(type="header", name="Accept-Encoding", value="gzip, deflate, br");
cfhttpparam(type="header", name="Connection", value="keep-alive");
cfhttpparam(type="body", value="command=INIT&media_type=#mediaParameters.media_type#&total_bytes=#mediaParameters.total_bytes#");
}
But I keep getting the following 401:
{"errors":[{"code":32,"message":"Could not authenticate you."}]}
I believe you're supposed to send your authorization token in the header. You're sending it in the URL as a query string. Twitter's documentation would indicate you need to include an authorization header as such:
cfhttpparam(type="header", name="Authorization", value="Bearer: #YourAccessToken#");

I'm unable to use parsed variable from http request widget

I'm using Twilio Studio. Within I'm using the Make HTTP Request widget to hit an api endpoint.
After that I'm using a Say/Play widget to say one of the variables from Make HTTP Request. {{widgets.http_1.body}} works fine with api response:
{ "message": "Hello World", "completed": true }
However, if I want to return {{widgets.http_1.parsed.message}} the say text portion for this will be empty.
What might be wrong here? I can see the endpoint I hit with the Make HTTP Request step returns a 200 & the json is valid.
Flow - Make HTTP Request - Say Widget
Twilio developer evangelist here.
Your screenshot of the Say widget shows that you are using {{ widgets.http_1.body.parsed.message }}. When using the parsed data, you don't need the body in there, so it should just be:
{{ widgets.http_1.parsed.message }}

HTTP POST returns 21201 - No 'To' Number Specified - MS Flow

Looking to send an HTTP POST through Microsoft Flow/Power Automate to make a voice call in Twilio. I feel like I've tried every iteration possible, but keep getting the error 21201:
{
"code": 21201,
"message": "No 'To' number is specified",
"more_info": "https://www.twilio.com/docs/errors/21201",
"status": 400
}
Screenshot of Power Automate HTTP Action
I've seen other vids of people using Azure Functions with C# and it feels like I should be able to do what I need here...like, really close. But I'm not a dev, so maybe I'm way off. Would appreciate any direction on this.
Thanks!
The issue appears to be you are sending a content type of application/json where Twilio requires application/x-www-form-urlencoded
Creating or Updating Resources with the HTTP POST and PUT Methods
Also found this:
Custom connector action with x-www-form-urlencoded content-type

Swagger UI showing response body {} and status 0

I am using swagger to create API docs.
My issue is that once we send a call to the API, the browser sends an OPTIONS call and it returns "OK"; after that the browser sends the actual call of API and then I am not receiving the expected output.
Instead of it, it's showing no-content in response and 0 as the response code.
Please can any one help.

Resources