Library of integration with whatsapp cloud api
npm install wppmeta![Ported in Brazil]()
!NPM
!npm
!npm
library not official javascript to WhatsApp Cloud API. Repository of wppmeta.
``bash`
$ npm install wppmeta
Before getting started with the library, you need to go through the steps and gather some information to get the library working properly.
Follow the steps of Facebook Cloud Api for you to get started.
1. After the steps, collect your TOKEN and TEST WHATSAPP NUMBER
2. Lastly verify the number you will be using for testing on the To field
Once you're follow the above procedures, now you're ready to start hacking with the Wrapper.
Here how you authenticate your application, you need to specofy two things the `TOKEN` and `phone_number_id` of your test number
`javascript
import { WppMeta } from 'wppmeta'
const whatsaApp = WppMeta.config({
accountId: "YOUR_ACCOUNT_ID",
phoneId: "YOUR_PHONE_ID",
token: 'YOUR_TOKEN_AUTHORIZATION_BEARER',
});
`
`javascript`
const phones = await whatsaApp.getPhones()
`javascript`
const success = await whatsaApp.registerPhone({
phoneId: 'PHONE_ID',
pin: '6-digit'
})
`javascript`
const response = await whatsaApp.sendText({
to: 'PHONE',
body: {
message: 'MESSAGE',
useUrl: false
}
})
`javascript`
const response = await whatsaApp.sendMidia({
to: 'PHONE',
mediaObjectId: 'MEDIA_ID'
})
`javascript`
const response = await whatsaApp.sendLocation({
to: 'PHONE',
location: {
address: 'ADDRESS',
latitude: 'LATITUDE',
longitude: 'LONGITUDE',
name: 'NAME_LOCATION'
}
})
NOTE:
For more info check Notification Payload refernce and Notification Payload Examples
If you will face any issue with the usage of this package please raise one so as we can quickly fix it as soon as possible;
This is an opensource project under `MIT License` so any one is welcome to contribute from typo, to source code to documentation, `JUST FORK IT``.
1. Giovani