Help me with http().post method

Skip to first unread message

Abu Muhammad

Apr 24, 2019, 12:14:47 AM4/24/19
to mementodatabase
I want to use whatsapp API from third parties, and from the documentation page I find a way to use it with the following script:

const http = require('superagent')

// Enter API key
const token = 'token'

// Enter target phone number to send message
const phone = '+111111'

// Device to be used for message delivery
const device = '5ca6d9fdc46219001bxxxxxx' // device id

// Enter text message to send
const message =
Hello there!
This is a test message :)

// Send message via API
.set('Token', token)
phone: phone,
message: message,
device: device
.then(res => {
console.log('Message sent successfully. See:',${})
.catch(err => {
console.error('Cannot send message:', err.message, (status: ${err.status || err.code})

can anyone help me to make this script run on memento??

Reply all
Reply to author
0 new messages