egeneralov / bitrix24-api-hook
Bitrix24 REST API 的 PHP 库
dev-main
2023-12-10 10:38 UTC
Requires
- php: >=5.5.0
Requires (Dev)
- ext-curl: *
This package is auto-updated.
Last update: 2024-09-10 12:09:09 UTC
README
Bitrix24 REST API 的 PHP 库
安装
从命令行运行
composer require egeneralov/bitrix24-api-hook
用法
准备 Bitrix24
- 在 https://www.bitrix24.com/ 注册(如果您还没有账户)并确认账户
- 注册后获取您的 Bitrix-domain(例如:https://your-domain.bitrix24.ru,https://your-example.bitrix24.ru,...)
- 登录并为您所需操作创建 webhook:应用程序 → WebHook → 添加 WebHook(Приложения → Вебхуки → Добавить вебхук)。
- 创建 webhuk 后,您将获得以下示例 URL:
https://your-domen.bitrix24.ru/rest/13/9cybrkhzxxf28zl4/profile/
在此类中,您需要使用以下参数:基础 URL、用户 ID、密钥密码(token)
- 基础 URL -
https://your-domen.bitrix24.ru
- 用户 ID -
13
- 密码 -
9cybrkhzxxf28zl4
使用 PHP 类
<?php $b24 = new \Generalov\Bitrix24ApiHook\Bitrix24('https://testhipertin.bitrix24.ru', 13, '9cybrkhzxxf28zl4'); // see "crm.lead.add" $b24->crmLeadAdd([ "fields" => [ 'TITLE' => 'New contacts fomr', 'NAME' => 'Bob Dilan', 'EMAIL' => [ ['VALUE' => 'bob@app.com',], ], 'PHONE' => [ ['VALUE' => '+73519280550'] ], 'COMMENTS' => 'Hello World', 'UF_CRM_1554454898781' => 'Magnitogorsk', ], 'params' => ["REGISTER_SONET_EVENT" => "Y"], ]);
所有方法请参见 Bitrix24 文档