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 }}
Related
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
The F# Saturn web framework fails on retrieving a value for GET method when acceptJson is a part of pipeline.
Below a sample code that I run to reproduce the issue:
let api = pipeline {
plug acceptJson
set_header "x-pipeline-type" "Api"
}
let apiRouter = router {
not_found_handler (setStatusCode 404 >=> text "Api 404")
pipe_through api
get "/test" (text "Hello world")
}
let appRouter = router {
forward "/api" apiRouter
}
appRouter is then added in the use_router section of the application code.
When I'm sending the request with a header Content-Type:application/json the response is "404 not found". But if I remove plug acceptJson from the api pipeline definition I get a correct response.
How to make Saturn work with the plug acceptJson?
I suspect 3615 is right - this seems similar to a problem I just solved yesterday after beating my head against the wall for a week. A request to my app (just a straight app from "dotnew new Saturn") from my browser was accepted. But a request to the same url from a test method returned a 404. It boiled down to the fact that the test request was missing an "Accept" header. When I added "Accept text/html", it worked. What I deduced from that is that, if the app can't find a content type that will be accepted according to the request, then it will report a 404. Your situation is the same - you're trying to return Json, but the request didn't include an "Accept application/json", so it can't find any page that the request would accept.
Of course, I could be wrong.
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.
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.
I have never used JUnit or other testing frameworks. All i know is how to develop rest service. I recently saw REST assured framework to test REST api. But all the articles that i found looks like below. But i don't know how to pass request xml and how will i get response and when should i call this method.?
Do i need to use some other tool before this REST assured.? I am completely beginner in this kind of testing frameworks. Please show me some light in this world. All i know is how to send request and check values in the response in SOAPUI. I have never tried this.
expect().
statusCode(200).
body(
"user.email", equalTo("test#hascode.com"),
"user.firstName", equalTo("Tim"),
"user.lastName", equalTo("Testerman"),
"user.id", equalTo("1")).
when().
get("/service/single-user/xml");
expect() /* what u expect after sending a request to REST Service */
statusCode(200) /*you are expecting 200 as statuscode which tells request handled successfully at server */
body()
/* the conditions given in body are compare the value with expected values. "equalTo" hamcrest matcher condition (you need to have hamcrest jar in java classpath).*/
when(). /* as is name says above all will be done after sending get/post/put/delete request right so before you put these get,post,put,delete you will have this method as prefix */
get("/service/single-user/xml")
/* the actual REST API request url goes here. can be GET/POST/PUT/DELETE. the confusion for you is its only showing half part which is base path.you can give entire request url in get() method.*/
more on:
http://rest-assured.googlecode.com/svn/tags/1.8.1/apidocs/com/jayway/restassured/RestAssured.html
I hope this helps.