Download the PHP package reutskiy-a/simple-api-bitrix24 without Composer

On this page you can find all versions of the php package reutskiy-a/simple-api-bitrix24. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package simple-api-bitrix24

Unit Tested Integration Tests License

REST API клиент для облачной версии Битрикс24 (совместим с REST API 2.0)

lang: English

Этот REST API клиент подойдёт тем, кому нужен быстрый старт, минимализм и вся необходимая функциональность для разработки полноценных приложений для облачной версии Битрикс24.

Что умеет:

Более детальную информацию и примеры по работе с REST API клиентом смотрите в содержании ниже.

Пример установки локального приложения: https://github.com/reutskiy-a/simple-api-bitrix24/tree/master/examples

Installation-demo

Содержание:

  1. Webhook авторизация - быстрый старт

  2. OAuth 2.0 авторизация - быстрый старт

    2.1 Подготовка соединения с базой данных и создание таблицы пользователей

    2.2 Создание объекта REST API клиента с OAuth 2.0 авторизацией

    2.3 Установка приложения и сохранение данных пользователя в БД

  3. Подробно о работе с REST API клиентом

    3.1 Установка авторизации для REST API клиента по умолчанию

    3.2 Смена авторизации REST API клиента / работа с разными порталами или пользователями одновременно

    3.3 Сохранение данных пользователя в БД

    3.4 Работа с пользователями через UserRepository

  4. Настройка обработки лимитов REST API bitrix24

  5. Логирование

  6. Batch запросы

    6.1 Обычный batch запрос

    6.2 Batch сервис

1. Webhook авторизация - быстрый старт

2. OAuth 2.0 авторизация - быстрый старт

2.1 Подготовка соединения с базой данных и создание таблицы пользователей

Используйте любую удобную базу данных: MySQL, PostgreSQL, SQLite.

2.2 Создание объекта REST API клиента с OAuth 2.0 авторизацией

2.3 Установка приложения и сохранение данных пользователя в БД

3. Подробно о работе с REST API клиентом

3.1 Установка авторизации для REST API клиента по умолчанию

3.2 Смена авторизации REST API клиента / работа с разными порталами или пользователями одновременно

3.3 Сохранение данных пользователя в БД

Будьте внимательны передавая client_id и client_secret в методе InstallationService::createUserFromProfileAndSave, они будут записаны в БД для каждого пользователя отдельно, что позволяет работать локальным приложениям, как тиражным (одно приложение - много порталов). Если вы укажете client_id и client_secret не верно для конкретного пользователя, то его токены авторизации не обновятся и REST API клиент выбросит исключение.

3.4 Работа с пользователями через UserRepository

4. Настройка обработки лимитов REST API Bitrix24

Подробнее о лимитах REST API смотрите в официальной документации

https://apidocs.bitrix24.ru/limits.html

Этот REST API клиент может обрабатывать ответы об ошибках лимитов REST API:

Пример обрабатываемых ошибок от сервера REST API:

По умолчанию обработка выше перечисленных ошибок включена в этом REST API клиенте.

Как работает обработка ошибок - при получении ответа с одной из ошибок API Client будет делать повторный запрос через заданный интервал времени, не останавливая работу скрипта, делать это будет постоянно пока не завершится выполнение скрипта или не истечёт время жизни приложения.

Так же REST API клиент обрабатывает по умолчанию ошибки:

В остальных случаях клиент выбрасывает исключения на другие ответы с ошибками от сервера REST API Bitrix24.

5. Логирование

При уровне логирования DEBUG в журнал будут записываться:

При уровне логирования WARNING в журнал будут записываться:

6. Batch запросы

6.1 Обычный batch запрос

6.2 Batch сервис

English:

This REST API client is ideal for those who need a quick start, minimalism, and all the essential functionality for building full‑featured applications for the cloud version of Bitrix24.

Features:

For more detailed information and usage examples, see the sections below.

Example of installing a local application: https://github.com/reutskiy-a/simple-api-bitrix24/tree/master/examples

Installation-demo

Table of Contents:

  1. Webhook Authorization — Quick Start

  2. OAuth 2.0 Authorization — Quick Start

    2.1 Preparing the database connection and creating the users table

    2.2 Creating a REST API client with OAuth 2.0 authorization

    2.3 Application installation and saving user data to the database

  3. Detailed usage of the REST API client

    3.1 Setting default authorization for the REST API client

    3.2 Switching authorization / working with multiple portals or users simultaneously

    3.3 Saving user data to the database

    3.4 Working with users via UserRepository

  4. Configuring Bitrix24 REST API rate‑limit handling

  5. Logging

  6. Batch requests

    6.1 Basic batch request

    6.2 Batch service

1. Webhook Authorization — Quick Start

2. OAuth 2.0 Authorization — Quick Start

2.1 Preparing the database connection and creating the users table

You can use any relational database: MySQL, PostgreSQL, SQLite.

2.2 Creating a REST API client with OAuth 2.0 authorization

2.3 Application installation and saving user data to the database

3. Detailed usage of the REST API client

3.1 Setting default authorization for the REST API client

3.2 Switching authorization / working with multiple portals or users simultaneously

3.3 Saving user data to the database

Be careful when passing client_id and client_secret to InstallationService::createUserFromProfileAndSave. They are stored per user, enabling local apps to behave like multi‑tenant apps. If you provide incorrect values, token refresh will fail and the client will throw an exception.

3.4 Working with users via UserRepository

4. Configuring Bitrix24 REST API rate‑limit handling

For more details on Bitrix24 REST API limits, see:

https://apidocs.bitrix24.com/limits.html

This client can automatically handle REST API rate‑limit errors.

Examples of handled errors:

By default, rate‑limit handling is enabled.

When such an error occurs, the client retries the request after a configured delay, continuing until the script finishes or the application lifetime ends.

Additionally, the client handles:

All other errors result in exceptions.

5. Logging

With the DEBUG logging level, the following will be recorded:

With the WARNING logging level, the following will be recorded:

6. Batch requests

6.1 Basic batch request

6.2 Batch service


All versions of simple-api-bitrix24 with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
monolog/monolog Version ^3.0
guzzlehttp/guzzle Version ^7.0
guzzlehttp/psr7 Version ^2.0
aura/sqlquery Version ^2.0 || ^3.0
nesbot/carbon Version ^2.0 || ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package reutskiy-a/simple-api-bitrix24 contains the following files

Loading the files please wait ...