1
votes

I need to have the exact request URL that Twilio makes when sending an SMS. Is there a way to print/log it? When I use the Message.getUri method, it gives me something that ends with .json which I think is the response from Twilio after making the request. From what I've read, it should look something like "https://api.twilio.com/2010-04-01/Accounts/<Account_SID>/Messages".

I'm using the Java API:

com.twilio.rest.api.v2010.account.Message
    .creator(new PhoneNumber(toNumber), // to
        new PhoneNumber(twilioFromNumber), // from
        textMessage)
    .create();
1

1 Answers

0
votes

The URL is indeed

https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages.json

where ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX is the account SID which you can find on your dashboard if you login in your Twilio account console at https://www.twilio.com/console

See more docs at (https://www.twilio.com/docs/sms/send-messages?code-sample=code-send-an-sms-message&code-language=curl&code-sdk-version=json#linkcode)