- PHP 5.5 and later
- Guzzle 6.2 or later
To install the bindings via Composer, run composer require docplanner/integrations-api-sdk-php.
Download the files and include autoload.php:
require_once('/path/to/DocPlanner/Client/vendor/autoload.php');Please follow the installation procedure and then run the following:
<?php
require_once(__DIR__ . '/vendor/autoload.php');
//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();
$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;
}
?>To get access to API you need to make request to https://www.{domain}/oauth/v2/token for access token using your client credentials (client_id and client_secret).
Then it could be injected to Configuration which is used to instantiate API clients.
Whole authorization process is based on OAuth2 protocol with grant_type = client_credentials and scope = integration.
Obtained token is valid for the next 24h, so it is good practice to cache it for that period.
###Example
//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);All URIs are relative to https://www.{domain}/api/v3/integration
- AddAddressInsuranceProviderRequest
- AddAddressServiceRequest
- AddCalendarBreakRequest
- Address
- AddressBookingExtraFields
- AddressInsuranceProvider
- AddressInsuranceProviders
- AddressScopes
- AddressService
- AddressServiceNotification
- AddressServices
- Addresses
- AddressesScopes
- BookSlotRequest
- Booking
- BookingCanceledNotification
- BookingConfirmedNotification
- BookingMovedNotification
- BookingMovedNotificationData
- BookingMovingNotification
- BookingMovingNotificationData
- BookingNotification
- BookingPatient
- Bookings
- BookingsScopes
- BreakCreatedNotification
- BreakCreatedNotificationData
- BreakMovedNotification
- BreakNotification
- BreakRemovedNotification
- CalendarBreak
- CalendarBreaks
- CancelBookingRequest
- Doctor
- DoctorScopes
- Doctors
- DoctorsScopes
- Error
- Facilities
- Facility
- FacilityScopes
- Insurance
- InsuranceNotification
- InsurancePlan
- InsurancePlans
- InsuranceProvider
- InsuranceProviders
- LicenseNumber
- LicenseNumbers
- MoveBookingRequest
- MoveCalendarBreakRequest
- Notification
- OpinionRequest
- Patient
- PresenceMarkedNotification
- PresenceMarkedNotificationData
- PullMultipleNotificationsResponse
- ReplaceSlotsRequest
- ReplaceSlotsRequestAddressServices
- ReplaceSlotsRequestSlots
- Service
- Services
- ServicesScopes
- Slot
- SlotBookedNotification
- SlotBookedNotificationData
- SlotBookingNotification
- SlotBookingNotificationData
- Slots
- SlotsScopes
- Specialization
- Specializations
- UpdateAddressServiceRequest
- UpdateOrCreateAddressInsuranceProviderRequest
- UpdateOrCreateAddressInsuranceProviderRequestInsurancePlans
- VisitBookingRequestNotification
