API documentation

Migrating from WhatsbizAPI

Change the base URL and the token; keep your code.

If you already integrate with WhatsbizAPI's sendtemplatemessage endpoint, wabapi accepts the same request on a compatibility path. The body — token, phone, template_name, template_language, components — is unchanged, so the switch is two configuration values: the base URL and the token, which becomes your wabapi API key.

POST/api/wpbox/sendtemplatemessage

Request body (WhatsbizAPI shape)
{
  "token": "wab_live_0123456789abcdef0123456789abcdef",
  "phone": "917021948630",
  "template_name": "ticket_confirmation",
  "template_language": "en",
  "components": [
    {
      "type": "body",
      "parameters": [
        {
          "type": "text",
          "text": "Prajesh"
        },
        {
          "type": "text",
          "text": "Thane"
        },
        {
          "type": "text",
          "text": "04:00 PM"
        }
      ]
    }
  ]
}

The response and the error codes are the same as the v1 endpoint. Note the path is under /api, not /api/v1.

This path exists so a migration is painless. For new integrations use POST /api/v1/messages/template with the key in the Authorization header: a token in the request body ends up in access logs, proxies and crash reports, and a header does not.

Uploading files (upload.php)

WhatsbizAPI's upload.php takes the file as multipart/form-data with two fields, file and filename, and the key in an x-api-key header. On wabapi the same two form fields go to POST /api/v1/media, and the key goes in the Authorization: Bearer header like every other v1 call. The response returns url the same way — pass it as the header's link — along with the upload's id, its size and the name it was stored under.

POSThttps://wabapi.com/api/v1/media

There is no compatibility path for upload.php: point your upload call at /api/v1/media and move the key into the Authorization header. Two things differ on purpose — every file gets its own random url, so two uploads called invoice.pdf never overwrite each other, and the size limit depends on the file type rather than being one figure for everything.