TWILIO Basic Authentication header

Hi, I’m having a problem when trying to send whatsapp notifications using TWILIO. I’m getting the following error:

Workflow rule ‘whatsapp’ field ‘Webhook’ expression ‘Basic QUM5NTM5YzlhOTU3ZTdjYjZjZjdhZjJhMjgxODMzZDI5NDozNjIxNjU3OGVjZGYyMjQwN2I4YWY3MWRhNzcxNGFjNg==’ contains an invalid expression ‘Expression ‘Basic QUM5NTM5YzlhOTU3ZTdjYjZjZjdhZjJhMjgxODMzZDI5NDozNjIxNjU3OGVjZGYyMjQwN2I4YWY3MWRhNzcxNGFjNg==’ could not be parsed due to exception: The given key was not present in the dictionary…’.

I have read the appsheet documentation to set up Basic Authetication headers, but I’m still not getting my headers right. From what I understood, I should write my header as follow:

Authorization: “Basic QUM5NTM5YzlhOTU3ZTdjYjZjZjdhZjJhMjgxODMzZDsSSozNjIxNjUA3GVSSGYyMjQwN2I4YWY3MWRsjfNGFjNg==”

Is that right? Or what am I getting wrong?

Thanks in advance for your help!!

That’s what I have with one of my working basic auth webhooks.
Try to change HTTP Content Type to JSON?

This is not an HTTP request, by any stretch:

Sorry, I’m just completely new at this. So the error is generated from the HTTP request body? So the headers are ok?

And for the body, can you help me? What I did was just copying and pasting the cURL code snippet I got from Postman. What should I do instead?

I have no idea–I have no experience with Twilio. But I know enough about HTTP to know a curl command line isn’t valid. Someone else will have to guide you.

Heh, totally missed that Body when I looked at it.

Try the HTTP code instead
image

There should be a section at the bottom that includes all of your values (looks like To,From, and Body) wrapped inside of curly braces. Something like:

{
“To” : “xxxx”,
“From” : “xxxx”,
“Body” : “xxxx”
}

Paste that into the Body field and see if it works.

2 Likes

Thanks for your help Mark! I did what you said and I’m not getting any error on my log anymore. Check it out.

Now the problem is that I’m not getting any message notification, even though there’s no error showing up in the log.
What could be wrong?

I suspect you need to format the Body as I showed in my previous post, as well as change the HTTP Content Type to JSON.

2 Likes

Thanks again Marc. I just did what you said and I’m still not getting any whatsapp message, even though there’s no error in my log.

Any other idea?

I also tried it with lower cases with no positive result.

{,
“to”: “whatsapp:+5XXX59721XX2”,
“from”: “whatsapp:+1415XXXX886”,
“body”: “xxxxxxxxxx!!!”,
}

Not without digging into the Twilio API docs and doing my own testing.