Travel News Group
var xhr = new XMLHttpRequest(), body = JSON.stringify( { “messages”: [ { “channel”: “whatsapp”, “to”: “1234567890”, “content”: “Test WhatsApp Message Text” }, { “channel”: “sms”, “to”: “1234567890”, “content”: “Test SMS Message Text” } ] } ); xhr.open(‘POST’, ‘https://platform.clickatell.com/v1/message’, true); xhr.setRequestHeader(‘Content-Type’, ‘application/json’); xhr.setRequestHeader(‘Authorization’, ‘SsQAM4zgTkqLU5Swf1Twgg==’); xhr.onreadystatechange = function(){ if (xhr.readyState == 4 && xhr.status == 200) { console.log(‘success’); } }; xhr.send(body);