-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnode.js
32 lines (29 loc) · 936 Bytes
/
node.js
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
30
31
32
// Import axios
const axios = require('axios');
// Prepare the data payload
let data = JSON.stringify({
recipient: "9647xxxxxxxxx", // Replace with the actual recipient number
sender_id: "SenderID", // Replace with your sender ID
type: "whatsapp", // Specify the type (e.g., "whatsapp")
message: "318419", // Replace with your message content
lang: "en" // Specify the language code
});
// Configure the request
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://gateway.standingtech.com/api/v4/sms/send',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer API_KEY' // Replace with your actual API key
},
data: data
};
// Make the request
axios.request(config)
.then((response) => {
console.log("Response:", JSON.stringify(response.data));
})
.catch((error) => {
console.error("Error:", error.message);
});