This functionality allows you to choose the sources of the incoming leads.
The Sources API methods allow an integration to manage its own sources. The integration can be identified by verifying the Access Token used when adding each source.
Each source has a unique code (external_id
).
One integration can add up to 100 sources.
The Sources API also allows the integration to create incoming leads and choose the pipeline in which they will be created.
Once created, the sources will appear in various locations such as:
- the source field of the incoming lead created via the chat API
- the channels field for the Message option when setting up a bot
- the list of contact options when Write First functionality is activated
- the Statistics tab of the lead card created using one of the sources
Additionally, you can specify the source when creating a lead via API using the lead add or complex lead add methods by sending the object _embedded[source]
with the source ID in the source external_id
and the source type always set to "widget"
.
"source":
{
"external_id": "ufi7pscriq7foaaz2afxakxtuf2yytuh7vjg1pxr",
"type": "widget"
}
An integration, using the source API, can add options for selecting WhatsApp numbers, which are used when setting up a button on a website (CRM Plugin).
The source can be specified with the waba
property if the integration works with official WhatsApp and a time window is configured. The parameter allows you to manage WhatsApp templates and use them in the new "Send Message" step in Salesbot. After specifying this parameter, you should subscribe to the events of sending a template for approval. Receiving an event, the integration can transfer the template for approval to WhatsApp and, depending on the result, change the status of the WhatsApp template via the API.
Integration requirements for working with the sources API
The corresponding Digital Pipeline settings section displays the sources generated by the integration.
Before working with the sources API, ensure that the integration meets the following criteria:
-
The integration has a widget with its manifest.json file specifying the ability to display the widget in the interface for adding a new source
"locations": ["lead_sources"]
. -
For integrations that work with chats, the widget code and integration ID must be specified in the chat channel when registering it.
When creating a new integration, you can choose to enable the Multiple sources function. This flag should be enabled when the integration fully manages the sources through the API from its backend, and creating the source from the Kommo side is no longer required. If the flag is not set, the source will be created on the Kommo side when the integration is installed.