forked from dotzero/amocrm-php
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwidgets.php
More file actions
30 lines (22 loc) · 817 Bytes
/
widgets.php
File metadata and controls
30 lines (22 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
require_once __DIR__ . '/../vendor/autoload.php';
try {
$amo = new \AmoCRM\Client(getenv('DOMAIN'), getenv('LOGIN'), getenv('HASH'));
// Список виджетов
// Метод для получения списка доступных для установки виджетов.
print_r($amo->widgets->apiList());
// С доп фильтрацией
print_r($amo->widgets->apiList([
'widget_id' => 62121
]));
// Включение виджетов
print_r($amo->widgets->apiInstall([
'widget_id' => 62121
]));
// Выключение виджетов
print_r($amo->widgets->apiUninstall([
'widget_id' => 62121
]));
} catch (\AmoCRM\Exception $e) {
printf('Error (%d): %s' . PHP_EOL, $e->getCode(), $e->getMessage());
}