docplanner / integrations-api-sdk-php
DocPlanner integration API SDK
Requires
- php: >=5.5
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^6.2|^7.0
- dev-develop
- v1.0.40
- v1.0.39
- v1.0.37
- v1.0.36
- v1.0.35
- v1.0.34
- v1.0.33
- v1.0.32
- v1.0.30
- v1.0.29
- v1.0.28
- v1.0.27
- v1.0.26
- v1.0.25
- v1.0.24
- v1.0.23
- v1.0.22
- v1.0.20.1
- v1.0.20
- v1.0.18
- v1.0.17
- v1.0.13
- v1.0.12.1
- v1.0.12
- v1.0.11
- v1.0.9
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.4
- v1.0.3
- v1.0.1
- v1.0.0
- dev-fix/using-upper-versions-of-the-artifact-actions
- dev-IN-633/guzzle-compatibility-issue
This package is auto-updated.
Last update: 2024-10-30 00:16:35 UTC
README
- PHP 5.5 and later
- Guzzle 6.2 or later
Installation & Usage
Composer
To install the bindings via Composer, run composer require docplanner/integrations-api-sdk-php
.
Manual Installation
Download the files and include autoload.php
:
require_once('/path/to/DocPlanner/Client/vendor/autoload.php');
Getting Started
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; } ?>
Authorization
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);
Documentation for API Endpoints
All URIs are relative to https://www.{domain}/api/v3/integration
Documentation For Models
- 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