post https://{subdomain}.kommo.com/api/v4/widgets/
This method allows installing the widget into the account.
Limitations
The method is available for administrators of the account only.
Request parameters
To install a widget, mandatory parameters based on the widget settings should be passed.
Available field types and their format are listed below.
Parameter | Data type | Description |
---|---|---|
text | string | Value for this type is passed as a regular string |
pass | string | Value for this type is passed as a regular string |
users | object | An object containing user ID as key and his extension number as value |
users_lp | object | An object containing user ID as key and an object with login and password as value |
users_lp[{user_id}][login] | object | User login |
users_lp[{user_id}][password] | object | User password |
An example of the request
In the following example we’ll pass fields required to install the asterisk
widget.
Fields “login”
and “script_path”
have the “text”
type.
Field “password”
has the “pass”
type.
Field “phones” has the “users”
type.
{
"login": "example",
"password": "eXaMp1E",
"phones": {
504141: "1039"
},
"script_path": "https://example.com/"
}
Data type header when the request is successful
Content-Type: application/hal+json
Data type header in case of an error
Content-Type: application/problem+json
Response parameters
The method returns an object of the installed widget and its settings.
Parameter | Data type | Description |
---|---|---|
id | int | Widget ID |
code | string | Widget code |
version | string | Widget version |
rating | string|float | Widget rating (rating system doesn't exist on Kommo yet) |
settings_template | array | An array of widget settings fields |
settings_template[0] | obj | Widget settings field |
settings_template[0][key] | string | Field value key |
settings_template[0][name] | string | Widget settings field name |
settings_template[0][type] | string | Widget settings field data type (text, pass, custom, users, or users_lp) |
settings_template[0][is_required] | bool | Shows whether filling in the is mandatory |
is_lead_source | bool | Shows whether a widget can be set as a lead source |
is_work_with_dp | bool | Shows whether a widget is available in Digital Pipeline |
is_crm_template | bool | Shows whether a widget is a CRM template |
client_uuid | string|null | UUID of the widget’s oAuth integration |
is_active_in_account | bool | Shows whether the widget is installed in the account |
pipeline_id | int | Pipeline ID where a widget is set as a lead source |
settings | array | Widget settings. The key is returned only when an integration requests its own settings |