PHP code example of oihso / php-bitrix24-api-module
1. Go to this page and download the library: Download oihso/php-bitrix24-api-module library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
oihso / php-bitrix24-api-module example snippets
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' => '[email protected]',
'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'));
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.