-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
29 lines (26 loc) · 993 Bytes
/
index.js
File metadata and controls
29 lines (26 loc) · 993 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 axios = require('axios');
// URL of the Flash Call service
const url = 'https://flash-call.liara.run/services/call/call/';
// Request payload
const payload = {
destination: '09303016386', // Replace with the target phone number
token: 'Ih.nMOjBv3WyvtRdnHnFzGmt.foqm0O7gFBAm', // Replace with your access token
};
// Send a POST request
axios
.post(url, payload)
.then((response) => {
console.log('Call initiated successfully!');
console.log('Server response:', response.data); // Display the server response
})
.catch((error) => {
if (error.response) {
// The request was made, but the server responded with an error
console.log('Failed to initiate the call!');
console.log('Status code:', error.response.status);
console.log('Server response:', error.response.data); // Display the error message
} else {
// Something went wrong while making the request
console.log('Error sending request:', error.message);
}
});