var request = require('request');
var headerdata = {
"content-type":"application/json",
'client_id':'a5deff7c680c4b96b2eee4a6e2e58df0',
'client_secret':'746D3a6A1e994B9490834a91119cbC4D'}
;
var bodydata ={
"id": "28e882b4-21ee-4765-ab34-e762ac029bd5",
"targetSystemId": "ZXCV-QWER-DSAA",
"originatorSystemId": "SAJS-QERT-UIOP",
"status": "SUBMITED",
"from": "Sunrise",
"receipt": false,
"validFor": {
"time": 10086,
"unit": "DAY"
},
"configurationId": "443",
"recipientText": [
{
"to": [
"0767770001",
"0767770002",
"0767770003"
],
"text": "Welcome to Sunrise! Amazing things will happen."
}
],
"messageOptions": {
"sendAt": "2015-12-17T00:00:00Z",
"sendBetween": {
"start": "2015-12-15T00:00:00Z",
"end": "2015-12-17T00:00:00Z"
}
}
};
var urldata = 'https://sunrise-campaign-eapi-v1-t04-z8mtul.djk77v.deu-c1.eu1.cloudhub.io/api/sms';
request.post({
headers: headerdata,
url: urldata,
body: bodydata
}, function(error, response, body){
console.log(body);
});