whatsappbusiness
WhatsApp Business is a messaging platform.
Usage
import { whatsappbusiness } from 'netzo/apis/whatsappbusiness.ts'
const api = whatsappbusiness({
businessAccountId: Deno.env.get('WHATSAPPBUSINESS_BUSINESS_ACCOUNT_ID'),
permanentToken: Deno.env.get('WHATSAPPBUSINESS_PERMANENT_TOKEN'),
})
Configuration
The whatsappbusiness
factory function expects an object with the following, and returns an object with an API client api
.
Param | Type | Default | Description |
---|---|---|---|
businessAccountId | string | Deno.env.get('WHATSAPPBUSINESS_BUSINESS_ACCOUNT_ID') | the account id |
permanentToken | array | Deno.env.get('WHATSAPPBUSINESS_PERMANENT_TOKEN') | the token to use for authentication |
Refer to the API documentation to get the required information.
Examples
The following examples assume you have created an api client instance.
Get business profile
Get information about your business profile.
const query: QueryProfile = {}
const result = await api[PHONE_NUMBER_ID].whatsapp_business_profile.get<Profile>(query)
const resultData = result.data
Update business profile
Update your business profile.
const data: DataUpdateProfile = {
messaging_product: 'whatsapp',
about: 'About my business'
}
const resultData = await api[PHONE_NUMBER_ID].whatsapp_business_profile.post<UpdateProfileResult>(data)