fomvasss / bitrix24-api-hook
Bitrix24 REST API 的 PHP 库
0.1.1
2019-04-09 19:23 UTC
Requires
- php: >=5.5.0
Requires (Dev)
- ext-curl: *
This package is auto-updated.
Last update: 2022-02-10 04:33:31 UTC
README
Bitrix24 REST API 的 PHP 库
安装
在命令行运行
composer require fomvasss/bitrix24-api-hook
使用
准备 Bitrix24
- 在 https://www.bitrix24.com/ 注册(如果您没有账户)并确认账户
- 注册后获取您的 Bitrix-domain(例如: https://your-domain.bitrix24.ru,https://your-example.bitrix24.ru,...)
- 登录并为您想要执行的操作创建 webhook:应用程序 → WebHook → 添加 WebHook(Приложения → Вебхуки → Добавить вебхук)。
- 创建 webhook 后,您将获得示例 URL:
https://your-domen.bitrix24.ru/rest/13/9cybrkhzxxf28zl4/profile/
在这个类中,您需要使用以下参数:基本 URL、用户 ID、秘密密码(令牌)
- 基本 URL -
https://your-domen.bitrix24.ru
- 用户 ID -
13
- 密码 -
9cybrkhzxxf28zl4
使用 PHP 类
<?php $b24 = new \Fomvasss\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' => '+74563214561'] ], 'COMMENTS' => 'Hello World', 'UF_CRM_1554454898781' => 'Kiev', ], 'params' => ["REGISTER_SONET_EVENT" => "Y"], ]);
所有方法请参考 Bitrix24 文档