Расширения Joomla WebTolk
89 Всего расширений
11 Категорий
395 Выпущено версий
381574 Всего скачиваний
Метод для получения списка воронок продаж для сделок.
GET /api/v4/leads/pipelines
Официальная документация метода
Параметр | Тип данных | Описание |
---|---|---|
id | int | ID воронки |
name | string | Название воронки |
sort | int | Сортировка воронки |
is_main | bool | Является ли воронка главной |
is_unsorted_on | bool | Включено ли неразобранное в воронке |
is_archive | bool | Является ли воронка архивной |
account_id | int | ID аккаунта, в котором находится воронка |
_embedded[statuses] | array | Данные статусов, имеющихся в воронке. Подробней о статусах читайте в документации AmoCRM |
Возвращаемое значение соответствует документации AmoCRM для этого метода.
Пример ответа AmoCRM на запрос списка воронок продаж:
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
)
)
)
)
)
)
)
)
)
Официальная документация говорит о возможном коде ответа 401 Пользователь не авторизован. Библиотека WT Amocrm возвращает объект ошибки следующей структуры:
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!
)
В данном примере в названии метода AmoCRM API специально допущена опечатка для демонстрации ответа с ошибкой.
<?php
use Webtolk\Amocrm\Amocrm;
// No direct access
defined('_JEXEC') or die;
$amocrm = new Amocrm();
$result_amo_crm = $amocrm->getLeadsPiplines();
?>