1
votes

I have a paid twilio account with verified number and am trying to use the bash script supplied by twilio entitled "twilio-call" on Ubuntu 16.04.3 LTS. The response is: Failed to call 941-8XX-XXXX: curl (22): The requested URL returned: 404 NOT FOUND.

I know that I have the credentials set correctly as the bash script entitled "twilio-sms" works flawlessly.

The bash script "twilio-call" has been downloaded directly from twilio.com/labs/bash and the permissions have been set correctly.

The actual curl command is: RESPONSE=curl -fSs -u "$ACCOUNTSID:$AUTHTOKEN" -d "Caller=$CALLERID" -d "Called=$PHONE" -d "Url=http://twimlets.com/message?Message=$MSG" "https://api.twilio.com/2008-08-01/Accounts/$ACCOUNTSID/Calls" 2>&1

The variables $ACCOUNTSID, $AUTHTOKEN, $CALLERID, $PHONE, and $MSG have all been verified to be populated correctly.

What could be causing this 404 response? Am I correct in my understanding that a verified number from twilio which works correctly for sms should also work for call?

1
Print out the entire command line with all the environment variable values substituted and very likely you will realise what the problem is...marekful
@marekful Thank you for the suggestion. While I have already verified that the variables were populated correctly, I followed your advice and I substituted the variables for constants and I get the same results. No joy. But thanks for the suggestion.Mark Cain

1 Answers

1
votes

It must be some old example at Twilio. Where did you find it?

The API endpoint URL it's not

https://api.twilio.com/2008-08-01/Accounts/$ACCOUNTSID/Calls

it is

https://api.twilio.com/2010-04-01/Accounts/$ACCOUNTSID/Calls