Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Twillio - Requested resource Messages.json was not found

can anyone tell me how to resolve this problem. Java code is like below.

@Service
public class TwilioServiceProvider {
    private static final String ACCOUNT_SID = 
    "ACbfadc94adf90fd6606222566aab3ef4";
    private static final String AUTH_TOKEN = "f***********************";

    public void sendMessage(String mobileNo){
        Twilio.init(ACCOUNT_SID,AUTH_TOKEN);

        Message message = Message.creator(new PhoneNumber(mobileNo),new 
         PhoneNumber("+18325323857"),"Account validation 
         successfull").create();
        System.out.println(message.getAccountSid());

    }
}

I get the following error:

com.twilio.exception.ApiException: 
The requested resource /2010-04-01/Accounts/ACbfadc94adf90fd6606222566aab3ef4/Messages.json was not found
like image 817
Sameer Tamboli Avatar asked Mar 07 '23 09:03

Sameer Tamboli


1 Answers

Twilio developer evangelist here.

If that is your real Account Sid in the code sample then that is where your problem lies. I just checked in our system and that Account Sid doesn't exist.

I'd double check your Account Sid in the Twilio console and try again, the code looks good otherwise.

like image 144
philnash Avatar answered Mar 15 '23 20:03

philnash