Twilio truncating the query string in callback URL - callback

I am passing a callback URL with a query string when sending an SMS message. I checked the debugger logs when the callback didn't seem to be working. I see "Error - 11200 HTTP retrieval failure" for the callback URL and it seems from the log details that the callback URL that I am passing is truncated after "?". The query string I am passing is not part of the URL and hence Twilio is getting the above error.
How to pass query string to Twilio's callback API?

We were actually having the same issue in our project. Looks like Twilio trims any query string parameters. Our workaround was to add any additional data to our route:
//original route:
GET /user/{userid}?myParam={myParam}
GET user/123?myParam=456
//modified route
GET /user/{userid}/{myParam}
GET user/123/456
However this means that you will need to update your server code to look for path parameters instead of query strings.

Related

How can I put header parameter in a Url?

I want to get data from API. So first I want to get Json response from the browser. I Usually do it by specifying a query to pass the API key. But this time the API key is passed using header parameter instead of a query. How can I pass the API into a header parameter?
This is the base Url
"https://api-nba-v1.p.rapidapi.com"
This is the header parameter:
x-rapidapi-key
You can try to issue this request first using some rest client like postman or insomnia.

VSTS release pipeline release gate: how to do HTTP response body string equality check?

I want to check whether my deployed ASP.NET application returns Healthy from health check endpoints or not.
Unfortunately, the success criteria samples of the "Invoke Rest API" release gate only show how to evaluate JSON responses like eq(root['status'], 'successful') or eq(count(jsonpath('Items[?(#.price<50)]')).
As my endpoint doesn't return any JSON I wonder if it's possible to do a simple stupid string equality check somehow?
Of course I could rely on checking the HTTP status code, I feel like it should be possible to access the response body.
This is the exception I get when using eq(root, "Healthy"):
If your endpoint returns just a string try simply this:
eq(root, 'SomeString')
This is really strange that you get such error. It works on my release pipeline:
Here is settings:
And here result:
Agree with Krzysztof Madej
Exception Message: Error parsing API response into a JSON object.
You could check the “URL suffix and parameters” field in “Invoke Rest API task”.
Please make sure that the whole URL is valid.
The whole URL contains the Server URL (Set in service connection) and the URL suffix and parameters (Set in Invoke Rest API task).
Hope this helps.

How to fix Response body error '{"error":"invalid_scope","error_description":"Scope must be specified"}'

Our client has given us their end point and when we are try to hit their API we are getting below Error
'{"error":"invalid_scope","error_description":"Scope must be
specified"}'
It seems that your API is not getting hit properly.Use Postman to call the API and enter the proper parameter.If your API is correct and you are passing the correct parameter it will work.

Jmeter parameter without name in REST method

Hello i have GET method that URL example is:
http://localhost:8050/programs/b3cb6a0f-5d29-4744-a7e8-5fa0099dab18
Where the last String is just programId that I set as parameter in HTTP Request.
JMeter is kinda confused and the respond in raw request is:
GET http://localhost:8050/
GET data:
b3cb6a0f-5d29-4744-a7e8-5fa0099dab18
but there's just 404 in response data.
I can just delete parameter and write /programs/b3cb6a0f-5d29-4744-a7e8-5fa0099dab18 in path instead of /programs/ and everything works perfectly fine. IMO it's awful way. I'd prefer do it with parameter.
Write in path the parameter as /programs/${programId}.
This is part of the path and not parameter, parameters in GET request are different than POST see http methods
path/mypage?param1=value1&param2=value2

BigCommerce API Update Order with PUT

I need to update an order which is done via PUT method passing the order id as part of the https url string and a single parameter, the status_id.
https://mystore.mybigcommerce.com/orders/12345.json
I have tried several methods to pass the status_id value but no matter what I try "status_id=12" or formatted as JSON "{"status_id": 12,}" I always get the same response:
[{"status":415,"message":"The specified input content type is not valid."}]
I have also tried as a POST request passing the JSON or XML code as raw data but that method is not supported.
How am I supposed to pass that field=value pair? can I embed it in the url string?
I also tried it but it wouldn't work for me.
Any ideas?
In case you are wondering I am doing it within FileMaker with TROIUrl plugIn, not a very popular technology, but the GET method retrieving orders works like a charm
TURL_Put( ""; $url ;"status_id=12") (I have also tried other FM plugIns to no avail)
Don't get too caught up in the Filemaker part, I don't expect many people out there to be familiar with BigCommerce and Filemaker. I just need a generic answer.
Thanks
Commandline tool curl is worth a try. It supports put and https.
Mac OS X: curl already installed, call from FileMaker via AppleScript do shell script.
Windows: must be installed, call via Powershell.
It works for me using { "status_id": "3" } which means you probably need to put quotes around the actual number.
Also, it is a PUT operation and application/json which is part of the request content.
The error message received by the OP:
[{"status":415,"message":"The specified input content type is not valid."}]
Is saying that he did not supply the 'Content-Type' header in his request or that the header supplied is for a content type that is not allowed. For the OP's case using JSON he would need to include the header:
Content-Type: application/json
in his HTTPS request. This description can be found along with those of the other status codes you may see here:
https://developer.bigcommerce.com/api/status-codes