PHP code example of kafka0238 / crest
1. Go to this page and download the library: Download kafka0238/crest 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/ */
kafka0238 / crest example snippets
define('C_REST_CURRENT_ENCODING','windows-1251');
define('C_REST_WEB_HOOK_URL','https://xxx.bitrix24.ru/rest/1/douasdqdsxSWgc3mgc1/');
// put an example below
echo '<PRE>';
print_r(CRest::call(
'crm.lead.add',
[
'fields' =>[
'TITLE' => 'Название лида',//Заголовок*[string]
'NAME' => 'Имя',//Имя[string]
'LAST_NAME' => 'Фамилия',//Фамилия[string]
]
])
);
echo '</PRE>';
// put an example below
echo '<PRE>';
print_r(CRest::call(
'crm.lead.add',
[
'fields' =>[
'TITLE' => 'Название лида',//Заголовок*[string]
'NAME' => 'Имя',//Имя[string]
'LAST_NAME' => 'Фамилия',//Фамилия[string]
]
])
);
echo '</PRE>';
// put an example below
echo '<PRE>';
print_r(CRest::call(
'crm.lead.add',
[
'fields' =>[
'TITLE' => 'Название лида',//Заголовок*[string]
'NAME' => 'Имя',//Имя[string]
'LAST_NAME' => 'Фамилия',//Фамилия[string]
]
])
);
echo '</PRE>';
// put an example below
echo '<PRE>';
print_r(CRest::call(
'crm.lead.add',
[
'fields' =>[
'TITLE' => 'Название лида',//Заголовок*[string]
'NAME' => 'Имя',//Имя[string]
'LAST_NAME' => 'Фамилия',//Фамилия[string]
]
])
);
echo '</PRE>';
// put an example below
echo '<PRE>';
print_r(CRest::call(
'crm.lead.add',
[
'fields' =>[
'TITLE' => 'Название лида',//Заголовок*[string]
'NAME' => 'Имя',//Имя[string]
'LAST_NAME' => 'Фамилия',//Фамилия[string]
]
])
);
echo '</PRE>';