oihso/php-bitrix24-api-module
Composer 安装命令:
composer require oihso/php-bitrix24-api-module
包简介
This library allows you to use Bitrix24 REST API. An authentication module is included in this library.
README 文档
README
A basic PHP library for the Bitrix24 REST API. An authentication module is included.
Bitrix24 Documentation
Russian documentation
English documentation
Requirements
- php: >=7.0.0
- ext-json: *
- ext-curl: *
- ext-mysqli: *
Example
<?php use Bitrix24API\Bitrix24; $Bitrix24 = new Bitrix24( array( 'companyDomain' => 'example.bitrix24.com', //Bitrix24 company URL 'scope' => 'crm,user,telephony', //Bitrix24 auth scopes. Available variants: https://training.bitrix24.com/rest_help/rest_sum/premissions_scope.php //Auth data 'auth' => array( //Bitrix24 User auth data 'login' => 'user@bitrix24.com', 'password' => '1234', //Bitrix24 App auth data 'clientId' => 'local.55a6ca262e8482.12345678', 'clientSecret' => 'eOk9XtOWbdTjUgQmBL1MYNpKl0Jwt11JLHYHIADX62f3c6PA29' ), //Database config 'database' => array( 'settingsTableName' => 'config', 'settingsKeyName' => 'key', 'settingsValueName' => 'value' ) ), array( '127.0.0.1', //MySQL Host 'user', //MySQL Username '1234', //MySQL Password 'db', //MySQL Database 3306 //MySQL Port ) //Database connection ); //Gets deal with DEAL_ID = '1234' $dealData = $Bitrix24->callMethod("crm.deal.get", array('id'=>'1234'));
What is settingsKeyName and settingsValueName values?
PHP Bitrix24 API Module uses standard key-value pair table to store data.
Here is an example
If you have another names for key-value pairs (for example: option as key - config as value), you need to specify this names in config. Otherwise the library will not work.
Installation
- Install library in your project:
composer require oihso/bitrix24-api-module - Create new table (or use an existing one) to store settings. The table must be key-value type. Key and value must be
TEXTfields - Add the row "php_bitrix24_auth_time" = "0" to the table
- Add the row "php_bitrix24_auth_code" = "code" to the table
How to configure your Bitrix24
- Go to
Applications -> Add application -> My account only -> Addand create app withOnly APIcheckmark. Also you need to select all needed scopes - Copy
client_idandclient_secretand paste it intoBitrix24class config - On the left-side menu go to
Invite usersand register new user. It will be your "service" account for REST API - Create new
group/departmentfor your new "service" account - Set up permissions for this
group/department. You need to allow administrative rules for this account. - Now, you can paste user's credentials into
Bitrix24class config
License
"PHP Bitrix24 API Module" is licensed under the Apache License - see the LICENSE.txt file for details
oihso/php-bitrix24-api-module 适用场景与选型建议
oihso/php-bitrix24-api-module 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 16 次下载、GitHub Stars 达 2, 最近一次更新时间为 2019 年 01 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 oihso/php-bitrix24-api-module 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 oihso/php-bitrix24-api-module 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 16
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2019-01-14