App Registration
To register your app in our system, prepare and provide the following information ⬇️
☝🏻 Tip:
- code is the unique code of your integration;
- callback_url is the URL to which app installation and uninstallation requests will be sent. For these actions, /portals/install and /portals/uninstall are appended to the callback_url, respectively;
- price is set to true if your integration is paid and to false if it is free;
- sns_subscription_url is the URL to which events about new messages in External Channels will be sent.
💡Note: You can provide descriptions and names in multiple languages for better localization. Currently, we support the following languages ⬇️
| Locale | Language |
|---|---|
| uk | Ukraine |
| en-US | English US |
| pt-BR | Portuguese |
| pl | Polish |
| es-ES | Spanish |
| de | German |
After providing this information, you will receive a client_id and secret_id for further development.
Backend Development
We have prepared a Laravel PHP template with basic settings. Review the link
🔍 Review the link ➡️ HERE
App Installation
When a user installs the app, you will receive the following request:
❗️We use a JWT token. To determine the portal that is installing the app, you need to parse the token and verify its authenticity. An example implementation of this logic can be found ➡️ HERE
You need to save:
- token – valid for 1 day
- refresh_token – valid for 30 days
- expiry_date – to check the token's validity. The value must be specified in seconds.
It is recommended to create a cron job to update portal tokens.
When developing an integration, you will encounter two types of tokens: a user token and an integration token. These tokens are signed with different keys and contain different sets of fields in their payloads.
Access Token Renewal
In the previous step, we obtained a token. This token has a lifetime of 1 day, after which requests using it will stop working. To renew the token, we recommend using the following request:
App deletion
When the app is uninstalled, you will receive:
💡 The token is in the Authorization header. You need to parse the token, get the domain value, and verify the token's authenticity.
Working with External Lines (EL)
Creating external line
To send messages to external lines (EL), you first need to create them. Typically, one connection has one EL. For example, in the Instagram app, the user can add multiple accounts (connections), and we create a separate EL for each of them.
☝🏻 Tip:
- name is the unique name;
- icon is the URL of the icon. This image will be displayed in the bottom-right corner of the chat icon on the External Lines tab;
- phoneNumber is the phone number, if available. If your integration does not use phone numbers, you can use the same value as in the name field;
- externalId is the unique identifier of the External Line.
☝🏻 Save the identifier of the created EL, as you will need it later.
🔍 More information about EL interaction methods can be found ➡️ HERE
Creating a Chat
Next, you need to create a chat. If, for example, webhooks will be receiving events about messages, then having the identifier of the user sending these messages, you can create a chat. Then, in subsequent similar events, you will know which chat to send the processed messages from your service to the EL.
☝🏻 Tip:
- externalLines is the ID of the External Line created earlier;
- meta is used to link the chat to CRM;
- meta.type supports the following values:
phone,widgetUser,username,facebook,instagram,telegram,twitter,viber, orwhatsapp; - meta.value can contain a phone number or an ID.
☝🏻Save the identifier of the created chat.
These are the basic required fields.
🔍 More information about chat interaction can be found ➡️ HERE
Sending Messages
If your message will contain attachments, you need to upload them first.
- Uploading files (if needed):
🔍 More information about file storage can be found ➡️ Here
2. Sending a message:
☝🏻 Tip:
- type — see the documentation for more information about the available message types ➡️ HERE;
- externalAuthorId is the ID of the message sender;
- parentMessage is the ID of the parent message;
- attachedFiles is an array of files uploaded in the previous step.
💡 You can use Markdown to format the message text.
🔍 More information about message manipulation can be found ➡️ HERE
3. Receiving a message event:
When you registered the app, you provided the sns_subscription_url field. We will send a webhook about the message in the EL to this URL. You need to check the event that comes in and extract only the payload. For example, you can use the nipwaayoni/laravel-aws-sns package for PHP and add the following code to the controller:
Here is an example of a received message event with an image:
After that, we recommend checking that it is a message, and that it is from the EL:
Next, you can find the corresponding chat in your system by the chatId identifier.
If you have additional questions or you need to contact the support, send a request to this email [email protected]
Created: September 26, 2024 / Updated: September 24, 2025