cesarcopi / gonebusy-php-client

A PHP SDK for accessing the GoneBusy API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

#Getting started

Sandbox

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.

How to Build

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.

  • Using command line, navigate to the directory containing the generated files (including composer.json) for the SDK.
  • Run the command composer install. This should install all the required dependencies and create the vendor directory in your project directory.

Building SDK - Step 1

[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:

  1. Download the certificate bundle (.pem file) from https://curl.haxx.se/docs/caextract.html on to your system.
  2. 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 =

How to Use

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 like PhpStorm. The basic workflow presented here is also applicable if you prefer using a different editor or IDE.

Open project in PHPStorm - Step 1

Click on Open in PhpStorm to browse to your generated SDK directory and then click OK.

Open project in PHPStorm - Step 2

2. Add a new Test Project

Create a new directory by right clicking on the solution name as shown below:

Add a new project in PHPStorm - Step 1

Name the directory as "test"

Add a new project in PHPStorm - Step 2

Add a PHP file to this project

Add a new project in PHPStorm - Step 3

Name it "testSDK"

Add a new project in PHPStorm - Step 4

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";

It is important that the path inside require_once correctly points to the file autoload.php inside the vendor directory created during dependency installations.

Add a new project in PHPStorm - Step 4

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.

3. Run the Test Project

To run your project you must set the Interpreter for your project. Interpreter is the PHP engine installed on your computer.

Open Settings from File menu.

Run Test Project - Step 1

Select PHP from within Languages & Frameworks

Run Test Project - Step 2

Browse for Interpreters near the Interpreter option and choose your interpreter.

Run Test Project - Step 3

Once the interpreter is selected, click OK

Run Test Project - Step 4

To run your project, right click on your PHP file inside your Test project and click on Run

Run Test Project - Step 5

How to Test

Unit tests in this SDK can be run using PHPUnit.

  1. First install the dependencies using composer including the require-dev dependencies.
  2. Run vendor\bin\phpunit --verbose from commandline to execute tests. If you have installed PHPUnit globally, run tests using phpunit --verbose instead.

You can change the PHPUnit test configuration in the phpunit.xml file.

Initialization

Authentication and

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 GonebusyClient($authorization);

Class Reference

List of Controllers

Class: BookingsController

Get singleton instance

The singleton instance of the BookingsController class can be accessed from the API Client.

$bookings = $client->getBookings();

Method: createBooking

Create a Booking with params

function createBooking($options)

Parameters

Parameter Tags Description
authorization Required A valid API key, in the format 'Token API_KEY'
createBookingBody Required the content of the request

Example Usage

$authorization = 'Authorization';
$collect['authorization'] = $authorization;

$createBookingBody = new CreateBookingBody();
$collect['createBookingBody'] = $createBookingBody;


$result = $bookings->createBooking($collect);

Errors

Error Code Error Description
400 Bad Request
401 Unauthorized/Missing Token
403 Forbidden
422 Unprocessable Entity
500 Unexpected error

Method: getBookings

Return list of Bookings.

function getBookings($options)

Parameters

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.

Example Usage

$authorization = 'Authorization';
$collect['authorization'] = $authorization;

$page = 1;
$collect['page'] = $page;

$perPage = 10;
$collect['perPage'] = $perPage;

$states = 'states';
$collect['states'] = $states;

$userId = 172;
$collect['userId'] = $userId;


$result = $bookings->getBookings($collect);

Errors

Error Code Error Description
401 Unauthorized/Missing Token
403 Forbidden
404 Not Found
500 Unexpected error

Method: cancelBookingById

Cancel a Booking by id

function cancelBookingById($options)

Parameters

Parameter Tags Description
authorization Required A valid API key, in the format 'Token API_KEY'
id Required TODO: Add a parameter description

Example Usage

$authorization = 'Authorization';
$collect['authorization'] = $authorization;

$id = 'id';
$collect['id'] = $id;


$result = $bookings->cancelBookingById($collect);

Errors

Error Code Error Description
400 Bad Request
401 Unauthorized/Missing Token
403 Forbidden
404 Not Found
500 Unexpected error

Method: updateBookingById

Update a Booking by id

function updateBookingById($options)

Parameters

Parameter Tags Description
authorization Required A valid API key, in the format 'Token API_KEY'
id Required TODO: Add a parameter description

Example Usage

$authorization = 'Authorization';
$collect['authorization'] = $authorization;

$id = 'id';
$collect['id'] = $id;


$result = $bookings->updateBookingById($collect);

Errors

Error Code Error Description
400 Bad Request
401 Unauthorized/Missing Token
403 Forbidden
404 Not Found
422 Unprocessable Entity
500 Unexpected error

Method: getBookingById

Return a Booking by id.

function getBookingById($options)

Parameters

Parameter Tags Description
authorization Required A valid API key, in the format 'Token API_KEY'
id Required TODO: Add a parameter description

Example Usage

$authorization = 'Authorization';
$collect['authorization'] = $authorization;

$id = 'id';
$collect['id'] = $id;


$result = $bookings->getBookingById($collect);

Errors

Error Code Error Description
400 Bad Request
401 Unauthorized/Missing Token
403 Forbidden
404 Not Found
500 Unexpected error

Back to List of Controllers

Class: UsersController

Get singleton instance

The singleton instance of the UsersController class can be accessed from the API Client.

$users = $client->getUsers();

Method: updateUserById

Update a User by id, with params.

function updateUserById($options)

Parameters

Parameter Tags Description
authorization Required A valid API key, in the format 'Token API_KEY'
id Required TODO: Add a parameter description
updateUserByIdBody Required the content of the request

Example Usage

$authorization = 'Authorization';
$collect['authorization'] = $authorization;

$id = 'id';
$collect['id'] = $id;

$updateUserByIdBody = new UpdateUserByIdBody();
$collect['updateUserByIdBody'] = $updateUserByIdBody;


$result = $users->updateUserById($collect);

Errors

Error Code Error Description
400 Bad Request
401 Unauthorized/Missing Token
403 Forbidden
404 Not Found
422 Unprocessable Entity
500 Unexpected error

Method: getUserById

Return a User by id.

function getUserById($options)

Parameters

Parameter Tags Description
authorization Required A valid API key, in the format 'Token API_KEY'
id Required TODO: Add a parameter description

Example Usage

$authorization = 'Authorization';
$collect['authorization'] = $authorization;

$id = 'id';
$collect['id'] = $id;


$result = $users->getUserById($collect);

Errors

Error Code Error Description
400 Bad Request
401 Unauthorized/Missing Token
403 Forbidden
404 Not Found
500 Unexpected error

Method: getUsersPros

Return list of active Pro Users.

function getUsersPros($authorization)

Parameters

Parameter Tags Description
authorization Required A valid API key, in the format 'Token API_KEY'

Example Usage

$authorization = 'Authorization';

$result = $users->getUsersPros($authorization);

Errors

Error Code Error Description
400 Bad Request
401 Unauthorized/Missing Token
403 Forbidden
500 Unexpected error

Method: createUser

Create a User

function createUser($options)

Parameters

Parameter Tags Description
authorization Required A valid API key, in the format 'Token API_KEY'
createUserBody Required the content of the request

Example Usage

$authorization = 'Authorization';
$collect['authorization'] = $authorization;

$createUserBody = new CreateUserBody();
$collect['createUserBody'] = $createUserBody;


$result = $users->createUser($collect);

Errors

Error Code Error Description
400 Bad Request
401 Unauthorized/Missing Token
403 Forbidden
422 Unprocessable Entity
500 Unexpected error

Method: 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($options)

Parameters

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.

Example Usage

$authorization = 'Authorization';
$collect['authorization'] = $authorization;

$page = 1;
$collect['page'] = $page;

$perPage = 10;
$collect['perPage'] = $perPage;


$result = $users->getUsers($collect);

Errors

Error Code Error Description
400 Bad Request
401 Unauthorized/Missing Token
403 Forbidden
500 Unexpected error

Back to List of Controllers

Class: ServicesController

Get singleton instance

The singleton instance of the ServicesController class can be accessed from the API Client.

$services = $client->getServices();

Method: deleteServiceById

Delete a Service by id

function deleteServiceById($options)

Parameters

Parameter Tags Description
authorization Required A valid API key, in the format 'Token API_KEY'
id Required TODO: Add a parameter description

Example Usage

$authorization = 'Authorization';
$collect['authorization'] = $authorization;

$id = 'id';
$collect['id'] = $id;


$result = $services->deleteServiceById($collect);

Errors

Error Code Error Description
400 Bad Request
401 Unauthorized/Missing Token
403 Forbidden
404 Not Found
500 Unexpected error

Method: updateServiceById

Update a Service with params.

function updateServiceById($options)

Parameters

Parameter Tags Description
authorization Required A valid API key, in the format 'Token API_KEY'
id Required TODO: Add a parameter description
updateServiceByIdBody Required the content of the request

Example Usage

$authorization = 'Authorization';
$collect['authorization'] = $authorization;

$id = 'id';
$collect['id'] = $id;

$updateServiceByIdBody = new UpdateServiceByIdBody();
$collect['updateServiceByIdBody'] = $updateServiceByIdBody;


$result = $services->updateServiceById($collect);

Errors

Error Code Error Description
400 Bad Request
401 Unauthorized/Missing Token
403 Forbidden
404 Not Found
422 Unprocessable Entity
500 Unexpected error

Method: getServiceById

Return a Service by id.

function getServiceById($options)

Parameters

Parameter Tags Description
authorization Required A valid API key, in the format 'Token API_KEY'
id Required TODO: Add a parameter description

Example Usage

$authorization = 'Authorization';
$collect['authorization'] = $authorization;

$id = 'id';
$collect['id'] = $id;


$result = $services->getServiceById($collect);

Errors

Error Code Error Description
400 Bad Request
401 Unauthorized/Missing Token
403 Forbidden
404 Not Found
500 Unexpected error

Method: createService

Create a Service with params.

function createService($options)

Parameters

Parameter Tags Description
authorization Required A valid API key, in the format 'Token API_KEY'
createServiceBody Required the content of the request

Example Usage

$authorization = 'Authorization';
$collect['authorization'] = $authorization;

$createServiceBody = new CreateServiceBody();
$collect['createServiceBody'] = $createServiceBody;


$result = $services->createService($collect);

Errors

Error Code Error Description
400 Bad Request
401 Unauthorized/Missing Token
403 Forbidden
404 Not Found
422 Unprocessable Entity
500 Unexpected error

Method: getServices

Return list of Services.

function getServices($options)

Parameters

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.

Example Usage

$authorization = 'Authorization';
$collect['authorization'] = $authorization;

$page = 1;
$collect['page'] = $page;

$perPage = 10;
$collect['perPage'] = $perPage;

$userId = 172;
$collect['userId'] = $userId;


$result = $services->getServices($collect);

Errors

Error Code Error Description
401 Unauthorized/Missing Token
403 Forbidden
404 Not Found
500 Unexpected error

Method: getServiceAvailableSlotsById

Return available times for a Service.

function getServiceAvailableSlotsById($options)

Parameters

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'.

Example Usage

$authorization = 'Authorization';
$collect['authorization'] = $authorization;

$id = 'id';
$collect['id'] = $id;

$date = date("D M d, Y G:i");
$collect['date'] = $date;

$endDate = date("D M d, Y G:i");
$collect['endDate'] = $endDate;

$startDate = date("D M d, Y G:i");
$collect['startDate'] = $startDate;


$result = $services->getServiceAvailableSlotsById($collect);

Errors

Error Code Error Description
400 Bad Request
401 Unauthorized/Missing Token
403 Forbidden
404 Not Found
500 Unexpected error

Back to List of Controllers

Class: SearchController

Get singleton instance

The singleton instance of the SearchController class can be accessed from the API Client.

$search = $client->getSearch();

Method: searchQuery

Search for Providers and Provided Services.

function searchQuery($options)

Parameters

Parameter Tags Description
authorization Required A valid API key, in the format 'Token API_KEY'
query Required TODO: Add a parameter description

Example Usage

$authorization = 'Authorization';
$collect['authorization'] = $authorization;

$query = 'query';
$collect['query'] = $query;


$result = $search->searchQuery($collect);

Errors

Error Code Error Description
400 Bad Request
401 Unauthorized/Missing Token
500 Unexpected error

Back to List of Controllers

Class: SchedulesController

Get singleton instance

The singleton instance of the SchedulesController class can be accessed from the API Client.

$schedules = $client->getSchedules();

Method: deleteScheduleTimeWindowById

Delete a TimeWindow from a Schedule

function deleteScheduleTimeWindowById($options)

Parameters

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

Example Usage

$authorization = 'Authorization';
$collect['authorization'] = $authorization;

$id = 'id';
$collect['id'] = $id;

$timeWindowId = 'time_window_id';
$collect['timeWindowId'] = $timeWindowId;


$result = $schedules->deleteScheduleTimeWindowById($collect);

Errors

Error Code Error Description
400 Bad Request
401 Unauthorized/Missing Token
403 Forbidden
404 Not Found
500 Unexpected error

Method: createScheduleTimeWindow

Add a TimeWindow to a Schedule.

function createScheduleTimeWindow($options)

Parameters

Parameter Tags Description
authorization Required A valid API key, in the format 'Token API_KEY'
createScheduleTimeWindowBody Required the content of the request
id Required TODO: Add a parameter description

Example Usage

$authorization = 'Authorization';
$collect['authorization'] = $authorization;

$createScheduleTimeWindowBody = new CreateScheduleTimeWindowBody();
$collect['createScheduleTimeWindowBody'] = $createScheduleTimeWindowBody;

$id = 'id';
$collect['id'] = $id;


$result = $schedules->createScheduleTimeWindow($collect);

Errors

Error Code Error Description
400 Bad Request
401 Unauthorized/Missing Token
403 Forbidden
404 Not Found
422 Unprocessable Entity
500 Unexpected error

Method: deleteScheduleById

Delete a Schedule

function deleteScheduleById($options)

Parameters

Parameter Tags Description
authorization Required A valid API key, in the format 'Token API_KEY'
id Required TODO: Add a parameter description

Example Usage

$authorization = 'Authorization';
$collect['authorization'] = $authorization;

$id = 'id';
$collect['id'] = $id;


$result = $schedules->deleteScheduleById($collect);

Errors

Error Code Error Description
400 Bad Request
401 Unauthorized/Missing Token
403 Forbidden
404 Not Found
500 Unexpected error

Method: getScheduleById

Return a Schedule by id.

function getScheduleById($options)

Parameters

Parameter Tags Description
authorization Required A valid API key, in the format 'Token API_KEY'
id Required TODO: Add a parameter description

Example Usage

$authorization = 'Authorization';
$collect['authorization'] = $authorization;

$id = 'id';
$collect['id'] = $id;


$result = $schedules->getScheduleById($collect);

Errors

Error Code Error Description
400 Bad Request
401 Unauthorized/Missing Token
403 Forbidden
404 Not Found
410 Gone
500 Unexpected error

Method: createSchedule

Create a Schedule with params.

function createSchedule($options)

Parameters

Parameter Tags Description
authorization Required A valid API key, in the format 'Token API_KEY'
createScheduleBody Required the content of the request

Example Usage

$authorization = 'Authorization';
$collect['authorization'] = $authorization;

$createScheduleBody = new CreateScheduleBody();
$collect['createScheduleBody'] = $createScheduleBody;


$result = $schedules->createSchedule($collect);

Errors

Error Code Error Description
400 Bad Request
401 Unauthorized/Missing Token
403 Forbidden
404 Not Found
422 Unprocessable Entity
500 Unexpected error

Method: updateScheduleTimeWindowById

Update a TimeWindow for a Schedule.

function updateScheduleTimeWindowById($options)

Parameters

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 Required the content of the request

Example Usage

$authorization = 'Authorization';
$collect['authorization'] = $authorization;

$id = 'id';
$collect['id'] = $id;

$timeWindowId = 'time_window_id';
$collect['timeWindowId'] = $timeWindowId;

$updateScheduleTimeWindowByIdBody = new UpdateScheduleTimeWindowByIdBody();
$collect['updateScheduleTimeWindowByIdBody'] = $updateScheduleTimeWindowByIdBody;


$result = $schedules->updateScheduleTimeWindowById($collect);

Errors

Error Code Error Description
400 Bad Request
401 Unauthorized/Missing Token
403 Forbidden
404 Not Found
422 Unprocessable Entity
500 Unexpected error

Method: 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($options)

Parameters

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.

Example Usage

$authorization = 'Authorization';
$collect['authorization'] = $authorization;

$page = 1;
$collect['page'] = $page;

$perPage = 10;
$collect['perPage'] = $perPage;

$userId = 130;
$collect['userId'] = $userId;


$result = $schedules->getSchedules($collect);

Errors

Error Code Error Description
400 Bad Request
401 Unauthorized/Missing Token
403 Forbidden
404 Not Found
500 Unexpected error

Back to List of Controllers

Class: ResourcesController

Get singleton instance

The singleton instance of the ResourcesController class can be accessed from the API Client.

$resources = $client->getResources();

Method: deleteResourceById

Delete a Resource by id

function deleteResourceById($options)

Parameters

Parameter Tags Description
authorization Required A valid API key, in the format 'Token API_KEY'
id Required TODO: Add a parameter description

Example Usage

$authorization = 'Authorization';
$collect['authorization'] = $authorization;

$id = 'id';
$collect['id'] = $id;


$result = $resources->deleteResourceById($collect);

Errors

Error Code Error Description
400 Bad Request
401 Unauthorized/Missing Token
403 Forbidden
404 Not Found
500 Unexpected error

Method: updateResourceById

Update a Resource by id, with params

function updateResourceById($options)

Parameters

Parameter Tags Description
authorization Required A valid API key, in the format 'Token API_KEY'
id Required TODO: Add a parameter description
updateResourceByIdBody Required the content of the request

Example Usage

$authorization = 'Authorization';
$collect['authorization'] = $authorization;

$id = 'id';
$collect['id'] = $id;

$updateResourceByIdBody = new UpdateResourceByIdBody();
$collect['updateResourceByIdBody'] = $updateResourceByIdBody;


$result = $resources->updateResourceById($collect);

Errors

Error Code Error Description
400 Bad Request
401 Unauthorized/Missing Token
403 Forbidden
404 Not Found
422 Unprocessable Entity
500 Unexpected error

Method: getResourceById

Return a Resource by id.

function getResourceById($options)

Parameters

Parameter Tags Description
authorization Required A valid API key, in the format 'Token API_KEY'
id Required TODO: Add a parameter description

Example Usage

$authorization = 'Authorization';
$collect['authorization'] = $authorization;

$id = 'id';
$collect['id'] = $id;


$result = $resources->getResourceById($collect);

Errors

Error Code Error Description
400 Bad Request
401 Unauthorized/Missing Token
403 Forbidden
404 Not Found
500 Unexpected error

Method: getResourceThings

Return all Resource Things.

function getResourceThings($options)

Parameters

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.

Example Usage

$authorization = 'Authorization';
$collect['authorization'] = $authorization;

$page = 1;
$collect['page'] = $page;

$perPage = 10;
$collect['perPage'] = $perPage;


$result = $resources->getResourceThings($collect);

Errors

Error Code Error Description
400 Bad Request
401 Unauthorized/Missing Token
403 Forbidden
500 Unexpected error

Method: createResource

Create a Resource with params

function createResource($options)

Parameters

Parameter Tags Description
authorization Required A valid API key, in the format 'Token API_KEY'
createResourceBody Required the content of the request

Example Usage

$authorization = 'Authorization';
$collect['authorization'] = $authorization;

$createResourceBody = new CreateResourceBody();
$collect['createResourceBody'] = $createResourceBody;


$result = $resources->createResource($collect);

Errors

Error Code Error Description
400 Bad Request
401 Unauthorized/Missing Token
403 Forbidden
422 Unprocessable Entity
500 Unexpected error

Method: getResources

Return list of Resources.

function getResources($options)

Parameters

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.

Example Usage

$authorization = 'Authorization';
$collect['authorization'] = $authorization;

$page = 1;
$collect['page'] = $page;

$perPage = 10;
$collect['perPage'] = $perPage;

$userId = 130;
$collect['userId'] = $userId;


$result = $resources->getResources($collect);

Errors

Error Code Error Description
401 Unauthorized/Missing Token
403 Forbidden
404 Not Found
500 Unexpected error

Back to List of Controllers

Class: PricingModelsController

Get singleton instance

The singleton instance of the PricingModelsController class can be accessed from the API Client.

$pricingModels = $client->getPricingModels();

Method: updatePricingModelById

Update a PricingModel by id, with params

function updatePricingModelById($options)

Parameters

Parameter Tags Description
authorization Required A valid API key, in the format 'Token API_KEY'
id Required TODO: Add a parameter description
updatePricingModelByIdBody Required the content of the request

Example Usage

$authorization = 'Authorization';
$collect['authorization'] = $authorization;

$id = 'id';
$collect['id'] = $id;

$updatePricingModelByIdBody = new UpdatePricingModelByIdBody();
$collect['updatePricingModelByIdBody'] = $updatePricingModelByIdBody;


$result = $pricingModels->updatePricingModelById($collect);

Errors

Error Code Error Description
400 Bad Request
401 Unauthorized/Missing Token
403 Forbidden
404 Not Found
422 Unprocessable Entity
500 Unexpected error

Method: getPricingModelById

Return a PricingModel by id.

function getPricingModelById($options)

Parameters

Parameter Tags Description
authorization Required A valid API key, in the format 'Token API_KEY'
id Required TODO: Add a parameter description

Example Usage

$authorization = 'Authorization';
$collect['authorization'] = $authorization;

$id = 'id';
$collect['id'] = $id;


$result = $pricingModels->getPricingModelById($collect);

Errors

Error Code Error Description
400 Bad Request
401 Unauthorized/Missing Token
403 Forbidden
404 Not Found
500 Unexpected error

Method: createPricingModel

Create a PricingModel with params

function createPricingModel($options)

Parameters

Parameter Tags Description
authorization Required A valid API key, in the format 'Token API_KEY'
createPricingModelBody Required the content of the request

Example Usage

$authorization = 'Authorization';
$collect['authorization'] = $authorization;

$createPricingModelBody = new CreatePricingModelBody();
$collect['createPricingModelBody'] = $createPricingModelBody;


$result = $pricingModels->createPricingModel($collect);

Errors

Error Code Error Description
400 Bad Request
401 Unauthorized/Missing Token
403 Forbidden
422 Unprocessable Entity
500 Unexpected error

Method: getPricingModels

Return list of PricingModels.

function getPricingModels($options)

Parameters

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.

Example Usage

$authorization = 'Authorization';
$collect['authorization'] = $authorization;

$page = 1;
$collect['page'] = $page;

$perPage = 10;
$collect['perPage'] = $perPage;

$userId = 130;
$collect['userId'] = $userId;


$result = $pricingModels->getPricingModels($collect);

Errors

Error Code Error Description
401 Unauthorized/Missing Token
403 Forbidden
404 Not Found
500 Unexpected error

Back to List of Controllers

Class: CategoriesController

Get singleton instance

The singleton instance of the CategoriesController class can be accessed from the API Client.

$categories = $client->getCategories();

Method: getCategoryById

Return a Category by id.

function getCategoryById($options)

Parameters

Parameter Tags Description
authorization Required A valid API key, in the format 'Token API_KEY'
id Required TODO: Add a parameter description

Example Usage

$authorization = 'Authorization';
$collect['authorization'] = $authorization;

$id = 'id';
$collect['id'] = $id;


$result = $categories->getCategoryById($collect);

Errors

Error Code Error Description
400 Bad Request
401 Unauthorized/Missing Token
403 Forbidden
404 Not Found
500 Unexpected error

Method: createCategory

Create a Category

function createCategory($options)

Parameters

Parameter Tags Description
authorization Required A valid API key, in the format 'Token API_KEY'
createCategoryBody Required the content of the request

Example Usage

$authorization = 'Authorization';
$collect['authorization'] = $authorization;

$createCategoryBody = new CreateCategoryBody();
$collect['createCategoryBody'] = $createCategoryBody;


$result = $categories->createCategory($collect);

Errors

Error Code Error Description
400 Bad Request
401 Unauthorized/Missing Token
403 Forbidden
422 Unprocessable Entity
500 Unexpected error

Method: getCategories

Return list of Categories.

function getCategories($options)

Parameters

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.

Example Usage

$authorization = 'Authorization';
$collect['authorization'] = $authorization;

$page = 1;
$collect['page'] = $page;

$perPage = 10;
$collect['perPage'] = $perPage;

$userId = 222;
$collect['userId'] = $userId;


$result = $categories->getCategories($collect);

Errors

Error Code Error Description
400 Bad Request
401 Unauthorized/Missing Token
403 Forbidden
500 Unexpected error

Back to List of Controllers

About

A PHP SDK for accessing the GoneBusy API

License:Other


Languages

Language:PHP 100.0%