PHP code example of docplanner / integrations-api-sdk-php

1. Go to this page and download the library: Download docplanner/integrations-api-sdk-php 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/ */

    

docplanner / integrations-api-sdk-php example snippets


    


 OAuth2 access token
$authorization = new DocPlanner\Client\Authorization('https://www.{domain}/oauth/v2/token');
$accessToken = $authorization->getAccessToken('YOUR_CLIENT_ID', 'YOUR_CLIENT_SECRET');

// Configure access token for authorization 
$config = DocPlanner\Client\Configuration::getDefaultConfiguration();
$config->setAccessToken($accessToken);
$config->setHost('https://www.{domain}/api/v3/integration');

$apiInstance = new DocPlanner\Client\Api\DoctorsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$facility_id = 56; // int | ID of the Facility
$with = array(\DocPlanner\Client\Model\DoctorsScopes::SPECIALIZATIONS); // string[] | 

try {
    $result = $apiInstance->getDoctors($facility_id, $with);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DoctorsApi->getDoctors: ', $e->getMessage(), PHP_EOL;
}

// Configure access token for authorization 
$config = DocPlanner\Client\Configuration::getDefaultConfiguration()->setAccessToken($accessToken);

$apiInstance = new DocPlanner\Client\Api\AddressesApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$facility_id = 56; // int | ID of the Facility
$doctor_id = 56; // int | ID of a doctor in a facility

try {
    $result = $apiInstance->getAddresses($facility_id, $doctor_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AddressesApi->getAddresses: ', $e->getMessage(), PHP_EOL;
}

//Get OAuth2 access token
$authorization = new DocPlanner\Client\Authorization('https://www.{domain}/oauth/v2/token');
$accessToken = $authorization->getAccessToken('YOUR_CLIENT_ID', 'YOUR_CLIENT_SECRET');

// Configure access token for authorization 
$config = DocPlanner\Client\Configuration::getDefaultConfiguration()->setAccessToken($accessToken);

$apiInstance = new DocPlanner\Client\Api\AddressesApi(null, $config);