Last active
April 24, 2020 16:53
-
-
Save vintesh/bcf9ee4ad58f5d83ed05 to your computer and use it in GitHub Desktop.
Twilio - SMS - How To - POST - jQuery - Javascript - Using AJAX/POST
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajax({ | |
type: "POST", | |
username: "ACCOUNT_SID", | |
password: "AUTH_TOKEN", | |
url: "https://api.twilio.com/2010-04-01/Accounts/[ACCOUNT_SID]/Messages.json", | |
data: { | |
"To" : "+911234567890", | |
"From" : "+11234567890", | |
"Body" : "From jQuery AJAX" | |
}, | |
success: function(data) { | |
console.log(data); | |
}, | |
error: function(data) { | |
console.log(data); | |
} | |
}); |
can't get this to work either... I get Uncaught SyntaxError: Unexpected token :
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi .. thanks for the code. But I might need little more help here which is when I'm trying the same code replacing my credentials it is giving me the following error
Am I missing something. Please help