Skip to content

Instantly share code, notes, and snippets.

@rubens-shoji
Created May 10, 2018 13:01
Show Gist options
  • Save rubens-shoji/499e752e2427a23a90e5af3e6bd5dc44 to your computer and use it in GitHub Desktop.
Save rubens-shoji/499e752e2427a23a90e5af3e6bd5dc44 to your computer and use it in GitHub Desktop.
Envio via API JS
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