Post request for SMS message?

HelloWorld

I am trying to figure out how the twillio sample curl -request actually works for SMS message. Here is a link to the "test" messages that you can use to make a request: https://www.twilio.com/user/account/developer-tools/api-explorer/message-create

Here is the curl post:

curl -X POST 'https://api.twilio.com/2010-04-01/Accounts/accountsid/Messages.json' \
--data-urlencode 'To=phoneNumber'  \
--data-urlencode 'From=+phoneNumber'  \
--data-urlencode 'Body=Testing'  \
-u accountsid:[AuthToken]

*Note: phoneNumber in the the To and From fields are actual numbers, same with the accountsid.

I am trying to find out what this url actually looks like?

What is the full URL? When I run this in the command line, it shows me a JSON type object which is what I would expect, I just am trying to get a visual of how this json object is attached to https://api.twilio.com/2010-04-01/Accounts/accountsid/Messages.json

I would imagine it would look something like:

https://api.twilio.com/2010-04-01/Accounts/accountsid/Messages.json&"To=phoneNumber"&"From=+phoneNumber"&"Body=Testing"&"accounsid:authtoken

I don't think this url is 100% correct. When I run this and put this url in my browser I keep getting asked my credentials for Twilio, I put in the correct username and password and it rejects it.

Devin Rader

Twilio evangelist here.

Can you clarify what you mean when you say "what this url actually looks like".

The curl sample you provide makes an Basic authenticated HTTP POST to the Messages resource. You use this kind of request to send an SMS message. The response to that request, Twilio returns to you a Message object encoded as JSON.

If you just paste that same URL into a browser and press enter there will be two differences between that and the CURL request:

  1. The browser will make an HTTP GET, not and HTTP POST to the Messages resource.
  2. The browser will not include the basic authentication credentials, which is why you are getting prompted to enter them

Hope that helps.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Twilio - Send HTTP Request to Endpoint When SMS Message is Received

From Dev

Twilio - Send HTTP Request to Endpoint When SMS Message is Received

From Dev

making HTTP post request with confirmation message for delete

From Dev

Display SMS message in TextView

From Dev

Access SMS Sent Message

From Dev

Unity send SMS message

From Dev

How can you send an SMS message using pure HTTP post with no other libraries

From Dev

How can you send an SMS message using pure HTTP post with no other libraries

From Dev

JSON ajax post data - get 400 bad request message

From Dev

Getting POST Request Message using React.JS

From Dev

Express + Plivo: Ajax POST request fails times but I still get the same sms on my phone twice

From Dev

sms delivery message with phone number

From Dev

What is the maximum SMS message length?

From Dev

Sending an SMS Message with Rails and Twilio

From Dev

How to launch SMS Message app

From Dev

Accessing SMS Message Type Constants

From Dev

Post Request message Not being displayed in the App when sending post req from ui front end

From Dev

Twilio post sms using HttpClient

From Dev

Send SMS message using non default SMS app on Android 4.4

From Dev

xamarin forms - how to open sms application with prefilled sms message

From Dev

Node post message with large body (1.3 mb) error : 413 Request Entity Too Large

From Dev

LibGDX HTTP Post request recieving 400 message on Node.js server

From Dev

What is the `Authorization` part of the http post request of Google's Firebase Downstream message?

From Dev

HTTP POST request message is not received every time in Mulle when using CORS

From Dev

React - fetch 'message' from Meta-Data element of the response from an Ajax post request

From Dev

Launch default SMS app without a message

From Dev

How to store SMS message to SQLite Database?

From Dev

twilio send sms message Invalid phone number

From Dev

Sending SMS programmatically without opening message app

Related Related

  1. 1

    Twilio - Send HTTP Request to Endpoint When SMS Message is Received

  2. 2

    Twilio - Send HTTP Request to Endpoint When SMS Message is Received

  3. 3

    making HTTP post request with confirmation message for delete

  4. 4

    Display SMS message in TextView

  5. 5

    Access SMS Sent Message

  6. 6

    Unity send SMS message

  7. 7

    How can you send an SMS message using pure HTTP post with no other libraries

  8. 8

    How can you send an SMS message using pure HTTP post with no other libraries

  9. 9

    JSON ajax post data - get 400 bad request message

  10. 10

    Getting POST Request Message using React.JS

  11. 11

    Express + Plivo: Ajax POST request fails times but I still get the same sms on my phone twice

  12. 12

    sms delivery message with phone number

  13. 13

    What is the maximum SMS message length?

  14. 14

    Sending an SMS Message with Rails and Twilio

  15. 15

    How to launch SMS Message app

  16. 16

    Accessing SMS Message Type Constants

  17. 17

    Post Request message Not being displayed in the App when sending post req from ui front end

  18. 18

    Twilio post sms using HttpClient

  19. 19

    Send SMS message using non default SMS app on Android 4.4

  20. 20

    xamarin forms - how to open sms application with prefilled sms message

  21. 21

    Node post message with large body (1.3 mb) error : 413 Request Entity Too Large

  22. 22

    LibGDX HTTP Post request recieving 400 message on Node.js server

  23. 23

    What is the `Authorization` part of the http post request of Google's Firebase Downstream message?

  24. 24

    HTTP POST request message is not received every time in Mulle when using CORS

  25. 25

    React - fetch 'message' from Meta-Data element of the response from an Ajax post request

  26. 26

    Launch default SMS app without a message

  27. 27

    How to store SMS message to SQLite Database?

  28. 28

    twilio send sms message Invalid phone number

  29. 29

    Sending SMS programmatically without opening message app

HotTag

Archive