PHP code example of business-ru / business-online-sdk-php
1. Go to this page and download the library: Download business-ru/business-online-sdk-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
business-ru / business-online-sdk-php example snippets
$api = new \bru\api\Client($account, $app_id, $secret, $sleep, $cache, $http);
//Создаем обьект для работы с API сайта https://a13344.business.ru
$api = new Client('a13344', 2134124, 'CWZf963mlm0srCKXu8LPepSq69uEv6Hf', true);
//Устанавливаем свой логгер
$api->setLogger($myLogger);
//Удалить задачу с ID 224
$api->request('delete', 'tasks', ['id' => 224]);
//Создать задачу c описанием 'Задача создана с помощью API'
$api->request('post', 'tasks', ['task_type_id' => 2, 'description' => 'Задача создана с помощью API', 'author_employee_id' => 44224]);
//Вернет все задачи с типом 2
$api->requestAll('tasks', ['task_type_id' => 2]);
//Вернет все товары
$api->requestAll('goods');
//Отправить пользователя 12345 уведомление
$api->sendNotification(['employee_ids' => [12345], 'header' => 'Это заголовок уведомления', 'message' => 'Это текст сообщения']);