1

I have to trigger sms via Twilio using soapUI and the rest URL is https://api.twilio.com/2010-04-01/Accounts/ACxxxxxxxxxxxxxxxxxxxx/Messages.json But the response is always comes as below: { "code": 20003, "message": "Authentication Error - No credentials provided", "more_info": "https://www.twilio.com/docs/errors/20003", "status": 401 }

Please help in resolve this issue. I am also not sure what should be the request JSON body as nowhere it is mentioned in Twilio documentation.

8
  • can you include any code or screenshots? Where are you including your credentials or the to and from phone #? Did you check the curl code in the SMS docs? twilio.com/docs/sms/send-messages Commented Oct 7, 2022 at 21:18
  • I am looking for the JSON request, in the twilio.com/docs/sms/send-messages I dont see any JSON request where I can pas from /to phone number /My SID and Auth token Commented Oct 8, 2022 at 14:35
  • This does not look like JSON request --data-urlencode "Body=Hello from Twilio" ^ --data-urlencode "From=YOUR_TWILIO_NUMBER" ^ --data-urlencode "To=+myphonenumer" ^ -u $SID:$Auth Commented Oct 8, 2022 at 14:36
  • is this a JSON request? { "Body":"Hello from Twilio", "From":"+15xxxxx53", "To":"+44xxxxx975" } Commented Oct 8, 2022 at 14:49
  • @lizziepika pls help me on this Commented Oct 8, 2022 at 14:57

2 Answers 2

1

The error message "No credentials provided" usually means that you didn't supply any credentials to your request. From your comments above, it looks like you try to access the environment variables SID and Auth. My guess is that they are missing, can you run the following commands from the same terminal session to check if they are set properly?

MacOS, Linux:

echo $SID
echo $Auth

Windows:

echo %SID%
echo %Auth%

If you don't see the credentials of your account there, please follow this post to see how you can set the environment variables.

Sign up to request clarification or add additional context in comments.

Comments

0

Worked for me: Use the -u flag with your accountSID and authToken.

curl https://api.twilio.com/2010-04-01/Accounts/{accountSID}/Messages/{messageSID}.json  -u {accountSID}:{authToken}

Twilio Endpoint

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.