-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlib_bitrix24.php
More file actions
30 lines (23 loc) · 773 Bytes
/
Copy pathlib_bitrix24.php
File metadata and controls
30 lines (23 loc) · 773 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
function executeREST ($rest_url, $method, $params, $access_token) {
$url = $rest_url.$method.'.json';
return executeHTTPRequest($url, array_merge($params, array("auth" => $access_token)));
}
function executeHTTPRequest ($queryUrl, array $params = array()) {
$result = array();
$queryData = http_build_query($params);
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_SSL_VERIFYPEER => 0,
CURLOPT_POST => 1,
CURLOPT_HEADER => 0,
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => $queryUrl,
CURLOPT_POSTFIELDS => $queryData,
));
$curlResult = curl_exec($curl);
curl_close($curl);
if ($curlResult != '') $result = json_decode($curlResult, true);
return $result;
}
?>