Skip to content

How to send a WhatsApp text message via API v2

AvenPing API v2 sends WhatsApp session text through your linked line. Get a token, call GET /v2/me for a Meta phoneNumberId, then POST /v2/messages/send/text. Parameter tables live in Messages, not on this page.

Prerequisites

Step-by-step

  1. Create a token
    In the app, open Settings → API Settings and click Generate Token. Send it as Authorization: Bearer or X-API-Token.

  2. List phone IDs
    Call GET /v2/me. Copy a phoneNumberId from phoneNumbers (or defaultPhoneNumberId). See Account.

  3. POST the text
    Call POST /v2/messages/send/text with phoneNumberId, to (or recipient BSUID), and the text body. You can also use smart POST /v2/messages/send. Copy the exact JSON from Messages.

  4. Confirm in the inbox
    Open Messages for that line. A successful send upserts the contact in AvenPing. Blocked contacts return 403 FORBIDDEN without calling Meta.

WARNING

Do not paste full endpoint catalogs here. When fields change, the messages reference is the source of truth.

FAQ

Why do I get 403 on phoneNumberId?

The ID is not on any WABA linked to this token. Use GET /v2/me and pick an ID from accounts / phoneNumbers.

Can I send text when the 24-hour window is closed?

Use a template send instead. See How to send a template via API v2.

Is there a contacts list API?

v2 does not expose a contacts catalog. Sends upsert the destination contact. Manage people in the Contacts UI.