Last active
May 25, 2022 21:43
-
-
Save jeancarlosgarcia/6daf74ba90017f680441e803bf494683 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const axios = require('axios'); | |
const data ={ | |
messaging_product: 'whatsapp', | |
to: 'number', | |
type: "template", | |
template: { | |
name: "hello_world", | |
language: { | |
code: "en_US" | |
} | |
} | |
}; | |
const headers = { | |
'Content-Type': 'application/json', | |
'Authorization' : 'Bearer tocken' | |
}; | |
axios.post('https://graph.facebook.com/v13.0/{id}/messages', JSON.stringify(data), {headers}) | |
.then((res) => { | |
console.log(`Status: ${res.status}`); | |
console.log('Student Info: ', res.data); | |
}).catch((err) => { | |
console.error(err); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment