valkinaz/yii2-bitrix24

Компонент для работы с CRM Bitrix24

Installs: 369

Dependents: 0

Suggesters: 0

Security: 0

Stars: 6

Watchers: 0

Forks: 0

Open Issues: 0

Type:yii2-extension

dev-master / 2.0.x-dev 2018-08-20 04:19 UTC

This package is not auto-updated.

Last update: 2024-04-09 16:29:52 UTC


README

993323

Bitrix24 Extension for Yii 2


Download and install

composer require valkinaz/yii2-bitrix24

Preparation

Create 2 files in your config directory. You can see examples at src folder:

  • bitrix24.json This is a configuration of component. You must set your individual "host", "client_id", "client_secret", "application_uri", "access_token" and "refresh_token". Provide for this file permissions so that the script can overwrite it in the future.

  • bitrix24.php This file using bitrix24.json and prepares component for Yii config.

Then include component at the config:

$bitrix24 = require __DIR__ . '/bitrix24.php';

'components' => [
	'bitrix24' => $bitrix24,
]

Usage

Create contact for example. In the $response variable you'll get response from your CRM.

$post = [
    'fields' => [
        'NAME' => 'Example_name',
        'PHONE' => [
            [
                'VALUE' => '79999999999',
                'VALUE_TYPE' => 'MOBILE'
            ]
        ],
        'ASSIGNED_BY_ID' => 1
    ]
];

$response = Yii::$app->bitrix24->Send('crm.contact.add', 'POST', $post);