Netzo Logo

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.

ParamTypeDefaultDescription
businessAccountIdstringDeno.env.get('WHATSAPPBUSINESS_BUSINESS_ACCOUNT_ID')the account id
permanentTokenarrayDeno.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)

References