Skip to content

Instantly share code, notes, and snippets.

@diogenesjup
Created May 22, 2024 13:19
Show Gist options
  • Save diogenesjup/aec5e8b395860e1950f939d1650a0cae to your computer and use it in GitHub Desktop.
Save diogenesjup/aec5e8b395860e1950f939d1650a0cae to your computer and use it in GitHub Desktop.
WATIS API NODE
var request = require('request');
var options = {
'method': 'POST',
'url': 'SEU ENDPOINT',
'headers': {
'Content-Type': 'application/x-www-form-urlencoded'
},
form: {
'origem': 'postman',
'destino': '5511999999999',
'msg': 'Enviando uma mensagem de teste',
'controle': 'SEU TOKEN',
'imagem': ''
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment