WebTolk Joomla Extensions
89 Extensions
11 Categories
391 Versions released
379443 Downloads
A method for getting a list of sales funnels for deals.
GET /api/v4/leads/pipelines
Official documentation of the method
Parameter | Data type | Description |
---|---|---|
id | int | Pipline ID |
name | string | PiplineName |
sort | int | Pipline Sorting |
is_main | bool | Is the pipline the main one |
is_unsorted_on | bool | Is the undiscovered in the pipline included |
is_archive | bool | Is the pipline archived |
account_id | int | ID of the account where the pipline is located |
_embedded[statuses] | array | Status data available in the pipline. Read more about the statuses in the amoCRM documentation |
The return value corresponds to the amoCRM documentation for this method.
Example of amoCRM's response to a request for a list of piplines:
stdClass Object
(
[_total_items] => 2
[_links] => stdClass Object
(
[self] => stdClass Object
(
[href] => https://yourdomain.amocrm.ru/api/v4/leads/pipelines
)
)
[_embedded] => stdClass Object
(
[pipelines] => Array
(
[0] => stdClass Object
(
[id] => 3753682
[name] => Воронка
[sort] => 1
[is_main] => 1
[is_unsorted_on] => 1
[is_archive] =>
[account_id] => 29145994
[_links] => stdClass Object
(
[self] => stdClass Object
(
[href] => https://yourdomain.amocrm.ru/api/v4/leads/pipelines/3753682
)
)
[_embedded] => stdClass Object
(
[statuses] => Array
(
[0] => stdClass Object
(
[id] => 36335092
[name] => Неразобранное
[sort] => 10
[is_editable] =>
[pipeline_id] => 3753682
[color] => #c1c1c1
[type] => 1
[account_id] => 29145994
[_links] => stdClass Object
(
[self] => stdClass Object
(
[href] => https://yourdomain.amocrm.ru/api/v4/leads/pipelines/3753682/statuses/36335092
)
)
)
[1] => stdClass Object
(
[id] => 36335095
[name] => Первичный контакт
[sort] => 20
[is_editable] => 1
[pipeline_id] => 3753682
[color] => #99ccff
[type] => 0
[account_id] => 29145994
[_links] => stdClass Object
(
[self] => stdClass Object
(
[href] => https://yourdomain.amocrm.ru/api/v4/leads/pipelines/3753682/statuses/36335095
)
)
)
[2] => stdClass Object
(
[id] => 36335098
[name] => Переговоры
[sort] => 30
[is_editable] => 1
[pipeline_id] => 3753682
[color] => #ffff99
[type] => 0
[account_id] => 29145994
[_links] => stdClass Object
(
[self] => stdClass Object
(
[href] => https://yourdomain.amocrm.ru/api/v4/leads/pipelines/3753682/statuses/36335098
)
)
)
[3] => stdClass Object
(
[id] => 36335101
[name] => Принимают решение
[sort] => 40
[is_editable] => 1
[pipeline_id] => 3753682
[color] => #ffcc66
[type] => 0
[account_id] => 29145994
[_links] => stdClass Object
(
[self] => stdClass Object
(
[href] => https://yourdomain.amocrm.ru/api/v4/leads/pipelines/3753682/statuses/36335101
)
)
)
[4] => stdClass Object
(
[id] => 36335104
[name] => Согласование договора
[sort] => 50
[is_editable] => 1
[pipeline_id] => 3753682
[color] => #ffcccc
[type] => 0
[account_id] => 29145994
[_links] => stdClass Object
(
[self] => stdClass Object
(
[href] => https://yourdomain.amocrm.ru/api/v4/leads/pipelines/3753682/statuses/36335104
)
)
)
[5] => stdClass Object
(
[id] => 142
[name] => Успешно реализовано
[sort] => 10000
[is_editable] =>
[pipeline_id] => 3753682
[color] => #CCFF66
[type] => 0
[account_id] => 29145994
[_links] => stdClass Object
(
[self] => stdClass Object
(
[href] => https://yourdomain.amocrm.ru/api/v4/leads/pipelines/3753682/statuses/142
)
)
)
[6] => stdClass Object
(
[id] => 143
[name] => Закрыто и не реализовано
[sort] => 11000
[is_editable] =>
[pipeline_id] => 3753682
[color] => #D5D8DB
[type] => 0
[account_id] => 29145994
[_links] => stdClass Object
(
[self] => stdClass Object
(
[href] => https://yourdomain.amocrm.ru/api/v4/leads/pipelines/3753682/statuses/143
)
)
)
)
)
)
[1] => stdClass Object
(
[id] => 3759013
[name] => Воронка 2
[sort] => 2
[is_main] =>
[is_unsorted_on] => 1
[is_archive] =>
[account_id] => 29145994
[_links] => stdClass Object
(
[self] => stdClass Object
(
[href] => https://yourdomain.amocrm.ru/api/v4/leads/pipelines/3759013
)
)
[_embedded] => stdClass Object
(
[statuses] => Array
(
[0] => stdClass Object
(
[id] => 36372217
[name] => Неразобранное
[sort] => 10
[is_editable] =>
[pipeline_id] => 3759013
[color] => #c1c1c1
[type] => 1
[account_id] => 29145994
[_links] => stdClass Object
(
[self] => stdClass Object
(
[href] => https://yourdomain.amocrm.ru/api/v4/leads/pipelines/3759013/statuses/36372217
)
)
)
[1] => stdClass Object
(
[id] => 36372220
[name] => Первичный контакт
[sort] => 20
[is_editable] => 1
[pipeline_id] => 3759013
[color] => #99ccff
[type] => 0
[account_id] => 29145994
[_links] => stdClass Object
(
[self] => stdClass Object
(
[href] => https://yourdomain.amocrm.ru/api/v4/leads/pipelines/3759013/statuses/36372220
)
)
)
[2] => stdClass Object
(
[id] => 36372223
[name] => Переговоры
[sort] => 30
[is_editable] => 1
[pipeline_id] => 3759013
[color] => #ffff99
[type] => 0
[account_id] => 29145994
[_links] => stdClass Object
(
[self] => stdClass Object
(
[href] => https://yourdomain.amocrm.ru/api/v4/leads/pipelines/3759013/statuses/36372223
)
)
)
[3] => stdClass Object
(
[id] => 36372226
[name] => Принимают решение
[sort] => 40
[is_editable] => 1
[pipeline_id] => 3759013
[color] => #ffcc66
[type] => 0
[account_id] => 29145994
[_links] => stdClass Object
(
[self] => stdClass Object
(
[href] => https://yourdomain.amocrm.ru/api/v4/leads/pipelines/3759013/statuses/36372226
)
)
)
[4] => stdClass Object
(
[id] => 142
[name] => Успешно реализовано
[sort] => 10000
[is_editable] =>
[pipeline_id] => 3759013
[color] => #CCFF66
[type] => 0
[account_id] => 29145994
[_links] => stdClass Object
(
[self] => stdClass Object
(
[href] => https://yourdomain.amocrm.ru/api/v4/leads/pipelines/3759013/statuses/142
)
)
)
[5] => stdClass Object
(
[id] => 143
[name] => Закрыто и не реализовано
[sort] => 11000
[is_editable] =>
[pipeline_id] => 3759013
[color] => #D5D8DB
[type] => 0
[account_id] => 29145994
[_links] => stdClass Object
(
[self] => stdClass Object
(
[href] => https://yourdomain.amocrm.ru/api/v4/leads/pipelines/3759013/statuses/143
)
)
)
)
)
)
)
)
)
The official documentation says about a possible response code 401 The user is not authorized. The WT AmoCRM library returns an error object of the following structure:
stdClass Object
(
[error_code] => 404
[error_message] => getLeadsPiplines function: Error while trying to get leads piplines list from Amo CRM. Amo CRM API response: title: Not Found
type: https://httpstatus.es/404
status: 404
detail: Cannot GET https://yourdomain.amocrm.ru/leads/pipelines1!
)
In this example, there is a typo in the name of the amoCRM API method specifically to demonstrate an error response.
<?php
use Webtolk\Amocrm\Amocrm;
// No direct access
defined('_JEXEC') or die;
$amocrm = new Amocrm();
$result_amo_crm = $amocrm->getLeadsPiplines();
?>