Use Wazaj for free — limited-time launch offer

Get started

Shared inbox, templates, teams, and campaigns in one workspace. Start without a credit card.

Referans API

Gid entegrasyon API Business

Swiv etap sa yo sèlman server-a-server. Pa janm ekspoze kle API oswa URL baz deplwaman ou nan kòd kliyan.

Sekirite an premye

Kenbe kle API yo sèlman sou backend ou. Pa janm voye kle yo oswa URL baz deplwaman ou nan navigatè oswa aplikasyon mobil.

Lòd entegrasyon

  1. Kreye yon kle API nan konsòl devlopè workspace la (anba kontwòl pwopriyetè a). Sekrè an kle nèt la parèt yon sèl fwa — mete l nan jesyonè sekrè ou oswa anviwònman sèvè a.
  2. Konfigire URL baz la sou sèvè ou: itilize host HTTPS ou plis /api/wazaj/business. Egzanp host pwodiksyon: https://transuptech.online. Pi bon li valè a depi anviwònman olye pou w mete l dirèkteman nan pakè kliyan.
  3. Otantifye chak demann ak kle API a (gade anba). Wout sa yo pa itilize bonbon sesyon navigatè a.
  4. Voye mesaj ak POST…/messages/text oswa …/messages/template, toujou ak Content-Type: application/json.
  5. Jere erè ak nouvo esè: trete 401, 403, 422, ak 503 klèman; itilize bakò eksponansyèl pou pan transitoè.
  6. Jere kle yo ak pridans: fè yo wotasyon sou yon orè epi revoke imedyatman si genyen yon fuit.

URL baz

Prefiks API konplè pou mesaj biznis (egzanp deplwaman): https://transuptech.online/api/wazaj/business

Egzanp konkrè (kopi depi blòk ki anba a):

URL
https://transuptech.online/api/wazaj/business

Ranplase ak pwòp orijin ou nan kòd; ekstrè ki anba yo itilize $BASE_URL ki elaji nan egzanp sa a lè w kopye.

Otantifikasyon

Pwen final biznis yo aksepte kle API ou nan nenpòt nan fòm sa yo:

  • X-API-Key: wzj_…
  • Authorization: Bearer wzj_…
  • Authorization: ApiKey wzj_…

Kle ki manke, ki pa valab, ki ekspire, oswa ki revoke bay 401.

HTTP
Content-Type: application/json
X-API-Key: wzj_xxx

1. Voye mesaj tèks

POST/messages/text

Chemen konplè: https://transuptech.online/api/wazaj/business/messages/text

Kò kòmand la

ChanTipObligatwaDeskripsyon
tostringWiDestinasyon fòma E.164 (egz. +50912345678)
bodystringWiTèks mesaj la
preview_urlbooleanNonKonpòtman apèsi URL
reply_to_meta_message_idstring | nullNonId mesaj Meta pou reponn

Egzanp JSON

JSON
{
  "to": "+50912345678",
  "body": "Hello from Wazaj API",
  "preview_url": false,
  "reply_to_meta_message_id": null
}

Siksè (200)

JSON
{
  "success": true,
  "message_id": 12345
}

cURL

Shell
curl -X POST "https://transuptech.online/api/wazaj/business/messages/text" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $WAZAJ_API_KEY" \
  -d '{
    "to": "+50912345678",
    "body": "Hello from Wazaj API",
    "preview_url": false
  }'

2. Voye mesaj modèl

POST/messages/template

Menm antèt ak tèks la: Content-Type: application/json ak kle API ou.

Kò kòmand la

ChanTipObligatwaDeskripsyon
tostringWiDestinasyon fòma E.164
template_namestringWiNon modèl Meta aprouve
template_languagestringWiKòd lang modèl la (egz. en)
template_componentsarrayNonKonpozan / paramèt modèl Meta

Egzanp JSON

JSON
{
  "to": "+50912345678",
  "template_name": "order_update",
  "template_language": "en",
  "template_components": [
    {
      "type": "body",
      "parameters": [{ "type": "text", "text": "John" }]
    }
  ]
}

Siksè (200)

JSON
{
  "success": true,
  "message_id": 12346
}

cURL

Shell
curl -X POST "https://transuptech.online/api/wazaj/business/messages/template" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $WAZAJ_API_KEY" \
  -d '{
    "to": "+50912345678",
    "template_name": "order_update",
    "template_language": "en",
    "template_components": [
      {
        "type": "body",
        "parameters": [{ "type": "text", "text": "John" }]
      }
    ]
  }'

Repons erè

401 Pa otorize— kle API manke oswa pa valab.

JSON
{
  "success": false,
  "message": "Unauthorized"
}

403 Entèdi— kont dekonnekte oswa bloke pou voye.

JSON
{
  "success": false,
  "message": "Wazaj account disconnected"
}

422 Entite pa trete — validasyon oswa règ biznis (egzanp: billing_send_denied, templates_not_entitled).

JSON
{
  "success": false,
  "message": "Validation failed",
  "errors": {
    "to": ["The to field is required."]
  }
}

503 Sèvis pa disponib— modil mesaj oswa downstream pa pare. Eseye ankò ak bakò.

Lis verifikasyon

  1. Kreye yon kle API nan konsòl devlopè a.
  2. Sere sekrè a nan yon kof oswa varyab anviwònman sèvè sèlman.
  3. Rele pwen final biznis yo sèlman nan kòd server-a-server.
  4. Anrejistre repons ki pa 2xx epi mete retry/backoff kote sa nesesè.
  5. Fè kle yo wotasyon sou yon orè; revoke imedyatman si yo konpwomi.