"A From phone number is required” in JSON call to Twilio - sms

we are trying to implement the SMS function from Twilio to our 4D application. The phone number, SID, AuthKey and all required information I use in the tool of SOAPUI show me everything is working fine and I have received an SMS from Twilio. However, when I try to implement using the 4D platform, I have tried to use JSON to pass the From, To and Body as a request and the response come back say "A from phone number is required" Please see screenshot attached and I wanna know what I did wrong.
Succeed from SoapUI
Implement from 4D

Twilio developer evangelist here.
I don't personally know either SoapUI or 4D. But here's what I can see from your screenshots.
In SoapUI, you have the request Content-Type header set as application/x-www-form-urlencoded and it looks as though you are sending the body as form encoded parameters and that is why you get the correct response.
In 4D I can see you set the same header as application/x-www-form-urlencoded, but you then send the data as JSON. Twilio only accepts data in POST requests as form encoded key value pairs. As I don't know 4D, I can't tell you exactly how to fix it, but you do need to stop JSON encoding the data and send as form data instead.
Let me know if this helps.

Related

Dynamics 365 Webhook Json Remote execution context sent with German characters as rubbish

Using Plugin Registration, I registered webhook, Power automate and sample webhook as well.
Json (Remote execution context) sent to webhook seems to be fine but when German characters appears in field values, it sends as rubbish.
I tried adding httpheader to webhook as Content-type: application/json; charset=utf-8 or Accept-Charset: utf-8
but this did not helped.
Did anyone previously faced similar issue?
I suspect there is bug from Dynamics-crm side especially plugin registration tool, but I might be wrong.
You can use IServiceEndpointNotificationService to encode the content before sending or alternatively what you can do is creating an Azure Function that you will invoke on your Webhook and inside the function you should encode the content to UTF-8 and make a second call to you final endpoint, you can do there also further transformation of data if needed.

TrustPilot Create Invitation API always returns 415 response code

I'm trying to send a TrustPilot invitation using the Create Invitations API but no matter what I try, I get a response code of 415 and with no data returned, so it's virtually impossible for me to debug.
The URL I'm using is correct: https://invitations-api.trustpilot.com/v1/private/business-units/{businessUnitId}/email-invitations (where {businessUnitId} is my business ID)
I am sending a valid (and current) oAuth token in my header.
I am sending a POST request.
I have tested my details with other "Business user OAuth Token" APIs and everything works, so my details are definitely correct. It's just this create invitation API that's not working.
I've tried everything. I've submitted minimal details, a full request, somewhere in between, the example request in the API, and so on. Always a response code of 415.
I've set my "Invitation Settings" in the TrustPilot Business portal, and have even tried submitting those details with the request (ie. sender e-mail "noreply.invitations#trustpilotmail.com" and a valid reply-to e-mail that's been configured).
I've tried contacting the "Integration Engineers" at TrustPilot who after a few back and forth e-mails, also have no idea, which is VERY unsettling. So time for Stack Overflow.
I need to get this figured out, so any help would be great! Perhaps someone can provide a sample request that works in their application that I can try to duplicate in mine?
Http status code 415 (Unsupported Media Type) is returned when Content-Type: application/json is not passed. You need to make sure that this header is added and that the content you are passing in the post body is valid json.
If you are already doing this then I would need an example of a request you are sending to help you further.

How to pass from and body as parameters in Twilio SMS webhook URL

I have a Twilio SMS number configured to send a request to a WebServer via a Webhook URL. What I am trying to understand is can I pass the 'from' phone number and 'SMS body' as parameters in the Webhook URL?
For example:
https://myserver/v1/sms?phoneNo='FROM'&message='MSG'
I understand I can extract this information from the Body on the server but this would require additional coding, testing, deployment etc... on the web server.
Thanks.
Keep the URL as https://myserver/v1/sms (Twilio will add the parameters for you when it makes the request)
To the right of the webhook url field, change in the drop-down from HTTP POST to HTTP GET
Save
With this configuration, Twilio will send the parameters with its request as URL query parameters.
The names for the two parameters mentioned in your question are
From (The phone number that sent the message) and
Body (The text body of the message.).
Other parameters are: MessageSid, SmsSid, AccountSid, MessagingServiceSid, To, NumMedia
You can read more here: https://www.twilio.com/docs/sms/twiml#twilios-request-to-your-application
If you'd like to have your own names for the GET parameters
then, probably the easiest would be to use Twilio Studio with a HTTP REQUEST widget and configure the phone number with Studio Flow instead of Webhook.
The HTTP REQUEST will let you make a GET request and add your own parameters to it.
For the values you would use {{trigger.message.From}} for your phoneNo and {{trigger.message.Body}} for your message.
You can read more about Twilio Studio's widgets here: https://www.twilio.com/docs/studio/widget-library#http-request

Shopify webhook verification in parse

I am trying to get a shopify webhook to fill my customer class in parse.com, however something must go wrong. I don't know how to verify the parse response since Shopify sends this webhook out from it's ruby backend. I used requestbin to catch the webhook and I replicated a post request using postman to my parse url and everything works fine. Does anyone know how to debug requests like these? Is there a console in Parse where I can see all the incoming requests and the responses Parse.com sent back?
Try using Runscope for debugging webhooks. Full guide here: https://www.runscope.com/provider-guide/troubleshooting-webhooks - this is more than just a request bin. It's a full transparent proxy that will, like a bin, record the webhook notification, but will also pass it along to the intended destination (your webhook receiver) and record that response as well.

What can I use as a blank Request URL for Sms?

In order for a number to receive Sms messages, it appears I must enter a value for the Request URL associated with the number. However I do not need to notified of messages in a callback. I'm wondering what value I can put in here that will basically do nothing but still allow me to retrieving messages via the polling mechanism?
Thanks,
Dan
Twilio developer evangelist here.
You can use a URL that responds with an empty <Response> TwiML element. If you don't have a server to host that on, you could use http://twimlets.com. This link ought to do the trick:
http://twimlets.com/echo?Twiml=%3CResponse%3E%3C%2FResponse%3E&

Resources