Created
May 10, 2018 13:01
-
-
Save rubens-shoji/499e752e2427a23a90e5af3e6bd5dc44 to your computer and use it in GitHub Desktop.
Envio via API JS
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
var token = 'xxxx'; | |
var headers = { | |
Authorization: token, | |
Accept: 'application/json', | |
'Content-Type': 'application/json', | |
}; | |
var jsonEnvio = { | |
"smss":[ | |
{ | |
"numero": "4299999999", | |
"mensagem": "mensagem" | |
}, | |
{ | |
"numero": "1199999999", | |
"mensagem": "mensagem" | |
} | |
], | |
"envioImediato": true, | |
"centroCusto": "5772cd66e787dcaf1asd361d" | |
} | |
unirest | |
.post('https://v2.bestuse.com.br/api/v1/envioApi') | |
.headers(headers) | |
.send(jsonEnvio) | |
.end((response) => { | |
console.log(response.body); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment