Skip to content

Instantly share code, notes, and snippets.

@vintesh
Last active April 24, 2020 16:53
Show Gist options
  • Save vintesh/bcf9ee4ad58f5d83ed05 to your computer and use it in GitHub Desktop.
Save vintesh/bcf9ee4ad58f5d83ed05 to your computer and use it in GitHub Desktop.
Twilio - SMS - How To - POST - jQuery - Javascript - Using AJAX/POST
$.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);
}
});
@iamchriswick
Copy link

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