I'm trying to pass a turbo (www.turbo360.co) vector through an ajax call but I can't get it to work correctly. Here is my code:
var message = 'New order created: Name: ' + orderInfo.name + '
Room: ' + orderInfo.room + ' Payment: ' + orderInfo.payment + ' Dorm: ' + orderInfo.dorm + ' Sugar: ' + orderInfo.sugar + ' Splenda: ' + orderInfo.splenda + ' Milk: ' + orderInfo.milk + ' Iced: ' + orderInfo.iced
message += ' Creme: ' + orderInfo.creme
var sent = false
$.ajax({
url:'https://production.turbo360-vector.com/expresso-eeonzr/sms?message=' + message + '&to=3476749151&key=b64dd743-3760-4425-bafd-37d99cce97b4',
type: 'GET',
success: function(msg){
console.log("This worked");
}
})
Anyone know why my console.log
doesn't go through?
Try adding these parameters to the ajax call:
dataType: "json",
error: (err) => {
console.log(err);
}
If that does not work, try checking the Method type of your vector in your project dashboard and make sure it makes whatever you specify in 'type' in your ajax call (i.e. 'GET', 'POST', etc).