PHP SDK for the GoneBusy REST API
We have a Sandbox environment to play with!
Just use sandbox.gonebusy.com instead of where you see beta.gonebusy.com referenced, including where to create an account to retrieve your API Key.
The Sandbox environment is completely separate from the Live site - that includes meaning your Sandbox API Key will not work in the Live environment.
Unit tests in this SDK can be run using PHPUnit. The test cases are located in the test/Controllers/ dir.
Make sure you've installed the dependencies using composer including the require-dev
dependencies (you may have already done this with composer install
or composer update
).
Run vendor/bin/phpunit
from command line to execute the test suite.
See https://phpunit.de/manual/current/en/textui.html for info on test output format as well as more command-line options.
The generated code has dependencies over external libraries like UniRest. These dependencies are defined in the composer.json
file that comes with the SDK.
To resolve these dependencies, we use the Composer package manager which requires PHP greater than 5.3.2 installed in your system.
Visit https://getcomposer.org/download/ to download the installer file for Composer and run it in your system.
Open command prompt and type composer --version
. This should display the current version of the Composer installed if the installation was successful.
From this folder, run the command composer install
. This should install all of the required dependencies and create the vendor
directory in your project directory.
[For Windows Users Only] Configuring CURL Certificate Path in php.ini
CURL used to include a list of accepted CAs, but no longer bundles ANY CA certs. So by default it will reject all SSL certificates as unverifiable. You will have to get your CA's cert and point curl at it. The steps are as follows:
Download the certificate bundle (.pem file) from https://curl.haxx.se/docs/caextract.html on to your system.
Add curl.cainfo = "PATH_TO/cacert.pem" to your php.ini file located in your php installation. “PATH_TO” must be an absolute path containing the .pem file.
[curl]
; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
; curl.cainfo =
The following section explains how to use the Gonebusy library in a new project.
1. Open project in an IDE
Open an IDE for PHP.
Open this folder as a PHP project.
2. Add a new project folder
Create a new directory. Name the directory as "my-project".
Add a PHP file to this project. For exampe name it "trySDK.php".
Depending on your project setup, you might need to include composer's autoloader in your PHP code to enable auto loading of classes"
require_once "../vendor/autoload.php " ;
Note: the ../
path assumes you'll run trySDK.php directly from my-project/ .
After this you can add code to initialize the client library and acquire the instance of a Controller class. Sample code to initialize the client library and using controller methods is given in the subsequent sections.
Summary of GoneBusy objects (more info on the Developer Portal ):
A User is required to perform operations.
A Resource (WHO) performs Services and is needed for all scheduling operations.
Each User is assigned a default Resource (her/himself) automatically.
A Service (WHAT) is performed by Resources according to a Schedule.
Services are assigned a Pricing Model .
Services can be assigned a Category as well.
A Schedule (WHEN) defines when a Service is performed by a Resource. Pieces of a Schedule are called Time Windows .
Finally, a Booking is placed (at a particular Time Window) in a Schedule, linking it to a Resource-Service combo.
A Search of users and services can be performed.
php my-project/trySDK.php
Initialization/Authentication
In order to setup authentication and initialization of the API client, you need the following information.
Parameter
Description
authorization
Set Authorization to "Token your API key "
API client can be initialized as following.
// Configuration parameters and credentials
$ authorization = "Token <your API key> " ; // Set Authorization to "Token <your API key>"
$ client = new GonebusyLib \GonebusyClient ($ authorization );
BookingsController
The singleton instance of the BookingsController
class can be accessed from the API Client.
$ bookings = $ client ->getBookings ();
getBookings
Return list of Bookings.
function getBookings(
$ authorization ,
$ page = 1 ,
$ perPage = 10 ,
$ states = null ,
$ userId = null )
Parameter
Tags
Description
authorization
Required
A valid API key, in the format 'Token API_KEY'
page
Optional
DefaultValue
Page offset to fetch.
perPage
Optional
DefaultValue
Number of results to return per page.
states
Optional
Comma-separated list of Booking states to retrieve only Bookings in those states. Leave blank to retrieve all Bookings.
userId
Optional
Retrieve Bookings owned only by this User Id. You must be authorized to manage this User Id.
$ authorization = 'Authorization ' ;
$ page = 1 ;
$ perPage = 10 ;
$ states = 'states ' ;
$ userId = 131 ;
$ result = $ bookings ->getBookings ($ authorization , $ page , $ perPage , $ states , $ userId );
Error Code
Error Description
401
Unauthorized/Missing Token
403
Forbidden
404
Not Found
0
Unexpected error
createBooking
Create a Booking with params
function createBooking(
$ authorization ,
$ createBookingBody = null )
Parameter
Tags
Description
authorization
Required
A valid API key, in the format 'Token API_KEY'
createBookingBody
Optional
the content of the request
$ authorization = 'Authorization ' ;
$ createBookingBody = new CreateBookingBody ();
$ result = $ bookings ->createBooking ($ authorization , $ createBookingBody );
Error Code
Error Description
400
Bad Request
401
Unauthorized/Missing Token
403
Forbidden
422
Unprocessable Entity
0
Unexpected error
getBookingById
Return a Booking by id.
function getBookingById(
$ authorization ,
$ id )
Parameter
Tags
Description
authorization
Required
A valid API key, in the format 'Token API_KEY'
id
Required
TODO: Add a parameter description
$ authorization = 'Authorization ' ;
$ id = 'id ' ;
$ result = $ bookings ->getBookingById ($ authorization , $ id );
Error Code
Error Description
400
Bad Request
401
Unauthorized/Missing Token
403
Forbidden
404
Not Found
0
Unexpected error
updateBookingById
Update a Booking by id
function updateBookingById(
$ authorization ,
$ id )
Parameter
Tags
Description
authorization
Required
A valid API key, in the format 'Token API_KEY'
id
Required
TODO: Add a parameter description
$ authorization = 'Authorization ' ;
$ id = 'id ' ;
$ result = $ bookings ->updateBookingById ($ authorization , $ id );
Error Code
Error Description
400
Bad Request
401
Unauthorized/Missing Token
403
Forbidden
404
Not Found
422
Unprocessable Entity
0
Unexpected error
cancelBookingById
Cancel a Booking by id
function cancelBookingById(
$ authorization ,
$ id )
Parameter
Tags
Description
authorization
Required
A valid API key, in the format 'Token API_KEY'
id
Required
TODO: Add a parameter description
$ authorization = 'Authorization ' ;
$ id = 'id ' ;
$ result = $ bookings ->cancelBookingById ($ authorization , $ id );
Error Code
Error Description
400
Bad Request
401
Unauthorized/Missing Token
403
Forbidden
404
Not Found
0
Unexpected error
Back to List of Controllers
CategoriesController
The singleton instance of the CategoriesController
class can be accessed from the API Client.
$ categories = $ client ->getCategories ();
getCategories
Return list of Categories.
function getCategories(
$ authorization ,
$ page = 1 ,
$ perPage = 10 ,
$ userId = null )
Parameter
Tags
Description
authorization
Required
A valid API key, in the format 'Token API_KEY'
page
Optional
DefaultValue
Page offset to fetch.
perPage
Optional
DefaultValue
Number of results to return per page.
userId
Optional
Retrieve Categories of all services provided by this User Id. You must be authorized to manage this User Id.
$ authorization = 'Authorization ' ;
$ page = 1 ;
$ perPage = 10 ;
$ userId = 131 ;
$ result = $ categories ->getCategories ($ authorization , $ page , $ perPage , $ userId );
Error Code
Error Description
400
Bad Request
401
Unauthorized/Missing Token
403
Forbidden
0
Unexpected error
createCategory
Create a Category
function createCategory(
$ authorization ,
$ createCategoryBody = null )
Parameter
Tags
Description
authorization
Required
A valid API key, in the format 'Token API_KEY'
createCategoryBody
Optional
the content of the request
$ authorization = 'Authorization ' ;
$ createCategoryBody = new CreateCategoryBody ();
$ result = $ categories ->createCategory ($ authorization , $ createCategoryBody );
Error Code
Error Description
400
Bad Request
401
Unauthorized/Missing Token
403
Forbidden
422
Unprocessable Entity
0
Unexpected error
getCategoryById
Return a Category by id.
function getCategoryById(
$ authorization ,
$ id )
Parameter
Tags
Description
authorization
Required
A valid API key, in the format 'Token API_KEY'
id
Required
TODO: Add a parameter description
$ authorization = 'Authorization ' ;
$ id = 'id ' ;
$ result = $ categories ->getCategoryById ($ authorization , $ id );
Error Code
Error Description
400
Bad Request
401
Unauthorized/Missing Token
403
Forbidden
404
Not Found
0
Unexpected error
Back to List of Controllers
PricingModelsController
The singleton instance of the PricingModelsController
class can be accessed from the API Client.
$ pricingModels = $ client ->getPricingModels ();
getPricingModels
Return list of PricingModels.
function getPricingModels(
$ authorization ,
$ page = 1 ,
$ perPage = 10 ,
$ userId = null )
Parameter
Tags
Description
authorization
Required
A valid API key, in the format 'Token API_KEY'
page
Optional
DefaultValue
Page offset to fetch.
perPage
Optional
DefaultValue
Number of results to return per page.
userId
Optional
Retrieve PricingModels owned only by this User Id. You must be authorized to manage this User Id.
$ authorization = 'Authorization ' ;
$ page = 1 ;
$ perPage = 10 ;
$ userId = 131 ;
$ result = $ pricingModels ->getPricingModels ($ authorization , $ page , $ perPage , $ userId );
Error Code
Error Description
401
Unauthorized/Missing Token
403
Forbidden
404
Not Found
0
Unexpected error
createPricingModel
Create a PricingModel with params
function createPricingModel(
$ authorization ,
$ createPricingModelBody = null )
Parameter
Tags
Description
authorization
Required
A valid API key, in the format 'Token API_KEY'
createPricingModelBody
Optional
the content of the request
$ authorization = 'Authorization ' ;
$ createPricingModelBody = new CreatePricingModelBody ();
$ result = $ pricingModels ->createPricingModel ($ authorization , $ createPricingModelBody );
Error Code
Error Description
400
Bad Request
401
Unauthorized/Missing Token
403
Forbidden
422
Unprocessable Entity
0
Unexpected error
getPricingModelById
Return a PricingModel by id.
function getPricingModelById(
$ authorization ,
$ id )
Parameter
Tags
Description
authorization
Required
A valid API key, in the format 'Token API_KEY'
id
Required
TODO: Add a parameter description
$ authorization = 'Authorization ' ;
$ id = 'id ' ;
$ result = $ pricingModels ->getPricingModelById ($ authorization , $ id );
Error Code
Error Description
400
Bad Request
401
Unauthorized/Missing Token
403
Forbidden
404
Not Found
0
Unexpected error
updatePricingModelById
Update a PricingModel by id, with params
function updatePricingModelById(
$ authorization ,
$ id ,
$ updatePricingModelByIdBody = null )
Parameter
Tags
Description
authorization
Required
A valid API key, in the format 'Token API_KEY'
id
Required
TODO: Add a parameter description
updatePricingModelByIdBody
Optional
the content of the request
$ authorization = 'Authorization ' ;
$ id = 'id ' ;
$ updatePricingModelByIdBody = new UpdatePricingModelByIdBody ();
$ result = $ pricingModels ->updatePricingModelById ($ authorization , $ id , $ updatePricingModelByIdBody );
Error Code
Error Description
400
Bad Request
401
Unauthorized/Missing Token
403
Forbidden
404
Not Found
422
Unprocessable Entity
0
Unexpected error
Back to List of Controllers
ResourcesController
The singleton instance of the ResourcesController
class can be accessed from the API Client.
$ resources = $ client ->getResources ();
getResources
Return list of Resources.
function getResources(
$ authorization ,
$ page = 1 ,
$ perPage = 10 ,
$ userId = null )
Parameter
Tags
Description
authorization
Required
A valid API key, in the format 'Token API_KEY'
page
Optional
DefaultValue
Page offset to fetch.
perPage
Optional
DefaultValue
Number of results to return per page.
userId
Optional
Retrieve Resources owned only by this User Id. You must be authorized to manage this User Id.
$ authorization = 'Authorization ' ;
$ page = 1 ;
$ perPage = 10 ;
$ userId = 89 ;
$ result = $ resources ->getResources ($ authorization , $ page , $ perPage , $ userId );
Error Code
Error Description
401
Unauthorized/Missing Token
403
Forbidden
404
Not Found
0
Unexpected error
createResource
Create a Resource with params
function createResource(
$ authorization ,
$ createResourceBody = null )
Parameter
Tags
Description
authorization
Required
A valid API key, in the format 'Token API_KEY'
createResourceBody
Optional
the content of the request
$ authorization = 'Authorization ' ;
$ createResourceBody = new CreateResourceBody ();
$ result = $ resources ->createResource ($ authorization , $ createResourceBody );
Error Code
Error Description
400
Bad Request
401
Unauthorized/Missing Token
403
Forbidden
422
Unprocessable Entity
0
Unexpected error
getResourceThings
Return all Resource Things.
function getResourceThings(
$ authorization ,
$ page = 1 ,
$ perPage = 10 )
Parameter
Tags
Description
authorization
Required
A valid API key, in the format 'Token API_KEY'
page
Optional
DefaultValue
Page offset to fetch.
perPage
Optional
DefaultValue
Number of results to return per page.
$ authorization = 'Authorization ' ;
$ page = 1 ;
$ perPage = 10 ;
$ result = $ resources ->getResourceThings ($ authorization , $ page , $ perPage );
Error Code
Error Description
400
Bad Request
401
Unauthorized/Missing Token
403
Forbidden
0
Unexpected error
getResourceById
Return a Resource by id.
function getResourceById(
$ authorization ,
$ id )
Parameter
Tags
Description
authorization
Required
A valid API key, in the format 'Token API_KEY'
id
Required
TODO: Add a parameter description
$ authorization = 'Authorization ' ;
$ id = 'id ' ;
$ result = $ resources ->getResourceById ($ authorization , $ id );
Error Code
Error Description
400
Bad Request
401
Unauthorized/Missing Token
403
Forbidden
404
Not Found
0
Unexpected error
updateResourceById
Update a Resource by id, with params
function updateResourceById(
$ authorization ,
$ id ,
$ updateResourceByIdBody = null )
Parameter
Tags
Description
authorization
Required
A valid API key, in the format 'Token API_KEY'
id
Required
TODO: Add a parameter description
updateResourceByIdBody
Optional
the content of the request
$ authorization = 'Authorization ' ;
$ id = 'id ' ;
$ updateResourceByIdBody = new UpdateResourceByIdBody ();
$ result = $ resources ->updateResourceById ($ authorization , $ id , $ updateResourceByIdBody );
Error Code
Error Description
400
Bad Request
401
Unauthorized/Missing Token
403
Forbidden
404
Not Found
422
Unprocessable Entity
0
Unexpected error
deleteResourceById
Delete a Resource by id
function deleteResourceById(
$ authorization ,
$ id )
Parameter
Tags
Description
authorization
Required
A valid API key, in the format 'Token API_KEY'
id
Required
TODO: Add a parameter description
$ authorization = 'Authorization ' ;
$ id = 'id ' ;
$ result = $ resources ->deleteResourceById ($ authorization , $ id );
Error Code
Error Description
400
Bad Request
401
Unauthorized/Missing Token
403
Forbidden
404
Not Found
0
Unexpected error
Back to List of Controllers
SchedulesController
The singleton instance of the SchedulesController
class can be accessed from the API Client.
$ schedules = $ client ->getSchedules ();
getSchedules
Return all Schedules that your account has access to. Includes Schedules for your own User as well as any Users for which you are the Account Manager.
function getSchedules(
$ authorization ,
$ page = 1 ,
$ perPage = 10 ,
$ userId = null )
Parameter
Tags
Description
authorization
Required
A valid API key, in the format 'Token API_KEY'
page
Optional
DefaultValue
Page offset to fetch.
perPage
Optional
DefaultValue
Number of results to return per page.
userId
Optional
Retrieve Schedules owned only by this User Id. You must be authorized to manage this User Id.
$ authorization = 'Authorization ' ;
$ page = 1 ;
$ perPage = 10 ;
$ userId = 89 ;
$ result = $ schedules ->getSchedules ($ authorization , $ page , $ perPage , $ userId );
Error Code
Error Description
400
Bad Request
401
Unauthorized/Missing Token
403
Forbidden
404
Not Found
0
Unexpected error
createSchedule
Create a Schedule with params.
function createSchedule(
$ authorization ,
$ createScheduleBody = null )
Parameter
Tags
Description
authorization
Required
A valid API key, in the format 'Token API_KEY'
createScheduleBody
Optional
the content of the request
$ authorization = 'Authorization ' ;
$ createScheduleBody = new CreateScheduleBody ();
$ result = $ schedules ->createSchedule ($ authorization , $ createScheduleBody );
Error Code
Error Description
400
Bad Request
401
Unauthorized/Missing Token
403
Forbidden
404
Not Found
422
Unprocessable Entity
0
Unexpected error
getScheduleById
Return a Schedule by id.
function getScheduleById(
$ authorization ,
$ id )
Parameter
Tags
Description
authorization
Required
A valid API key, in the format 'Token API_KEY'
id
Required
TODO: Add a parameter description
$ authorization = 'Authorization ' ;
$ id = 'id ' ;
$ result = $ schedules ->getScheduleById ($ authorization , $ id );
Error Code
Error Description
400
Bad Request
401
Unauthorized/Missing Token
403
Forbidden
404
Not Found
410
Gone
0
Unexpected error
deleteScheduleById
Delete a Schedule
function deleteScheduleById(
$ authorization ,
$ id )
Parameter
Tags
Description
authorization
Required
A valid API key, in the format 'Token API_KEY'
id
Required
TODO: Add a parameter description
$ authorization = 'Authorization ' ;
$ id = 'id ' ;
$ result = $ schedules ->deleteScheduleById ($ authorization , $ id );
Error Code
Error Description
400
Bad Request
401
Unauthorized/Missing Token
403
Forbidden
404
Not Found
0
Unexpected error
createScheduleTimeWindow
Add a TimeWindow to a Schedule.
function createScheduleTimeWindow(
$ authorization ,
$ id ,
$ createScheduleTimeWindowBody = null )
Parameter
Tags
Description
authorization
Required
A valid API key, in the format 'Token API_KEY'
id
Required
TODO: Add a parameter description
createScheduleTimeWindowBody
Optional
the content of the request
$ authorization = 'Authorization ' ;
$ id = 'id ' ;
$ createScheduleTimeWindowBody = new CreateScheduleTimeWindowBody ();
$ result = $ schedules ->createScheduleTimeWindow ($ authorization , $ id , $ createScheduleTimeWindowBody );
Error Code
Error Description
400
Bad Request
401
Unauthorized/Missing Token
403
Forbidden
404
Not Found
422
Unprocessable Entity
0
Unexpected error
updateScheduleTimeWindowById
Update a TimeWindow for a Schedule.
function updateScheduleTimeWindowById(
$ authorization ,
$ id ,
$ timeWindowId ,
$ updateScheduleTimeWindowByIdBody = null )
Parameter
Tags
Description
authorization
Required
A valid API key, in the format 'Token API_KEY'
id
Required
TODO: Add a parameter description
timeWindowId
Required
TODO: Add a parameter description
updateScheduleTimeWindowByIdBody
Optional
the content of the request
$ authorization = 'Authorization ' ;
$ id = 'id ' ;
$ timeWindowId = 'time_window_id ' ;
$ updateScheduleTimeWindowByIdBody = new UpdateScheduleTimeWindowByIdBody ();
$ result = $ schedules ->updateScheduleTimeWindowById ($ authorization , $ id , $ timeWindowId , $ updateScheduleTimeWindowByIdBody );
Error Code
Error Description
400
Bad Request
401
Unauthorized/Missing Token
403
Forbidden
404
Not Found
422
Unprocessable Entity
0
Unexpected error
deleteScheduleTimeWindowById
Delete a TimeWindow from a Schedule
function deleteScheduleTimeWindowById(
$ authorization ,
$ id ,
$ timeWindowId )
Parameter
Tags
Description
authorization
Required
A valid API key, in the format 'Token API_KEY'
id
Required
TODO: Add a parameter description
timeWindowId
Required
TODO: Add a parameter description
$ authorization = 'Authorization ' ;
$ id = 'id ' ;
$ timeWindowId = 'time_window_id ' ;
$ result = $ schedules ->deleteScheduleTimeWindowById ($ authorization , $ id , $ timeWindowId );
Error Code
Error Description
400
Bad Request
401
Unauthorized/Missing Token
403
Forbidden
404
Not Found
0
Unexpected error
Back to List of Controllers
SearchController
The singleton instance of the SearchController
class can be accessed from the API Client.
$ search = $ client ->getSearch ();
searchQuery
Search for Providers and Provided Services.
function searchQuery(
$ authorization ,
$ query )
Parameter
Tags
Description
authorization
Required
A valid API key, in the format 'Token API_KEY'
query
Required
TODO: Add a parameter description
$ authorization = 'Authorization ' ;
$ query = 'query ' ;
$ result = $ search ->searchQuery ($ authorization , $ query );
Error Code
Error Description
400
Bad Request
401
Unauthorized/Missing Token
0
Unexpected error
Back to List of Controllers
ServicesController
The singleton instance of the ServicesController
class can be accessed from the API Client.
$ services = $ client ->getServices ();
getServices
Return list of Services.
function getServices(
$ authorization ,
$ page = 1 ,
$ perPage = 10 ,
$ userId = null )
Parameter
Tags
Description
authorization
Required
A valid API key, in the format 'Token API_KEY'
page
Optional
DefaultValue
Page offset to fetch.
perPage
Optional
DefaultValue
Number of results to return per page.
userId
Optional
Retrieve Services provided by the User specified by Id. You must be authorized to manage this User Id.
$ authorization = 'Authorization ' ;
$ page = 1 ;
$ perPage = 10 ;
$ userId = 89 ;
$ result = $ services ->getServices ($ authorization , $ page , $ perPage , $ userId );
Error Code
Error Description
401
Unauthorized/Missing Token
403
Forbidden
404
Not Found
0
Unexpected error
createService
Create a Service with params.
function createService(
$ authorization ,
$ createServiceBody = null )
Parameter
Tags
Description
authorization
Required
A valid API key, in the format 'Token API_KEY'
createServiceBody
Optional
the content of the request
$ authorization = 'Authorization ' ;
$ createServiceBody = new CreateServiceBody ();
$ result = $ services ->createService ($ authorization , $ createServiceBody );
Error Code
Error Description
400
Bad Request
401
Unauthorized/Missing Token
403
Forbidden
404
Not Found
422
Unprocessable Entity
0
Unexpected error
getServiceAvailableSlotsById
Return available times for a Service.
function getServiceAvailableSlotsById(
$ authorization ,
$ id ,
$ date = null ,
$ endDate = null ,
$ startDate = null )
Parameter
Tags
Description
authorization
Required
A valid API key, in the format 'Token API_KEY'
id
Required
TODO: Add a parameter description
date
Optional
Date to check for availability. Either this field or a date range employing start_date and end_date must be supplied. If date is provided, start_date/end_date are ignored. Several formats are supported: '2014-10-31', 'October 31, 2014'.
endDate
Optional
End Date of a range to check for availability. If supplied, date must not be supplied and start_date must be supplied. Several formats are supported: '2014-10-31', 'October 31, 2014'.
startDate
Optional
Start Date of a range to check for availability. If supplied, date must not be supplied and end_date must be supplied. Several formats are supported: '2014-10-31', 'October 31, 2014'.
$ authorization = 'Authorization ' ;
$ id = 'id ' ;
$ date = date ("D M d, Y G:i " );
$ endDate = date ("D M d, Y G:i " );
$ startDate = date ("D M d, Y G:i " );
$ result = $ services ->getServiceAvailableSlotsById ($ authorization , $ id , $ date , $ endDate , $ startDate );
Error Code
Error Description
400
Bad Request
401
Unauthorized/Missing Token
403
Forbidden
404
Not Found
0
Unexpected error
getServiceById
Return a Service by id.
function getServiceById(
$ authorization ,
$ id )
Parameter
Tags
Description
authorization
Required
A valid API key, in the format 'Token API_KEY'
id
Required
TODO: Add a parameter description
$ authorization = 'Authorization ' ;
$ id = 'id ' ;
$ result = $ services ->getServiceById ($ authorization , $ id );
Error Code
Error Description
400
Bad Request
401
Unauthorized/Missing Token
403
Forbidden
404
Not Found
0
Unexpected error
updateServiceById
Update a Service with params.
function updateServiceById(
$ authorization ,
$ id ,
$ updateServiceByIdBody = null )
Parameter
Tags
Description
authorization
Required
A valid API key, in the format 'Token API_KEY'
id
Required
TODO: Add a parameter description
updateServiceByIdBody
Optional
the content of the request
$ authorization = 'Authorization ' ;
$ id = 'id ' ;
$ updateServiceByIdBody = new UpdateServiceByIdBody ();
$ result = $ services ->updateServiceById ($ authorization , $ id , $ updateServiceByIdBody );
Error Code
Error Description
400
Bad Request
401
Unauthorized/Missing Token
403
Forbidden
404
Not Found
422
Unprocessable Entity
0
Unexpected error
deleteServiceById
Delete a Service by id
function deleteServiceById(
$ authorization ,
$ id )
Parameter
Tags
Description
authorization
Required
A valid API key, in the format 'Token API_KEY'
id
Required
TODO: Add a parameter description
$ authorization = 'Authorization ' ;
$ id = 'id ' ;
$ result = $ services ->deleteServiceById ($ authorization , $ id );
Error Code
Error Description
400
Bad Request
401
Unauthorized/Missing Token
403
Forbidden
404
Not Found
0
Unexpected error
Back to List of Controllers
UsersController
The singleton instance of the UsersController
class can be accessed from the API Client.
$ users = $ client ->getUsers ();
getUsers
Return all Users that your account has access to. Includes your own User as well as any Users for which you are the Account Manager.
function getUsers(
$ authorization ,
$ page = 1 ,
$ perPage = 10 )
Parameter
Tags
Description
authorization
Required
A valid API key, in the format 'Token API_KEY'
page
Optional
DefaultValue
Page offset to fetch.
perPage
Optional
DefaultValue
Number of results to return per page.
$ authorization = 'Authorization ' ;
$ page = 1 ;
$ perPage = 10 ;
$ result = $ users ->getUsers ($ authorization , $ page , $ perPage );
Error Code
Error Description
400
Bad Request
401
Unauthorized/Missing Token
403
Forbidden
0
Unexpected error
createUser
Create a User
function createUser(
$ authorization ,
$ createUserBody = null )
Parameter
Tags
Description
authorization
Required
A valid API key, in the format 'Token API_KEY'
createUserBody
Optional
the content of the request
$ authorization = 'Authorization ' ;
$ createUserBody = new CreateUserBody ();
$ result = $ users ->createUser ($ authorization , $ createUserBody );
Error Code
Error Description
400
Bad Request
401
Unauthorized/Missing Token
403
Forbidden
422
Unprocessable Entity
0
Unexpected error
getUserById
Return a User by id.
function getUserById(
$ authorization ,
$ id )
Parameter
Tags
Description
authorization
Required
A valid API key, in the format 'Token API_KEY'
id
Required
TODO: Add a parameter description
$ authorization = 'Authorization ' ;
$ id = 'id ' ;
$ result = $ users ->getUserById ($ authorization , $ id );
Error Code
Error Description
400
Bad Request
401
Unauthorized/Missing Token
403
Forbidden
404
Not Found
0
Unexpected error
updateUserById
Update a User by id, with params.
function updateUserById(
$ authorization ,
$ id ,
$ updateUserByIdBody = null )
Parameter
Tags
Description
authorization
Required
A valid API key, in the format 'Token API_KEY'
id
Required
TODO: Add a parameter description
updateUserByIdBody
Optional
the content of the request
$ authorization = 'Authorization ' ;
$ id = 'id ' ;
$ updateUserByIdBody = new UpdateUserByIdBody ();
$ result = $ users ->updateUserById ($ authorization , $ id , $ updateUserByIdBody );
Error Code
Error Description
400
Bad Request
401
Unauthorized/Missing Token
403
Forbidden
404
Not Found
422
Unprocessable Entity
0
Unexpected error
Back to List of Controllers