This tutorial walks you through connecting your qlar agent to a WhatsApp Business number using Coster as your BSP (Business Solution Provider).

The example connects Atlas, Kirana Group's operations assistant, to Kirana's WhatsApp Business number 6281200000000, so site supervisors and field staff can ask Atlas about approvals and site safety from their phones.


Before you start

  • Your agent answers well in Preview and has been published at least once. See Preview and Publish Changes.
  • You have read Connect to WhatsApp, which explains the Published and Draft configurations used below.
  • You use Coster as your WhatsApp Business provider. If you only want to get your agent on WhatsApp quickly, the Quick Start: Public Server needs no provider account.

From Coster, make sure you have:

  • An active Coster account with a registered WhatsApp Business number.
  • The following values from Coster:
    • Account ID
    • Division ID
    • Access Token
    • Template Access Token

Tip: Contact your Coster account manager or log in to the Coster portal to retrieve these credentials. The Access Token is used for sending messages, while the Template Access Token is specifically for sending WhatsApp message templates.


Step 1: Open Channel Settings

  1. Open the CMS dashboard and select the agent you want to connect.
  2. In the left sidebar, open Channels → WhatsApp.
  3. Choose which configuration to set up: Published Configuration (for live users) or Draft Configuration (for testing). Click the corresponding tab.

Note: You can configure both tabs independently. Start with Draft to test first, then repeat the steps for Published when ready to go live.


Step 2: Enter the phone number and click Next

If no WhatsApp number has been connected yet, the Connect WhatsApp wizard appears.

  1. In the Protocol dropdown, select Coster.
  2. In the Phone Number field, enter your WhatsApp Business number starting with the country code, without + or spaces. For Kirana that is 6281200000000.
  3. Click Next.

Clicking Next creates the configuration right away. There is no separate confirmation. The wizard closes and the configuration screen opens. Its header shows the Active switch, the Notifications button and a ⋯ menu, which holds Delete channel. The integration stays inactive in practice until every required field is filled in, so continue with the next steps.

Coster configuration screen after clicking Next: Coster label, Active switch, a greyed-out Notifications button and a three-dot menu at the top; Connection & Credentials card with an Edit button, Phone Number 6281200000000, a masked Webhook Secret, a text block with the Phone Number and the Webhook Configuration URL https://api.qlar.ai/messenger/api/Coster/Webhook?code= followed by a long code, and under API Credentials the empty fields Account ID, Division ID, Access Token and Template Access Token; Reply Mode with AI agent selected and Redirect to web; Session Management with Ask User to End Session on, Delay Before Ask More 300 seconds, Delay Before End Session 600 seconds, and Discard and Save buttons

The screen has three cards:

CardWhat it holds
Connection & CredentialsThe Phone Number (read-only), the Webhook Secret, a text block with the details to send to Coster, and under API Credentials the Account ID, Division ID, Access Token and Template Access Token. All are required and kept encrypted at rest. The card is read-only until you click Edit.
Reply ModeAI agent (the agent answers on WhatsApp) or Redirect to web.
Session ManagementWhen an inactive conversation is wound down.

If you entered the wrong number, open the ⋯ menu, choose Delete channel… and start the wizard again. The phone number cannot be edited afterwards.


Step 3: Enter the API credentials

Click Edit in the top-right of the Connection & Credentials card. The fields become editable, and Cancel and Save appear at the bottom of the card. Under API Credentials:

  1. Account ID: the Account ID from Coster.
  2. Division ID: the Division ID assigned to your WhatsApp channel in Coster.
  3. Access Token: the token used to authenticate API calls to the Coster messaging service.
  4. Template Access Token: the separate token used for sending WhatsApp message templates.
  5. Click Save at the bottom of the card. The CMS asks Save these changes? On the Published Configuration tab it warns instead that the change is applied to the live agent immediately. Click Yes.
  6. A message confirms Connection and credentials saved. The card goes back to read-only.

Cancel discards what you typed and closes the edit. While you are editing, the card shows Unsaved changes next to its buttons.

Note: Coster uses two separate tokens: one for general messaging and one for template messages. Make sure you enter both. Templates are used for proactive notifications and automated messages that start a conversation outside the 24-hour window.


Step 4: Send the webhook details to Coster

qlar needs Coster to forward incoming messages to qlar's servers.

  1. In the Connection & Credentials card, the Webhook Secret is already filled in. Click the eye icon to show it and the copy button to copy it.
  2. Below the fields, qlar shows a text block with your Phone Number and the Webhook Configuration URL. For Coster the URL carries the webhook secret as its code parameter, for example https://api.qlar.ai/messenger/api/Coster/Webhook?code=....
  3. Use the copy button in the corner of the block to copy both, and send them to Coster by email, or paste the URL into the webhook or callback URL settings of your WhatsApp channel in the Coster portal.

Warning: Keep the Webhook Secret confidential. To generate a new one, click Edit, then the refresh icon next to Webhook Secret. Because the secret is part of the Coster webhook URL, regenerating it also changes the URL: click Save to keep the new secret, then send the new URL to Coster.


Step 5: Choose the reply mode and session settings

  1. Under Reply Mode, keep AI agent so Atlas answers directly on WhatsApp. Redirect to web sends every private message an instant one-time sign-in link to the agent's web chat instead, and no AI runs on WhatsApp. See WhatsApp in Help for its settings.
  2. Under Session Management, keep the defaults unless you have a reason to change them: Ask User to End Session on, Delay Before Ask More 300 seconds, Delay Before End Session 600 seconds. See Session Management.
  3. If you changed anything in Session Management, click Save at the bottom of that card and confirm. Its Discard button puts the saved values back.

Each card saves only its own fields, so saving Session Management never sends a half-finished edit in another card.


Step 6: Publish

Saving marks your agent as having unpublished changes, so the Publish button appears at the top of the CMS. Click Publish so the connection is synced to the live version of your agent.

The Notifications button at the top of the screen opens the notification settings for this number. It stays greyed out until every required field is saved, and while Connection & Credentials is being edited. Hover over it to see what is still missing.


Check the result

To verify the connection is working:

  1. From a personal WhatsApp account, send a test message to your WhatsApp Business number, for example Who has to approve a project worth $2.5 million?
  2. The message should appear in your agent's conversation history in the CMS dashboard.
  3. Your agent should respond automatically, with the same kind of answer it gives in Preview.

Tip: If messages are not arriving, check that the Active switch is on, that every field under API Credentials is filled in and saved, that Coster uses the current Webhook Configuration URL, and that the Access Token has not expired.


Next steps