Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require("include/config.php");
- require("include/RestAPI.php");
- session_start();
- if(!isset($_SESSION['rest']))
- {
- $domain = 'tashcompan.bitrix24.ru';
- $rest = new RestAPI($domain,CLIENT_ID,REDIRECT_URI,CLIENT_SECRET,SCOPE);
- $_SESSION['rest'] = $rest;
- }
- else
- {
- $rest=$_SESSION['rest'];
- }
- if($rest->status_auth === "step1" && isset($_GET['code']))
- {
- $res = $rest->auth_step2($_GET['code']);
- if($rest->status_auth==="fail")
- {
- echo "<b>Error:</b> ".$res;
- }
- }
- else if($rest->status_auth != "success" && !isset($_GET['code']))
- {
- $rest->auth_step1();
- }
- $params = array(
- 'ENTITY' => 'olsdolo',
- 'NAME' => 'ololsol',
- 'ACCESS' => array(
- "U1" =>'W',
- "AU" =>'R',),
- );
- if($rest->status_auth === "success")
- {
- $res = $rest->callMethod("entity.get");
- var_dump($res);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement