0
votes

I am calling the Twilio Verify Rest API using JSON in the body, but it is returning an error " Your AccountSid or AuthToken was incorrect."

Here is my setup:

I used a Base64 encoder> entered my AccountSID:Auth token> and entered it into the "Value" as seen in the screenshot below.

I am not sure exactly what I am doing wrong. Any help?

enter image description here

1

1 Answers

0
votes

Make sure to send the body of your request as application/x-www-form-urlencoded, not JSON.

Example:

curl -X POST https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Verifications \
--data-urlencode "To=+15017122661" \
--data-urlencode "Channel=sms" \
-u ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token