Twilio Route Error

I’m trying to Route to Twilio but keep getting the error:

error building route request: error validating twilio message: %!w()

The first part of the message makes me believe that the problem is in the build but the second part makes me believe that there is a problem with the SID or Token.

I believe I have the initial Route Information filled out correctly. I have static From and To numbers.

My JSONata is:

{
“body”: {
“customMessage”: body.vehicle_name & " is " & body.motion & ": " & “Latitude and Longitude Finder on Map Get Coordinates” & $string(best_lat) & “&long=” & $string(best_lon)
}
}
Edit: I commented out the url in the message and got the same result.

I’ve tried keys “text” and “twilioBody” that I found in the forum. I must be doing something wrong. Any Ideas?

Thanks,
Joe

Hi @scavoj,

Is the route working with a static customMessage string? I would also try using the JSONata Exerciser to test out your expression using the JSON from a valid event.

Rob

Rob,

Yes I used webhook.site to check the JSONata and it is correct. Same result.

But I’m waiting on regulatory compliance for the twilio phone number. I think I filled out the information correctly. I’m going to wait for the approved status to send messages and try it again. The process of getting a number and filling out the info is a bit confusing.

Thanks,
Joe

Can anyone tell me what this error message means? Is it on the Blues side or the Twilio side?

Hello @scavoj,

Sorry for the delay in the response. I reached out to the cloud team, and they confirmed the error is coming from Notehub.

It’s a bad error message, it’s supposed to mean that there’s a problem with the message body. Perhaps it was left blank?

They are aware of the message and UI shortcoming, and have filed a ticket to improve it.

Best,

Zak

Thanks, Zak.

So if it thinks that the body is blank, it could be that I am using the wrong key inside the body for the custom message. I’ve tried several that I found in forum messages here. All of which gave me the same error. Do you know what the correct key is?

Thanks,

Joe

Hi @scavoj,

The use of placeholder variables in routes like this is documented here: Twilio SMS Guide - IoT Connectivity at Blues