WANotif - API Doc Node.JS
Required variables
const fetch = require('node-fetch');
async function sendTextMessage() {
const url = 'https://uhuy.net/api/user/v2/send_message'; // Replace with your domain endpoint
const body = {
client_id: 'CLIENT_ID', // Client ID here
mobile: '919999999999',
text: 'Hello world',
};
const token = 'YOUR_API_KEYS'; // Your API keys here
const headers = {
'Content-Type': 'application/json',
Authorization: `Bearer ${token}`,
};
try {
const response = await fetch(url, {
method: 'POST',
headers,
body: JSON.stringify(body),
});
if (!response.ok) {
throw new Error('Request failed');
}
const data = await response.json();
console.log(data); // Handle the response data as per your requirements
} catch (error) {
console.error(error);
}
}
sendTextMessage();
Required variables
const fetch = require('node-fetch');
async function sendTextMessage() {
const url = 'https://uhuy.net/api/user/v2/send_templet'; // Replace with your domain endpoint
const body = {
client_id: 'CLIENT_ID', // Client ID here
mobile: '919999999999',
templet_id: 1, // Your templet ID
};
const token = 'YOUR_API_KEYS'; // Your API keys here
const headers = {
'Content-Type': 'application/json',
Authorization: `Bearer ${token}`,
};
try {
const response = await fetch(url, {
method: 'POST',
headers,
body: JSON.stringify(body),
});
if (!response.ok) {
throw new Error('Request failed');
}
const data = await response.json();
console.log(data); // Handle the response data as per your requirements
} catch (error) {
console.error(error);
}
}
sendTextMessage();
{
"success": true,
"message": "The message has been successfully sent.",
"data": {}
}