-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapi.js
More file actions
29 lines (25 loc) · 757 Bytes
/
api.js
File metadata and controls
29 lines (25 loc) · 757 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const querystring = require('querystring')
const request = require('request')
module.exports = function(phone, content){
let data = {
msisdn: phone,
content: content
}
let form_data = querystring.stringify(data)
request({
headers: {
"x-api-key": "Tn1ouwAmLSQzilNUfMT447WTLCrgttIF",
"accept": "application/x-www-form-urlencoded",
"Content-Type": "application/x-www-form-urlencoded"
},
uri: "https://api.thebigbox.id/sms-notification/1.0.0/messages",
body: form_data,
method: "POST"
}, function(err, res, body){
if(err) {
console.log('error')
return;
}
console.log(body)
})
}