(phoneNumberId: string | undefined)
| 5 | |
| 6 | /** Build the messages endpoint for a given business phone number ID. */ |
| 7 | export function buildMessagesUrl(phoneNumberId: string | undefined): string { |
| 8 | if (!phoneNumberId) { |
| 9 | throw new Error('WhatsApp Phone Number ID is required') |
| 10 | } |
| 11 | return `https://graph.facebook.com/${WHATSAPP_GRAPH_VERSION}/${phoneNumberId.trim()}/messages` |
| 12 | } |
| 13 | |
| 14 | /** Build the shared Bearer auth headers for the WhatsApp Cloud API. */ |
| 15 | export function buildAuthHeaders(accessToken: string | undefined): Record<string, string> { |
no outgoing calls
no test coverage detected