Company administration service methods: Difference between revisions
No edit summary |
Marked this version for translation |
||
| Line 2: | Line 2: | ||
<translate> | <translate> | ||
<!--T:1--> | |||
{{#seo: | {{#seo: | ||
|title=Company administration service methods - SimplyBook.me | |title=Company administration service methods - SimplyBook.me | ||
| Line 11: | Line 12: | ||
<translate> | <translate> | ||
==General Information== | ==General Information== <!--T:2--> | ||
<!--T:3--> | |||
SimplyBook.me API service build on [https://en.wikipedia.org/wiki/JSON-RPC JSON-RPC] remote procedure call protocol. A remote method is invoked by sending a request to a remote service using HTTPS. All transfer types are single objects, serialized using [http://www.json.org JSON]. A request is a call to a specific method provided by a remote system. It must contain three certain properties: | SimplyBook.me API service build on [https://en.wikipedia.org/wiki/JSON-RPC JSON-RPC] remote procedure call protocol. A remote method is invoked by sending a request to a remote service using HTTPS. All transfer types are single objects, serialized using [http://www.json.org JSON]. A request is a call to a specific method provided by a remote system. It must contain three certain properties: | ||
| Line 19: | Line 21: | ||
<translate> | <translate> | ||
<!--T:4--> | |||
* <code>jsonrpc</code> - a version of JSON-RPC protocol. Always <code>"2.0"</code> | * <code>jsonrpc</code> - a version of JSON-RPC protocol. Always <code>"2.0"</code> | ||
* <code>method</code> - A String with the name of the method to be invoked. | * <code>method</code> - A String with the name of the method to be invoked. | ||
| Line 26: | Line 29: | ||
<translate> | <translate> | ||
<!--T:5--> | |||
The receiver of the request must reply with a valid response to all received requests. A response must contain the properties mentioned below. | The receiver of the request must reply with a valid response to all received requests. A response must contain the properties mentioned below. | ||
<!--T:6--> | |||
* <code>result</code> - The data returned by the invoked method. If an error occurred while invoking the method, this value must be null. | * <code>result</code> - The data returned by the invoked method. If an error occurred while invoking the method, this value must be null. | ||
* <code>error</code> - A specified error code if there was an error invoking the method, otherwise null. | * <code>error</code> - A specified error code if there was an error invoking the method, otherwise null. | ||
| Line 34: | Line 39: | ||
<translate> | <translate> | ||
<!--T:7--> | |||
Example | Example | ||
<!--T:8--> | |||
<pre> | <pre> | ||
Request | Request | ||
| Line 73: | Line 80: | ||
<translate> | <translate> | ||
<!--T:9--> | |||
Example of request with error response: | Example of request with error response: | ||
<!--T:10--> | |||
<pre> | <pre> | ||
Request | Request | ||
| Line 97: | Line 106: | ||
<translate> | <translate> | ||
<!--T:11--> | |||
All calls of public service methods should have additional HTTP header: | All calls of public service methods should have additional HTTP header: | ||
<!--T:12--> | |||
* <code>X-Token</code> an authentication token. See [[#Authentication|authentication]] section. | * <code>X-Token</code> an authentication token. See [[#Authentication|authentication]] section. | ||
===Endpoint=== | ===Endpoint=== <!--T:13--> | ||
<!--T:14--> | |||
Use URL <code>https://user-api.simplybook.me/admin</code> for all administration service API calls. | Use URL <code>https://user-api.simplybook.me/admin</code> for all administration service API calls. | ||
===Authentication=== | ===Authentication=== <!--T:15--> | ||
<!--T:16--> | |||
Using Simplybook API methods require an authentification. To authorize in Simplybook API you need to get an access key — access-token. In order to get this access-token you should call the JSON-RPC method <code>[[Authentication#getUserToken|getUserToken]]</code> API method on https://user-api.simplybook.me/login service passing your personal API-key. You can copy your API-key at admin interface: go to the 'Custom Features' link and select [[Custom_Features#API|API Custom Feature]] 'Settings'. | Using Simplybook API methods require an authentification. To authorize in Simplybook API you need to get an access key — access-token. In order to get this access-token you should call the JSON-RPC method <code>[[Authentication#getUserToken|getUserToken]]</code> API method on https://user-api.simplybook.me/login service passing your personal API-key. You can copy your API-key at admin interface: go to the 'Custom Features' link and select [[Custom_Features#API|API Custom Feature]] 'Settings'. | ||
== Methods == | == Methods == <!--T:17--> | ||
=== addClient === | === addClient === <!--T:18--> | ||
<!--T:19--> | |||
<code>addClient($clientData)</code> | <code>addClient($clientData)</code> | ||
<!--T:20--> | |||
Parameters: | Parameters: | ||
<!--T:21--> | |||
* '''$clientData''' Object | * '''$clientData''' Object | ||
<!--T:22--> | |||
Returns Integer. | Returns Integer. | ||
| Line 125: | Line 142: | ||
<translate> | <translate> | ||
<!--T:23--> | |||
Adds new client with specified data. You can specify name, email, phone, address1, address2, city, zip, | Adds new client with specified data. You can specify name, email, phone, address1, address2, city, zip, | ||
country_id. If client record with specified data exists method will return an id of this record. Otherwise data | country_id. If client record with specified data exists method will return an id of this record. Otherwise data | ||
| Line 130: | Line 148: | ||
<code>getCompanyParam('require_fields')</code> method to check which fields are required. | <code>getCompanyParam('require_fields')</code> method to check which fields are required. | ||
<!--T:24--> | |||
Method returns an error: | Method returns an error: | ||
<!--T:25--> | |||
* -32061 Client name value is wrong | * -32061 Client name value is wrong | ||
* -32062 Client email value is wrong | * -32062 Client email value is wrong | ||
| Line 137: | Line 157: | ||
<!--T:26--> | |||
Example: | Example: | ||
{ | <!--T:27--> | ||
{ | |||
name: "Frances T. Perez", | name: "Frances T. Perez", | ||
phone: "+1502-810-4521", | phone: "+1502-810-4521", | ||
| Line 152: | Line 174: | ||
<translate> | <translate> | ||
<!--T:28--> | |||
---- | ---- | ||
=== addDeviceToken === | === addDeviceToken === <!--T:29--> | ||
<!--T:30--> | |||
<code>addDeviceToken($token, $device)</code> | <code>addDeviceToken($token, $device)</code> | ||
<!--T:31--> | |||
Parameters: | Parameters: | ||
<!--T:32--> | |||
* '''$token''' String a device token string | * '''$token''' String a device token string | ||
* '''$device''' String a device type ('android' or 'apple') | * '''$device''' String a device type ('android' or 'apple') | ||
<!--T:33--> | |||
Returns boolean. | Returns boolean. | ||
<!--T:34--> | |||
Subscribe a mobile device to push notifications service. Device will recieve notifications about new bookings or | Subscribe a mobile device to push notifications service. Device will recieve notifications about new bookings or | ||
changes in already created bookings. Use either <code>'apple'</code> or <code>'android'</code> for <code>device</code> | changes in already created bookings. Use either <code>'apple'</code> or <code>'android'</code> for <code>device</code> | ||
parameter. | parameter. | ||
<!--T:35--> | |||
---- | ---- | ||
</translate> | </translate> | ||
| Line 174: | Line 203: | ||
<translate> | <translate> | ||
=== book === | === book === <!--T:36--> | ||
<!--T:37--> | |||
<code>book($eventId, $unitId, $clientId, $startDate, $startTime, $endDate, $endTime, $clientTimeOffset, $additional, $count, $batchId, $recurringData)</code> | <code>book($eventId, $unitId, $clientId, $startDate, $startTime, $endDate, $endTime, $clientTimeOffset, $additional, $count, $batchId, $recurringData)</code> | ||
<!--T:38--> | |||
Parameters: | Parameters: | ||
<!--T:39--> | |||
* '''$eventId''' Integer | * '''$eventId''' Integer | ||
* '''$unitId''' Integer | * '''$unitId''' Integer | ||
| Line 193: | Line 225: | ||
* '''$recurringData''' Array - make booking recurrent. (optional) | * '''$recurringData''' Array - make booking recurrent. (optional) | ||
<!--T:40--> | |||
Returns Object. | Returns Object. | ||
| Line 199: | Line 232: | ||
<translate> | <translate> | ||
<!--T:41--> | |||
Creates new booking record. Returns an object with appointment information or throw exception if booking time not | Creates new booking record. Returns an object with appointment information or throw exception if booking time not | ||
available or any of required parameters missed. If appointment requires confirmation, in result object will be | available or any of required parameters missed. If appointment requires confirmation, in result object will be | ||
| Line 218: | Line 252: | ||
<translate> | <translate> | ||
<!--T:42--> | |||
If [[Custom_Features#Multiple_Locations| Multiple locations]] enabled you need to pass locations ID parameter as additional field | If [[Custom_Features#Multiple_Locations| Multiple locations]] enabled you need to pass locations ID parameter as additional field | ||
<code>location_id</code>. For example: <code>{"location_id": "1"}</code>. Use <code>[[#isPluginActivated|isPluginActivated('location')]]</code> | <code>location_id</code>. For example: <code>{"location_id": "1"}</code>. Use <code>[[#isPluginActivated|isPluginActivated('location')]]</code> | ||
| Line 223: | Line 258: | ||
available locations. | available locations. | ||
<!--T:43--> | |||
See [[#book response|example]] of <code>book</code> API method response. | See [[#book response|example]] of <code>book</code> API method response. | ||
<!--T:44--> | |||
See also: | See also: | ||
<!--T:45--> | |||
* [https://help.simplybook.me/index.php/Need_to_change_interval_(timeframe) Timeframe information] | * [https://help.simplybook.me/index.php/Need_to_change_interval_(timeframe) Timeframe information] | ||
| Line 235: | Line 273: | ||
<translate> | <translate> | ||
=== calculateEndTime === | === calculateEndTime === <!--T:46--> | ||
<!--T:47--> | |||
<code>calculateEndTime($startDateTime, $eventId, $unitId)</code> | <code>calculateEndTime($startDateTime, $eventId, $unitId)</code> | ||
<!--T:48--> | |||
Parameters: | Parameters: | ||
<!--T:49--> | |||
* '''$startDateTime''' String a date and time string in format 'Y-m-d H:i:s', eg. '2001-10-02 13:30:00'. | * '''$startDateTime''' String a date and time string in format 'Y-m-d H:i:s', eg. '2001-10-02 13:30:00'. | ||
* '''$eventId''' Integer | * '''$eventId''' Integer | ||
* '''$unitId''' Integer | * '''$unitId''' Integer | ||
<!--T:50--> | |||
Returns String|Boolean. | Returns String|Boolean. | ||
<!--T:51--> | |||
Returns end datetime if booking is available, else return false | Returns end datetime if booking is available, else return false | ||
<!--T:52--> | |||
---- | ---- | ||
</translate> | </translate> | ||
| Line 256: | Line 300: | ||
=== cancelBatch === | === cancelBatch === <!--T:53--> | ||
<!--T:54--> | |||
<code>cancelBatch($id, $bookingIds)</code> | <code>cancelBatch($id, $bookingIds)</code> | ||
<!--T:55--> | |||
Parameters: | Parameters: | ||
<!--T:56--> | |||
* '''$id''' Integer identifier of batch. See <code>[[#createBatch|createBatch]]</code> API method. | * '''$id''' Integer identifier of batch. See <code>[[#createBatch|createBatch]]</code> API method. | ||
* '''$bookingIds''' Array ids of bookings included to batch. | * '''$bookingIds''' Array ids of bookings included to batch. | ||
<!--T:57--> | |||
Returns boolean. | Returns boolean. | ||
<!--T:58--> | |||
Cancel batch of bookings. Returns true on success. Returns an error with code -32080 (Appointment couldn't be found) | Cancel batch of bookings. Returns true on success. Returns an error with code -32080 (Appointment couldn't be found) | ||
if no booking with specified id were found. A booking with first id in <code>$bookingIds</code> list is used for | if no booking with specified id were found. A booking with first id in <code>$bookingIds</code> list is used for | ||
| Line 272: | Line 321: | ||
<!--T:59--> | |||
---- | ---- | ||
</translate> | </translate> | ||
| Line 278: | Line 328: | ||
=== cancelBooking === | === cancelBooking === <!--T:60--> | ||
<!--T:61--> | |||
<code>cancelBooking($id)</code> | <code>cancelBooking($id)</code> | ||
<!--T:62--> | |||
Parameters: | Parameters: | ||
<!--T:63--> | |||
* '''$id''' Integer | * '''$id''' Integer | ||
<!--T:64--> | |||
Returns Boolean. | Returns Boolean. | ||
<!--T:65--> | |||
Cancels booking. Returns true on success. Returns an error with code -32080 (Appointment couldn't be found) if | Cancels booking. Returns true on success. Returns an error with code -32080 (Appointment couldn't be found) if | ||
no booking with specified id were found. | no booking with specified id were found. | ||
<!--T:66--> | |||
---- | ---- | ||
</translate> | </translate> | ||
| Line 298: | Line 354: | ||
=== createBatch === | === createBatch === <!--T:67--> | ||
<!--T:68--> | |||
<code>createBatch()</code> | <code>createBatch()</code> | ||
<!--T:69--> | |||
No arguments. | No arguments. | ||
Returns Integer. | Returns Integer. | ||
<!--T:70--> | |||
Creates new booking batch record. Returns newly created batch id. You can use this id in <code>[[#book|book]]</code> | Creates new booking batch record. Returns newly created batch id. You can use this id in <code>[[#book|book]]</code> | ||
API method. | API method. | ||
<!--T:71--> | |||
---- | ---- | ||
</translate> | </translate> | ||
| Line 315: | Line 375: | ||
=== deleteDeviceToken === | === deleteDeviceToken === <!--T:72--> | ||
<!--T:73--> | |||
<code>deleteDeviceToken($token)</code> | <code>deleteDeviceToken($token)</code> | ||
<!--T:74--> | |||
Parameters: | Parameters: | ||
<!--T:75--> | |||
* '''$token''' String - device token | * '''$token''' String - device token | ||
<!--T:76--> | |||
Returns boolean. | Returns boolean. | ||
<!--T:77--> | |||
Unsubscribe from push notifications service. | Unsubscribe from push notifications service. | ||
<!--T:78--> | |||
---- | ---- | ||
</translate> | </translate> | ||
| Line 333: | Line 399: | ||
<translate> | <translate> | ||
=== editBook === | === editBook === <!--T:79--> | ||
<!--T:80--> | |||
<code>editBook($shedulerId, $eventId, $unitId, $clientId, $startDate, $startTime, $endDate, $endTime, $clientTimeOffset, $additional)</code> | <code>editBook($shedulerId, $eventId, $unitId, $clientId, $startDate, $startTime, $endDate, $endTime, $clientTimeOffset, $additional)</code> | ||
<!--T:81--> | |||
Parameters: | Parameters: | ||
<!--T:82--> | |||
* '''$shedulerId''' Integer an id of booking to edit. See <code>[[#book|book]]</code> or <code>[[#getBookings|getBookings]]</code> API methods. | * '''$shedulerId''' Integer an id of booking to edit. See <code>[[#book|book]]</code> or <code>[[#getBookings|getBookings]]</code> API methods. | ||
* '''$eventId''' Integer | * '''$eventId''' Integer | ||
| Line 350: | Line 419: | ||
* '''$additional''' array|Object - additional params and fields. | * '''$additional''' array|Object - additional params and fields. | ||
<!--T:83--> | |||
Returns Object. | Returns Object. | ||
<!--T:84--> | |||
Edit existing booking record. See [[#book|book]] API method description for more details about date/time parameters, | Edit existing booking record. See [[#book|book]] API method description for more details about date/time parameters, | ||
time zone handling and additional fields. Returns null if parameters not valid. | time zone handling and additional fields. Returns null if parameters not valid. | ||
<!--T:85--> | |||
---- | ---- | ||
</translate> | </translate> | ||
| Line 362: | Line 434: | ||
=== editClient === | === editClient === <!--T:86--> | ||
<!--T:87--> | |||
<code>editClient($clientId, $clientData)</code> | <code>editClient($clientId, $clientData)</code> | ||
<!--T:88--> | |||
Parameters: | Parameters: | ||
<!--T:89--> | |||
* '''$clientId''' Integer | * '''$clientId''' Integer | ||
* '''$clientData''' Object | * '''$clientData''' Object | ||
<!--T:90--> | |||
Returns Integer. | Returns Integer. | ||
<!--T:91--> | |||
Edits client's record. See <code>[[#addClient|addClient]]</code> method description for list of available fields.Method returns an id of client's record. | Edits client's record. See <code>[[#addClient|addClient]]</code> method description for list of available fields.Method returns an id of client's record. | ||
<!--T:92--> | |||
---- | ---- | ||
</translate> | </translate> | ||
| Line 382: | Line 460: | ||
=== filterAvailableUnits === | === filterAvailableUnits === <!--T:93--> | ||
<!--T:94--> | |||
<code>filterAvailableUnits($eventId, $dateTime, $unitIds, $count)</code> | <code>filterAvailableUnits($eventId, $dateTime, $unitIds, $count)</code> | ||
<!--T:95--> | |||
Parameters: | Parameters: | ||
<!--T:96--> | |||
* '''$eventId''' Integer | * '''$eventId''' Integer | ||
* '''$dateTime''' String a date and time string in format 'Y-m-d H:i:s' | * '''$dateTime''' String a date and time string in format 'Y-m-d H:i:s' | ||
| Line 393: | Line 474: | ||
* '''$count''' Integer | * '''$count''' Integer | ||
<!--T:97--> | |||
Returns Array. | Returns Array. | ||
<!--T:98--> | |||
Returns list of available unit ids for specified date and service from provided $unitIds list.You can use this method with location Custom Feature. | Returns list of available unit ids for specified date and service from provided $unitIds list.You can use this method with location Custom Feature. | ||
Returns empty array if all units are not allowed. | Returns empty array if all units are not allowed. | ||
| Line 400: | Line 483: | ||
<!--T:99--> | |||
---- | ---- | ||
</translate> | </translate> | ||
| Line 406: | Line 490: | ||
=== getAdditionalFields === | === getAdditionalFields === <!--T:100--> | ||
<!--T:101--> | |||
<code>getAdditionalFields($eventId)</code> | <code>getAdditionalFields($eventId)</code> | ||
<!--T:102--> | |||
Parameters: | Parameters: | ||
<!--T:103--> | |||
* '''$eventId''' Integer | * '''$eventId''' Integer | ||
<!--T:104--> | |||
Returns Array. | Returns Array. | ||
<!--T:105--> | |||
Return intake forms for certain event if [[Custom_Features#Intake_Forms|Intake Forms Custom Feature]] is | Return intake forms for certain event if [[Custom_Features#Intake_Forms|Intake Forms Custom Feature]] is | ||
activated. Returns empty array otherwise. Call <code>[[#isPluginActivated|isPluginActivated('event_field')]]</code> | activated. Returns empty array otherwise. Call <code>[[#isPluginActivated|isPluginActivated('event_field')]]</code> | ||
| Line 421: | Line 510: | ||
<!--T:106--> | |||
---- | ---- | ||
</translate> | </translate> | ||
| Line 427: | Line 517: | ||
=== getAnyUnitData === | === getAnyUnitData === <!--T:107--> | ||
<!--T:108--> | |||
<code>getAnyUnitData()</code> | <code>getAnyUnitData()</code> | ||
<!--T:109--> | |||
No arguments. | No arguments. | ||
Returns Object|null. | Returns Object|null. | ||
<!--T:110--> | |||
Returns information about [[Custom_Features#Any_Employee_Selector|Any Employee selector Custom Feature]] configuration. Returns | Returns information about [[Custom_Features#Any_Employee_Selector|Any Employee selector Custom Feature]] configuration. Returns | ||
null if Custom Feature not enabled.Example: | null if Custom Feature not enabled.Example: | ||
| Line 446: | Line 539: | ||
<!--T:111--> | |||
---- | ---- | ||
</translate> | </translate> | ||
| Line 452: | Line 546: | ||
=== getAvailableTimeIntervals === | === getAvailableTimeIntervals === <!--T:112--> | ||
<!--T:113--> | |||
<code>getAvailableTimeIntervals($dateFrom, $dateTo, $eventId, $unitId, $count)</code> | <code>getAvailableTimeIntervals($dateFrom, $dateTo, $eventId, $unitId, $count)</code> | ||
<!--T:114--> | |||
Parameters: | Parameters: | ||
<!--T:115--> | |||
* '''$dateFrom''' String | * '''$dateFrom''' String | ||
* '''$dateTo''' String | * '''$dateTo''' String | ||
| Line 464: | Line 561: | ||
* '''$count''' Integer | * '''$count''' Integer | ||
<!--T:116--> | |||
Returns Object. | Returns Object. | ||
<!--T:117--> | |||
Returns available time intervals for all service providers for given period, taking into account breaktimes, start and end working time | Returns available time intervals for all service providers for given period, taking into account breaktimes, start and end working time | ||
Eg.: <code>{['2016-03-04': ['1': [['09:00:00','09:30:00'], ['11:15:00','14:45:00']] , ...], ...]}</code> | Eg.: <code>{['2016-03-04': ['1': [['09:00:00','09:30:00'], ['11:15:00','14:45:00']] , ...], ...]}</code> | ||
<!--T:118--> | |||
---- | ---- | ||
</translate> | </translate> | ||
| Line 476: | Line 576: | ||
=== getAvailableUnits === | === getAvailableUnits === <!--T:119--> | ||
<!--T:120--> | |||
<code>getAvailableUnits($eventId, $dateTime, $count)</code> | <code>getAvailableUnits($eventId, $dateTime, $count)</code> | ||
<!--T:121--> | |||
Parameters: | Parameters: | ||
<!--T:122--> | |||
* '''$eventId''' Integer | * '''$eventId''' Integer | ||
* '''$dateTime''' String a date and time string in format 'Y-m-d H:i:s' | * '''$dateTime''' String a date and time string in format 'Y-m-d H:i:s' | ||
* '''$count''' Integer | * '''$count''' Integer | ||
<!--T:123--> | |||
Returns Array. | Returns Array. | ||
<!--T:124--> | |||
Returns list of available unit ids for specified date and service or empty array if all units are not allowed.Eg.: <code>[1, 2, 3]</code> | Returns list of available unit ids for specified date and service or empty array if all units are not allowed.Eg.: <code>[1, 2, 3]</code> | ||
<!--T:125--> | |||
---- | ---- | ||
| Line 497: | Line 603: | ||
<translate> | <translate> | ||
=== getBookingCancellationsInfo === | === getBookingCancellationsInfo === <!--T:126--> | ||
<!--T:127--> | |||
<code>getBookingCancellationsInfo($dateStart, $dateEnd)</code> | <code>getBookingCancellationsInfo($dateStart, $dateEnd)</code> | ||
<!--T:128--> | |||
Parameters: | Parameters: | ||
<!--T:129--> | |||
* '''$dateStart''' String a date string in format 'Y-m-d'. Pass null to get data from first day of current week. | * '''$dateStart''' String a date string in format 'Y-m-d'. Pass null to get data from first day of current week. | ||
* '''$dateEnd''' String a date string in format 'Y-m-d'. Pass null to get data filtered to last day of current week. | * '''$dateEnd''' String a date string in format 'Y-m-d'. Pass null to get data filtered to last day of current week. | ||
<!--T:130--> | |||
Returns Array. | Returns Array. | ||
<!--T:131--> | |||
Returns statistics about created bookings and cancellations for a time period. Data presented as array of hashes for | Returns statistics about created bookings and cancellations for a time period. Data presented as array of hashes for | ||
each type of operation (created or cancelled booking) groped by clients. <code>"type"</code> field can be either | each type of operation (created or cancelled booking) groped by clients. <code>"type"</code> field can be either | ||
| Line 531: | Line 642: | ||
<!--T:132--> | |||
---- | ---- | ||
| Line 537: | Line 649: | ||
<translate> | <translate> | ||
=== getBookingComment === | === getBookingComment === <!--T:133--> | ||
<!--T:134--> | |||
<code>getBookingComment($id)</code> | <code>getBookingComment($id)</code> | ||
<!--T:135--> | |||
Parameters: | Parameters: | ||
<!--T:136--> | |||
* '''$id''' Integer | * '''$id''' Integer | ||
<!--T:137--> | |||
Returns String. | Returns String. | ||
<!--T:138--> | |||
Returns booking comment | Returns booking comment | ||
<!--T:139--> | |||
---- | ---- | ||
</translate> | </translate> | ||
| Line 556: | Line 674: | ||
=== getBookingDetails === | === getBookingDetails === <!--T:140--> | ||
<!--T:141--> | |||
<code>getBookingDetails($id)</code> | <code>getBookingDetails($id)</code> | ||
<!--T:142--> | |||
Parameters: | Parameters: | ||
<!--T:143--> | |||
* '''$id''' integer booking id | * '''$id''' integer booking id | ||
<!--T:144--> | |||
Returns Array. | Returns Array. | ||
<!--T:145--> | |||
Returns detailed bookings object by booking id. See [[#getBookingDetails_response|response example]]. | Returns detailed bookings object by booking id. See [[#getBookingDetails_response|response example]]. | ||
<!--T:146--> | |||
---- | ---- | ||
</translate> | </translate> | ||
| Line 575: | Line 699: | ||
=== getBookingLimitUnavailableTimeInterval === | === getBookingLimitUnavailableTimeInterval === <!--T:147--> | ||
<!--T:148--> | |||
<code>getBookingLimitUnavailableTimeInterval($startDateTime, $endDateTime, $eventId)</code> | <code>getBookingLimitUnavailableTimeInterval($startDateTime, $endDateTime, $eventId)</code> | ||
<!--T:149--> | |||
Parameters: | Parameters: | ||
<!--T:150--> | |||
* '''$startDateTime''' string a date and time string in format 'Y-m-d H:i:s' | * '''$startDateTime''' string a date and time string in format 'Y-m-d H:i:s' | ||
* '''$endDateTime''' string a date and time string in format 'Y-m-d H:i:s' | * '''$endDateTime''' string a date and time string in format 'Y-m-d H:i:s' | ||
* '''$eventId''' integer | * '''$eventId''' integer | ||
<!--T:151--> | |||
Returns Array. | Returns Array. | ||
<!--T:152--> | |||
Returns time intervals not available for bookings because of configuration of [[Custom_Features#Limit_Bookings|Limit bookings]] | Returns time intervals not available for bookings because of configuration of [[Custom_Features#Limit_Bookings|Limit bookings]] | ||
Custom Feature for period of time. Returns empty array if Custom Feature not available. | Custom Feature for period of time. Returns empty array if Custom Feature not available. | ||
<!--T:153--> | |||
---- | ---- | ||
</translate> | </translate> | ||
| Line 597: | Line 727: | ||
=== getBookingRevenue === | === getBookingRevenue === <!--T:154--> | ||
<!--T:155--> | |||
<code>getBookingRevenue($dateStart, $dateEnd, $unitGroupId, $serviceId)</code> | <code>getBookingRevenue($dateStart, $dateEnd, $unitGroupId, $serviceId)</code> | ||
<!--T:156--> | |||
Parameters: | Parameters: | ||
<!--T:157--> | |||
* '''$dateStart''' string a date string in format 'Y-m-d'. | * '''$dateStart''' string a date string in format 'Y-m-d'. | ||
* '''$dateEnd''' string a date string in format 'Y-m-d' | * '''$dateEnd''' string a date string in format 'Y-m-d' | ||
| Line 608: | Line 741: | ||
* '''$serviceId''' integer | * '''$serviceId''' integer | ||
<!--T:158--> | |||
Returns Array. | Returns Array. | ||
<!--T:159--> | |||
Return bookings count and revenue value for each date in specified period. Data grouped by unit id and | Return bookings count and revenue value for each date in specified period. Data grouped by unit id and | ||
represented as array with bookings count at index 0 and revenue amount at index 1. You can filter data either | represented as array with bookings count at index 0 and revenue amount at index 1. You can filter data either | ||
| Line 620: | Line 755: | ||
<!--T:160--> | |||
---- | ---- | ||
</translate> | </translate> | ||
| Line 626: | Line 762: | ||
=== getBookingStats === | === getBookingStats === <!--T:161--> | ||
<!--T:162--> | |||
<code>getBookingStats($groupBy)</code> | <code>getBookingStats($groupBy)</code> | ||
<!--T:163--> | |||
Parameters: | Parameters: | ||
<!--T:164--> | |||
* '''$groupBy''' String either 'day', 'week' or 'month' | * '''$groupBy''' String either 'day', 'week' or 'month' | ||
<!--T:165--> | |||
Returns Array. | Returns Array. | ||
<!--T:166--> | |||
Returns statistic about bookings count grouped by 'day', 'week' or 'month'. A time period depends on selected | Returns statistic about bookings count grouped by 'day', 'week' or 'month'. A time period depends on selected | ||
grouping parameter:* for 'day' methods returns statistics for last 31 days | grouping parameter:* for 'day' methods returns statistics for last 31 days | ||
| Line 642: | Line 783: | ||
<!--T:167--> | |||
---- | ---- | ||
</translate> | </translate> | ||
| Line 648: | Line 790: | ||
=== getBookings === | === getBookings === <!--T:168--> | ||
<!--T:169--> | |||
<code>getBookings($params)</code> | <code>getBookings($params)</code> | ||
<!--T:170--> | |||
Parameters: | Parameters: | ||
<!--T:171--> | |||
* '''$params''' | * '''$params''' | ||
<!--T:172--> | |||
Returns Array. | Returns Array. | ||
<!--T:173--> | |||
Returns list of bookings filtered by given params. Filter params represented as object with following fields:* '''date_from''' a date of booking in string format 'Y-m-d' | Returns list of bookings filtered by given params. Filter params represented as object with following fields:* '''date_from''' a date of booking in string format 'Y-m-d' | ||
* '''time_from''' a time string in format 'H:i:s' | * '''time_from''' a time string in format 'H:i:s' | ||
| Line 683: | Line 830: | ||
** '''approved''' returns bookings with either 'is_confirmed' field equals to 1 and approve booking status equals to 'approved' (or booking does not have any approve status) | ** '''approved''' returns bookings with either 'is_confirmed' field equals to 1 and approve booking status equals to 'approved' (or booking does not have any approve status) | ||
<!--T:174--> | |||
Example: | Example: | ||
{ | { | ||
| Line 693: | Line 841: | ||
<!--T:175--> | |||
---- | ---- | ||
</translate> | </translate> | ||
| Line 699: | Line 848: | ||
=== getBookingsZapier === | === getBookingsZapier === <!--T:176--> | ||
<!--T:177--> | |||
<code>getBookingsZapier()</code> | <code>getBookingsZapier()</code> | ||
<!--T:178--> | |||
No arguments. | No arguments. | ||
Returns Array. | Returns Array. | ||
<!--T:179--> | |||
Returns list of bookings filtered by given params | Returns list of bookings filtered by given params | ||
<!--T:180--> | |||
---- | ---- | ||
</translate> | </translate> | ||
| Line 715: | Line 868: | ||
=== getCategoriesList === | === getCategoriesList === <!--T:181--> | ||
<!--T:182--> | |||
<code>getCategoriesList($isPublic)</code> | <code>getCategoriesList($isPublic)</code> | ||
<!--T:183--> | |||
Parameters: | Parameters: | ||
<!--T:184--> | |||
* '''$isPublic''' Boolean | * '''$isPublic''' Boolean | ||
<!--T:185--> | |||
Returns Array. | Returns Array. | ||
<!--T:186--> | |||
Returns company categories list if [[Custom_Features#Service_Categories|Service Categories Custom Feature]] is activated. Returns | Returns company categories list if [[Custom_Features#Service_Categories|Service Categories Custom Feature]] is activated. Returns | ||
an error with code -32001 if Custom Feature is not activated. Use <code>[[#isPluginActivated|isPluginActivated('event_category')]]</code> | an error with code -32001 if Custom Feature is not activated. Use <code>[[#isPluginActivated|isPluginActivated('event_category')]]</code> | ||
| Line 730: | Line 888: | ||
<!--T:187--> | |||
---- | ---- | ||
| Line 736: | Line 895: | ||
<translate> | <translate> | ||
=== getClient === | === getClient === <!--T:188--> | ||
<!--T:189--> | |||
<code>getClient($clientId)</code> | <code>getClient($clientId)</code> | ||
<!--T:190--> | |||
Parameters: | Parameters: | ||
<!--T:191--> | |||
* '''$clientId''' | * '''$clientId''' | ||
<!--T:192--> | |||
Returns Array. | Returns Array. | ||
<!--T:193--> | |||
Returns client's data object. See <code>[[#addClient|addClient]]</code> API method for list of available fields | Returns client's data object. See <code>[[#addClient|addClient]]</code> API method for list of available fields | ||
of client data object. | of client data object. | ||
<!--T:194--> | |||
---- | ---- | ||
| Line 756: | Line 921: | ||
<translate> | <translate> | ||
=== getClientComments === | === getClientComments === <!--T:195--> | ||
<!--T:196--> | |||
<code>getClientComments($clientId, $shedulerId)</code> | <code>getClientComments($clientId, $shedulerId)</code> | ||
<!--T:197--> | |||
Parameters: | Parameters: | ||
<!--T:198--> | |||
* '''$clientId''' Integer | * '''$clientId''' Integer | ||
* '''$shedulerId''' Integer | * '''$shedulerId''' Integer | ||
<!--T:199--> | |||
Returns Array. | Returns Array. | ||
<!--T:200--> | |||
Returns list of all comments for given client | Returns list of all comments for given client | ||
<!--T:201--> | |||
---- | ---- | ||
| Line 776: | Line 947: | ||
<translate> | <translate> | ||
=== getClientList === | === getClientList === <!--T:202--> | ||
<!--T:203--> | |||
<code>getClientList($searchString, $limit)</code> | <code>getClientList($searchString, $limit)</code> | ||
<!--T:204--> | |||
Parameters: | Parameters: | ||
<!--T:205--> | |||
* '''$searchString''' String | * '''$searchString''' String | ||
* '''$limit''' Integer | * '''$limit''' Integer | ||
<!--T:206--> | |||
Returns Array. | Returns Array. | ||
<!--T:207--> | |||
Returns list of clients associated with company. You can use either phone number, email address or name as value | Returns list of clients associated with company. You can use either phone number, email address or name as value | ||
for <code>$searchString</code>. Pass an empty string for <code>$searchString</code> and null for <code>$limit</code> | for <code>$searchString</code>. Pass an empty string for <code>$searchString</code> and null for <code>$limit</code> | ||
| Line 793: | Line 969: | ||
<!--T:208--> | |||
---- | ---- | ||
| Line 799: | Line 976: | ||
<translate> | <translate> | ||
=== getCompanyCurrency === | === getCompanyCurrency === <!--T:209--> | ||
<!--T:210--> | |||
<code>getCompanyCurrency()</code> | <code>getCompanyCurrency()</code> | ||
<!--T:211--> | |||
No arguments. | No arguments. | ||
Returns String. | Returns String. | ||
<!--T:212--> | |||
Returns company's currency as three chars code (ISO 4217). | Returns company's currency as three chars code (ISO 4217). | ||
<!--T:213--> | |||
---- | ---- | ||
</translate> | </translate> | ||
| Line 815: | Line 996: | ||
=== getCompanyInfo === | === getCompanyInfo === <!--T:214--> | ||
<!--T:215--> | |||
<code>getCompanyInfo()</code> | <code>getCompanyInfo()</code> | ||
<!--T:216--> | |||
No arguments. | No arguments. | ||
Returns Object. | Returns Object. | ||
<!--T:217--> | |||
Returns an object with detailed information about company. See [[#getCompanyInfo response|example of response]]. | Returns an object with detailed information about company. See [[#getCompanyInfo response|example of response]]. | ||
<!--T:218--> | |||
---- | ---- | ||
| Line 831: | Line 1,016: | ||
<translate> | <translate> | ||
=== getCompanyParam === | === getCompanyParam === <!--T:219--> | ||
<!--T:220--> | |||
<code>getCompanyParam($key)</code> | <code>getCompanyParam($key)</code> | ||
<!--T:221--> | |||
Parameters: | Parameters: | ||
<!--T:222--> | |||
* '''$key''' String | * '''$key''' String | ||
<!--T:223--> | |||
Returns mixed. | Returns mixed. | ||
<!--T:224--> | |||
Returns company config value for key. A different set of keys available for public API and for company | Returns company config value for key. A different set of keys available for public API and for company | ||
administration API. Method return 'invalid params' error (code -32602) in case if access to specified key not | administration API. Method return 'invalid params' error (code -32602) in case if access to specified key not | ||
| Line 846: | Line 1,036: | ||
<!--T:225--> | |||
---- | ---- | ||
| Line 852: | Line 1,043: | ||
<translate> | <translate> | ||
=== getCompanyParams === | === getCompanyParams === <!--T:226--> | ||
<!--T:227--> | |||
<code>getCompanyParams($keys)</code> | <code>getCompanyParams($keys)</code> | ||
<!--T:228--> | |||
Parameters: | Parameters: | ||
<!--T:229--> | |||
* '''$keys''' Array | * '''$keys''' Array | ||
<!--T:230--> | |||
Returns Array. | Returns Array. | ||
<!--T:231--> | |||
Returns company config values for keys. A different set of keys available for public API and for company | Returns company config values for keys. A different set of keys available for public API and for company | ||
administration API. Method return 'invalid params' error (code -32602) in case if access to specified key not | administration API. Method return 'invalid params' error (code -32602) in case if access to specified key not | ||
| Line 867: | Line 1,063: | ||
<!--T:232--> | |||
---- | ---- | ||
| Line 873: | Line 1,070: | ||
<translate> | <translate> | ||
=== getCompanyTimezoneOffset === | === getCompanyTimezoneOffset === <!--T:233--> | ||
<!--T:234--> | |||
<code>getCompanyTimezoneOffset()</code> | <code>getCompanyTimezoneOffset()</code> | ||
<!--T:235--> | |||
No arguments. | No arguments. | ||
Returns array. | Returns array. | ||
<!--T:236--> | |||
Returns company timezone offset and company timezone | Returns company timezone offset and company timezone | ||
<!--T:237--> | |||
---- | ---- | ||
| Line 889: | Line 1,090: | ||
<translate> | <translate> | ||
=== getCountryList === | === getCountryList === <!--T:238--> | ||
<!--T:239--> | |||
<code>getCountryList()</code> | <code>getCountryList()</code> | ||
<!--T:240--> | |||
No arguments. | No arguments. | ||
Returns Array. | Returns Array. | ||
<!--T:241--> | |||
Get list of all countries | Get list of all countries | ||
<!--T:242--> | |||
---- | ---- | ||
| Line 905: | Line 1,110: | ||
<translate> | <translate> | ||
=== getCountryPhoneCodes === | === getCountryPhoneCodes === <!--T:243--> | ||
<!--T:244--> | |||
<code>getCountryPhoneCodes()</code> | <code>getCountryPhoneCodes()</code> | ||
<!--T:245--> | |||
No arguments. | No arguments. | ||
Returns Array. | Returns Array. | ||
<!--T:246--> | |||
Returns country phone code list | Returns country phone code list | ||
<!--T:247--> | |||
---- | ---- | ||
| Line 921: | Line 1,130: | ||
<translate> | <translate> | ||
=== getCurrentTariffInfo === | === getCurrentTariffInfo === <!--T:248--> | ||
<!--T:249--> | |||
<code>getCurrentTariffInfo()</code> | <code>getCurrentTariffInfo()</code> | ||
<!--T:250--> | |||
No arguments. | No arguments. | ||
Returns Array. | Returns Array. | ||
<!--T:251--> | |||
Returns all information about current tariff (subscription). For example:{ | Returns all information about current tariff (subscription). For example:{ | ||
"name" : "gold", | "name" : "gold", | ||
| Line 936: | Line 1,148: | ||
<!--T:252--> | |||
---- | ---- | ||
| Line 942: | Line 1,155: | ||
<translate> | <translate> | ||
=== getCurrentUserDetails === | === getCurrentUserDetails === <!--T:253--> | ||
<!--T:254--> | |||
<code>getCurrentUserDetails()</code> | <code>getCurrentUserDetails()</code> | ||
<!--T:255--> | |||
No arguments. Returns Object. | No arguments. Returns Object. | ||
<!--T:256--> | |||
Returns an object with information about logged in user. Note: you are responsible for implementation of some | Returns an object with information about logged in user. Note: you are responsible for implementation of some | ||
access rights based on <code>group</code> property value. Most of API methods returns an error if user has low access | access rights based on <code>group</code> property value. Most of API methods returns an error if user has low access | ||
rights but not all. There are 4 roles: | rights but not all. There are 4 roles: | ||
<!--T:257--> | |||
* '''Administrator''' - have full access to the system | * '''Administrator''' - have full access to the system | ||
* '''Senior Employee''' - have access to calendar, services and providers, and can modify bookings related with user | * '''Senior Employee''' - have access to calendar, services and providers, and can modify bookings related with user | ||
| Line 958: | Line 1,175: | ||
<!--T:258--> | |||
<code>group</code> property can be one of the values: | <code>group</code> property can be one of the values: | ||
<!--T:259--> | |||
* <code>shop_user</code> - "Senior Employee" access role | * <code>shop_user</code> - "Senior Employee" access role | ||
* <code>station_user</code> - "Junior Employee" access role | * <code>station_user</code> - "Junior Employee" access role | ||
| Line 967: | Line 1,186: | ||
<!--T:260--> | |||
Example: | Example: | ||
{ | <!--T:261--> | ||
{ | |||
"id": 1, | "id": 1, | ||
"login": admin, | "login": admin, | ||
| Line 983: | Line 1,204: | ||
<!--T:262--> | |||
---- | ---- | ||
| Line 989: | Line 1,211: | ||
<translate> | <translate> | ||
=== getEventList === | === getEventList === <!--T:263--> | ||
<!--T:264--> | |||
<code>getEventList($isVisibleOnly, $asArray)</code> | <code>getEventList($isVisibleOnly, $asArray)</code> | ||
<!--T:265--> | |||
Parameters: | Parameters: | ||
<!--T:266--> | |||
* '''$isVisibleOnly''' Boolean | * '''$isVisibleOnly''' Boolean | ||
* '''$asArray''' Boolean | * '''$asArray''' Boolean | ||
<!--T:267--> | |||
Returns Array. | Returns Array. | ||
<!--T:268--> | |||
Returns company's events list. If <code>$asArray</code> is false then method returns a map with event id as key | Returns company's events list. If <code>$asArray</code> is false then method returns a map with event id as key | ||
and details object as value. If parameter set to true then method returns a list sorted by 'position' property of | and details object as value. If parameter set to true then method returns a list sorted by 'position' property of | ||
| Line 1,005: | Line 1,232: | ||
<!--T:269--> | |||
---- | ---- | ||
| Line 1,011: | Line 1,239: | ||
<translate> | <translate> | ||
=== getFeedbacks === | === getFeedbacks === <!--T:270--> | ||
<!--T:271--> | |||
<code>getFeedbacks($approvedOnly, $reviewsOnly, $lastOnly, $limit)</code> | <code>getFeedbacks($approvedOnly, $reviewsOnly, $lastOnly, $limit)</code> | ||
<!--T:272--> | |||
Parameters: | Parameters: | ||
<!--T:273--> | |||
* '''$approvedOnly''' Boolean | * '''$approvedOnly''' Boolean | ||
* '''$reviewsOnly''' Boolean | * '''$reviewsOnly''' Boolean | ||
| Line 1,022: | Line 1,253: | ||
* '''$limit''' Integer | * '''$limit''' Integer | ||
<!--T:274--> | |||
Returns Array. | Returns Array. | ||
<!--T:275--> | |||
Get list of feedbacks | Get list of feedbacks | ||
<!--T:276--> | |||
---- | ---- | ||
| Line 1,033: | Line 1,267: | ||
<translate> | <translate> | ||
=== getFirstWorkingDay === | === getFirstWorkingDay === <!--T:277--> | ||
<!--T:278--> | |||
<code>getFirstWorkingDay($unitId)</code> | <code>getFirstWorkingDay($unitId)</code> | ||
<!--T:279--> | |||
Parameters: | Parameters: | ||
<!--T:280--> | |||
* '''$unitId''' Integer | * '''$unitId''' Integer | ||
<!--T:281--> | |||
Returns String. | Returns String. | ||
<!--T:282--> | |||
Returns first working date for unit | Returns first working date for unit | ||
<!--T:283--> | |||
---- | ---- | ||
| Line 1,052: | Line 1,292: | ||
<translate> | <translate> | ||
=== getGoogleCalendarBusyTime === | === getGoogleCalendarBusyTime === <!--T:284--> | ||
<!--T:285--> | |||
<code>getGoogleCalendarBusyTime($startDateTime, $endDateTime, $unitId)</code> | <code>getGoogleCalendarBusyTime($startDateTime, $endDateTime, $unitId)</code> | ||
<!--T:286--> | |||
Parameters: | Parameters: | ||
<!--T:287--> | |||
* '''$startDateTime''' string a date and time string in format 'Y-m-d H:i:s' | * '''$startDateTime''' string a date and time string in format 'Y-m-d H:i:s' | ||
* '''$endDateTime''' string a date and time string in format 'Y-m-d H:i:s'. You can date string avoiding time in | * '''$endDateTime''' string a date and time string in format 'Y-m-d H:i:s'. You can date string avoiding time in | ||
| Line 1,063: | Line 1,306: | ||
* '''$unitId''' integer | * '''$unitId''' integer | ||
<!--T:288--> | |||
Returns Array. | Returns Array. | ||
<!--T:289--> | |||
Returns a list of objects represented a time intervals marked as busy in Google Calendar. Each object of result | Returns a list of objects represented a time intervals marked as busy in Google Calendar. Each object of result | ||
contains <code>from</code> and <code>to</code> properties with datetime string as value. This method only actual if | contains <code>from</code> and <code>to</code> properties with datetime string as value. This method only actual if | ||
| Line 1,081: | Line 1,326: | ||
<!--T:290--> | |||
---- | ---- | ||
| Line 1,087: | Line 1,333: | ||
<translate> | <translate> | ||
=== getGoogleCalendarBusyTimeAvailableUnits === | === getGoogleCalendarBusyTimeAvailableUnits === <!--T:291--> | ||
<!--T:292--> | |||
<code>getGoogleCalendarBusyTimeAvailableUnits()</code> | <code>getGoogleCalendarBusyTimeAvailableUnits()</code> | ||
<!--T:293--> | |||
No arguments. | No arguments. | ||
Returns Array. | Returns Array. | ||
<!--T:294--> | |||
Returns configured unit ids, allowed to sync busy time | Returns configured unit ids, allowed to sync busy time | ||
<!--T:295--> | |||
---- | ---- | ||
</translate> | </translate> | ||
| Line 1,103: | Line 1,353: | ||
=== getLastNotificationUpdate === | === getLastNotificationUpdate === <!--T:296--> | ||
<!--T:297--> | |||
<code>getLastNotificationUpdate($type)</code> | <code>getLastNotificationUpdate($type)</code> | ||
<!--T:298--> | |||
Parameters: | Parameters: | ||
<!--T:299--> | |||
* '''$type''' String | * '''$type''' String | ||
<!--T:300--> | |||
Returns String. | Returns String. | ||
<!--T:301--> | |||
Returns last update datetime | Returns last update datetime | ||
<!--T:302--> | |||
---- | ---- | ||
| Line 1,122: | Line 1,378: | ||
<translate> | <translate> | ||
=== getLocationsList === | === getLocationsList === <!--T:303--> | ||
<!--T:304--> | |||
<code>getLocationsList($isPublic, $asArray)</code> | <code>getLocationsList($isPublic, $asArray)</code> | ||
<!--T:305--> | |||
Parameters: | Parameters: | ||
<!--T:306--> | |||
* '''$isPublic''' Boolean Optional. Default value is '''false'''. | * '''$isPublic''' Boolean Optional. Default value is '''false'''. | ||
* '''$asArray''' boolean Optional. Default value is '''false'''. | * '''$asArray''' boolean Optional. Default value is '''false'''. | ||
<!--T:307--> | |||
Returns Array. | Returns Array. | ||
<!--T:308--> | |||
Returns available locations for company if Custom Feature [[Custom_Features#Multiple_Locations|Multiple locations Custom Feature]] is activated. Return | Returns available locations for company if Custom Feature [[Custom_Features#Multiple_Locations|Multiple locations Custom Feature]] is activated. Return | ||
an error with code -32001 if Custom Feature is not activated. Use <code>[[#isPluginActivated|isPluginActivated('location')]]</code> | an error with code -32001 if Custom Feature is not activated. Use <code>[[#isPluginActivated|isPluginActivated('location')]]</code> | ||
API method to check if Custom Feature activated. | API method to check if Custom Feature activated. | ||
<!--T:309--> | |||
This method accepts two boolean flags as parameters. If '''isPublic''' flag is '''true''' then method returns only | This method accepts two boolean flags as parameters. If '''isPublic''' flag is '''true''' then method returns only | ||
public locations. If '''asArray''' flag is '''true''' method returns list of objects. Otherwise method returns | public locations. If '''asArray''' flag is '''true''' method returns list of objects. Otherwise method returns | ||
map of objects with object id as key. You can omit both parameters. | map of objects with object id as key. You can omit both parameters. | ||
<!--T:310--> | |||
---- | ---- | ||
</translate> | </translate> | ||
| Line 1,147: | Line 1,410: | ||
=== getPluginList === | === getPluginList === <!--T:311--> | ||
<!--T:312--> | |||
<code>getPluginList()</code> | <code>getPluginList()</code> | ||
<!--T:313--> | |||
No arguments. | No arguments. | ||
Returns Array. | Returns Array. | ||
<!--T:314--> | |||
Returns a list of all Custom Features associated with company with status. | Returns a list of all Custom Features associated with company with status. | ||
<!--T:315--> | |||
---- | ---- | ||
| Line 1,163: | Line 1,430: | ||
<translate> | <translate> | ||
<!--T:316--> | |||
<!---=== getPluginPromoInfoByCode === | <!---=== getPluginPromoInfoByCode === | ||
<!--T:317--> | |||
<code>getPluginPromoInfoByCode($code)</code> | <code>getPluginPromoInfoByCode($code)</code> | ||
<!--T:318--> | |||
Parameters: | Parameters: | ||
<!--T:319--> | |||
* '''$code''' | * '''$code''' | ||
<!--T:320--> | |||
Returns Array. | Returns Array. | ||
<!--T:321--> | |||
Returns an object with detailed information about Rewards and referrals promotion by promotion code. You can get promotion code | Returns an object with detailed information about Rewards and referrals promotion by promotion code. You can get promotion code | ||
using <code>[[Catalogue#getPromotionList|getPromotionList]]</code> API method. If promotion record with specified code not found then method returns an empty array (an empty object). If [[Rewards_and_Referrals_custom_feature|Rewards and Referrals Custom Feature]] | using <code>[[Catalogue#getPromotionList|getPromotionList]]</code> API method. If promotion record with specified code not found then method returns an empty array (an empty object). If [[Rewards_and_Referrals_custom_feature|Rewards and Referrals Custom Feature]] | ||
| Line 1,186: | Line 1,459: | ||
<translate> | <translate> | ||
=== getPluginStatuses === | === getPluginStatuses === <!--T:322--> | ||
<!--T:323--> | |||
<code>getPluginStatuses($pluginNames)</code> | <code>getPluginStatuses($pluginNames)</code> | ||
<!--T:324--> | |||
Parameters: | Parameters: | ||
<!--T:325--> | |||
* '''$pluginNames''' Array | * '''$pluginNames''' Array | ||
<!--T:326--> | |||
Returns Array. | Returns Array. | ||
<!--T:327--> | |||
Return Custom Feature status true if status active, else false. See [[Company_administration_service_methods#Custom_Features.27_identifiers|list of available plugin's names]]. | Return Custom Feature status true if status active, else false. See [[Company_administration_service_methods#Custom_Features.27_identifiers|list of available plugin's names]]. | ||
| Line 1,205: | Line 1,483: | ||
<translate> | <translate> | ||
=== getRecentActions === | === getRecentActions === <!--T:328--> | ||
<!--T:329--> | |||
<code>getRecentActions($lastOnly, $limit)</code> | <code>getRecentActions($lastOnly, $limit)</code> | ||
<!--T:330--> | |||
Parameters: | Parameters: | ||
<!--T:331--> | |||
* '''$lastOnly''' Boolean | * '''$lastOnly''' Boolean | ||
* '''$limit''' Integer | * '''$limit''' Integer | ||
<!--T:332--> | |||
Returns Array. | Returns Array. | ||
<!--T:333--> | |||
Returns latest actions | Returns latest actions | ||
| Line 1,226: | Line 1,509: | ||
=== getRecurringDatetimes === | === getRecurringDatetimes === <!--T:334--> | ||
<!--T:335--> | |||
<code>getRecurringDatetimes($eventId, $unitId, $date, $time, $recurringData, $endDateTime)</code> | <code>getRecurringDatetimes($eventId, $unitId, $date, $time, $recurringData, $endDateTime)</code> | ||
<!--T:336--> | |||
Parameters: | Parameters: | ||
<!--T:337--> | |||
* '''$eventId''' Integer | * '''$eventId''' Integer | ||
* '''$unitId''' Integer | * '''$unitId''' Integer | ||
| Line 1,239: | Line 1,525: | ||
* '''$endDateTime''' String (optional) | * '''$endDateTime''' String (optional) | ||
<!--T:338--> | |||
Returns Array. | Returns Array. | ||
<!--T:339--> | |||
Get list of dates for recurring booking | Get list of dates for recurring booking | ||
| Line 1,250: | Line 1,538: | ||
<translate> | <translate> | ||
=== getRecurringSettings === | === getRecurringSettings === <!--T:340--> | ||
<!--T:341--> | |||
<code>getRecurringSettings($eventId)</code> | <code>getRecurringSettings($eventId)</code> | ||
<!--T:342--> | |||
Parameters: | Parameters: | ||
<!--T:343--> | |||
* '''$eventId''' Integer | * '''$eventId''' Integer | ||
<!--T:344--> | |||
Returns Array. | Returns Array. | ||
<!--T:345--> | |||
Returns an object with recurring settings for an event. Returns false if specified event does not configured as | Returns an object with recurring settings for an event. Returns false if specified event does not configured as | ||
recurring. | recurring. | ||
<!--T:346--> | |||
See also: | See also: | ||
<!--T:347--> | |||
* [http://blog.simplybook.me/recurring-and-periodic-bookings/ Recurring services desription] | * [http://blog.simplybook.me/recurring-and-periodic-bookings/ Recurring services desription] | ||
| Line 1,275: | Line 1,570: | ||
=== getRegistrations === | === getRegistrations === <!--T:348--> | ||
<!--T:349--> | |||
<code>getRegistrations($groupBy)</code> | <code>getRegistrations($groupBy)</code> | ||
<!--T:350--> | |||
Parameters: | Parameters: | ||
<!--T:351--> | |||
* '''$groupBy''' String either 'day', 'week' or 'month' | * '''$groupBy''' String either 'day', 'week' or 'month' | ||
<!--T:352--> | |||
Returns Array. | Returns Array. | ||
<!--T:353--> | |||
Returns number of clients registrations by 'day', 'week' or 'month'. A time period depends on selected | Returns number of clients registrations by 'day', 'week' or 'month'. A time period depends on selected | ||
grouping parameter:* for 'day' methods returns statistics for last 31 days | grouping parameter:* for 'day' methods returns statistics for last 31 days | ||
| Line 1,299: | Line 1,599: | ||
=== getReservedTime === | === getReservedTime === <!--T:354--> | ||
<!--T:355--> | |||
<code>getReservedTime($from, $to, $eventId, $unitId, $count)</code> | <code>getReservedTime($from, $to, $eventId, $unitId, $count)</code> | ||
<!--T:356--> | |||
Parameters: | Parameters: | ||
<!--T:357--> | |||
* '''$from''' String | * '''$from''' String | ||
* '''$to''' String | * '''$to''' String | ||
| Line 1,311: | Line 1,614: | ||
* '''$count''' Integer | * '''$count''' Integer | ||
<!--T:358--> | |||
Returns Object. | Returns Object. | ||
<!--T:359--> | |||
Returns map of objects for each day in specified date range. The key of the result mps is a date string. The value | Returns map of objects for each day in specified date range. The key of the result mps is a date string. The value | ||
is an array of two objects. Both objects contains list of time slots for type <code>reserved_time</code> and type | is an array of two objects. Both objects contains list of time slots for type <code>reserved_time</code> and type | ||
| Line 1,321: | Line 1,626: | ||
<!--T:360--> | |||
Example: | Example: | ||
<pre> | <pre> | ||
| Line 1,353: | Line 1,659: | ||
=== getReservedTimeIntervals === | === getReservedTimeIntervals === <!--T:361--> | ||
<!--T:362--> | |||
<code>getReservedTimeIntervals($dateFrom, $dateTo, $eventId, $unitId, $count)</code> | <code>getReservedTimeIntervals($dateFrom, $dateTo, $eventId, $unitId, $count)</code> | ||
<!--T:363--> | |||
Parameters: | Parameters: | ||
<!--T:364--> | |||
* '''$dateFrom''' String | * '''$dateFrom''' String | ||
* '''$dateTo''' String | * '''$dateTo''' String | ||
| Line 1,365: | Line 1,674: | ||
* '''$count''' Integer | * '''$count''' Integer | ||
<!--T:365--> | |||
Returns Object. | Returns Object. | ||
<!--T:366--> | |||
Returns not available time | Returns not available time | ||
Eg.: <code>{'2014-05-14': [{'reserved_time': [{'from': '14:00', 'to': '16:30'}], 'type': "reserved_time"}, ...], ...}</code> | Eg.: <code>{'2014-05-14': [{'reserved_time': [{'from': '14:00', 'to': '16:30'}], 'type': "reserved_time"}, ...], ...}</code> | ||
| Line 1,379: | Line 1,690: | ||
=== getSocialCounterStats === | === getSocialCounterStats === <!--T:367--> | ||
<!--T:368--> | |||
<code>getSocialCounterStats($provider)</code> | <code>getSocialCounterStats($provider)</code> | ||
<!--T:369--> | |||
Parameters: | Parameters: | ||
<!--T:370--> | |||
* '''$provider''' String | * '''$provider''' String | ||
<!--T:371--> | |||
Returns Integer. | Returns Integer. | ||
<!--T:372--> | |||
Returns social counters value for your domain | Returns social counters value for your domain | ||
| Line 1,400: | Line 1,716: | ||
=== getStartTimeMatrix === | === getStartTimeMatrix === <!--T:373--> | ||
<!--T:374--> | |||
<code>getStartTimeMatrix($from, $to, $eventId, $unitId, $count)</code> | <code>getStartTimeMatrix($from, $to, $eventId, $unitId, $count)</code> | ||
<!--T:375--> | |||
Parameters: | Parameters: | ||
<!--T:376--> | |||
* '''$from''' String | * '''$from''' String | ||
* '''$to''' String | * '''$to''' String | ||
| Line 1,412: | Line 1,731: | ||
* '''$count''' Integer | * '''$count''' Integer | ||
<!--T:377--> | |||
Returns Object. | Returns Object. | ||
<!--T:378--> | |||
Returns available start time, taking into account breaktimes, start and end working time | Returns available start time, taking into account breaktimes, start and end working time | ||
Eg.: <code>{'2014-05-14': ['09:00:00', ...], ...}</code> | Eg.: <code>{'2014-05-14': ['09:00:00', ...], ...}</code> | ||
<!--T:379--> | |||
If locations Custom Feature activated for company you should pass a list as $unitID parameter for filter results with | If locations Custom Feature activated for company you should pass a list as $unitID parameter for filter results with | ||
units available only for selected location. See [[Custom_Features#Multiple_Locations|Multiple locations]] Custom Feature description for | units available only for selected location. See [[Custom_Features#Multiple_Locations|Multiple locations]] Custom Feature description for | ||
| Line 1,430: | Line 1,752: | ||
=== getStatuses === | === getStatuses === <!--T:380--> | ||
<!--T:381--> | |||
<code>getStatuses()</code> | <code>getStatuses()</code> | ||
<!--T:382--> | |||
No arguments. | No arguments. | ||
Returns Array. | Returns Array. | ||
<!--T:383--> | |||
Returns list of available statuses or an empty list if [[Custom_Features#Status|Status Custom feature]] not enabled. | Returns list of available statuses or an empty list if [[Custom_Features#Status|Status Custom feature]] not enabled. | ||
| Line 1,448: | Line 1,773: | ||
=== getTimeframe === | === getTimeframe === <!--T:384--> | ||
<!--T:385--> | |||
<code>getTimeframe()</code> | <code>getTimeframe()</code> | ||
<!--T:386--> | |||
No arguments. | No arguments. | ||
Returns Integer. | Returns Integer. | ||
<!--T:387--> | |||
Returns company's timeframe configuration (in minutes). Timeframe can be either 5, 10, 15, 20, 30 or 60 minutes.You can find more details about timeframe [[Need_to_change_interval_(timeframe)|here]]. | Returns company's timeframe configuration (in minutes). Timeframe can be either 5, 10, 15, 20, 30 or 60 minutes.You can find more details about timeframe [[Need_to_change_interval_(timeframe)|here]]. | ||
| Line 1,466: | Line 1,794: | ||
=== getTimelineType === | === getTimelineType === <!--T:388--> | ||
<!--T:389--> | |||
<code>getTimelineType()</code> | <code>getTimelineType()</code> | ||
<!--T:390--> | |||
No arguments. | No arguments. | ||
Returns String. | Returns String. | ||
<!--T:391--> | |||
Returns company calendar layout type | Returns company calendar layout type | ||
| Line 1,484: | Line 1,815: | ||
=== getTopPerformers === | === getTopPerformers === <!--T:392--> | ||
<!--T:393--> | |||
<code>getTopPerformers()</code> | <code>getTopPerformers()</code> | ||
<!--T:394--> | |||
No arguments. | No arguments. | ||
Returns Array. | Returns Array. | ||
<!--T:395--> | |||
Returns a list with statistics for performers. This data contains number of bookings and revenues value for each performer. | Returns a list with statistics for performers. This data contains number of bookings and revenues value for each performer. | ||
| Line 1,502: | Line 1,836: | ||
=== getTopServices === | === getTopServices === <!--T:396--> | ||
<!--T:397--> | |||
<code>getTopServices($dateStart, $dateEnd)</code> | <code>getTopServices($dateStart, $dateEnd)</code> | ||
<!--T:398--> | |||
Parameters: | Parameters: | ||
<!--T:399--> | |||
* '''$dateStart''' String | * '''$dateStart''' String | ||
* '''$dateEnd''' String | * '''$dateEnd''' String | ||
<!--T:400--> | |||
Returns Array. | Returns Array. | ||
<!--T:401--> | |||
Returns a list with statistics for services for a period of time. This data contains number of bookings and | Returns a list with statistics for services for a period of time. This data contains number of bookings and | ||
revenues value for each service. | revenues value for each service. | ||
| Line 1,525: | Line 1,864: | ||
=== getUnitList === | === getUnitList === <!--T:402--> | ||
<!--T:403--> | |||
<code>getUnitList($isVisibleOnly, $asArray)</code> | <code>getUnitList($isVisibleOnly, $asArray)</code> | ||
<!--T:404--> | |||
Parameters: | Parameters: | ||
<!--T:405--> | |||
* '''$isVisibleOnly''' Boolean | * '''$isVisibleOnly''' Boolean | ||
* '''$asArray''' Boolean | * '''$asArray''' Boolean | ||
<!--T:406--> | |||
Returns Array. | Returns Array. | ||
<!--T:407--> | |||
Returns list of service performers. If <code>$asArray</code> is false then method returns a map with event id as | Returns list of service performers. If <code>$asArray</code> is false then method returns a map with event id as | ||
key and details object as value. If parameter set to true then method returns a list sorted by 'position' property | key and details object as value. If parameter set to true then method returns a list sorted by 'position' property | ||
| Line 1,549: | Line 1,893: | ||
=== getUnitWorkdayInfo === | === getUnitWorkdayInfo === <!--T:408--> | ||
<!--T:409--> | |||
<code>getUnitWorkdayInfo($dateStart, $dateEnd, $unitGroupId)</code> | <code>getUnitWorkdayInfo($dateStart, $dateEnd, $unitGroupId)</code> | ||
<!--T:410--> | |||
Parameters: | Parameters: | ||
<!--T:411--> | |||
* '''$dateStart''' string | * '''$dateStart''' string | ||
* '''$dateEnd''' string | * '''$dateEnd''' string | ||
* '''$unitGroupId''' integer | * '''$unitGroupId''' integer | ||
<!--T:412--> | |||
Returns Array. | Returns Array. | ||
<!--T:413--> | |||
Return workday info (date_start and date_end) | Return workday info (date_start and date_end) | ||
| Line 1,572: | Line 1,921: | ||
=== getUnitWorkingDurations === | === getUnitWorkingDurations === <!--T:414--> | ||
<!--T:415--> | |||
<code>getUnitWorkingDurations($dateStart, $dateEnd, $unitGroupId)</code> | <code>getUnitWorkingDurations($dateStart, $dateEnd, $unitGroupId)</code> | ||
<!--T:416--> | |||
Parameters: | Parameters: | ||
<!--T:417--> | |||
* '''$dateStart''' string | * '''$dateStart''' string | ||
* '''$dateEnd''' string | * '''$dateEnd''' string | ||
* '''$unitGroupId''' integer | * '''$unitGroupId''' integer | ||
<!--T:418--> | |||
Returns Array. | Returns Array. | ||
<!--T:419--> | |||
Return working durations | Return working durations | ||
| Line 1,595: | Line 1,949: | ||
=== getVisitorStats === | === getVisitorStats === <!--T:420--> | ||
<!--T:421--> | |||
<code>getVisitorStats($groupBy)</code> | <code>getVisitorStats($groupBy)</code> | ||
<!--T:422--> | |||
Parameters: | Parameters: | ||
<!--T:423--> | |||
* '''$groupBy''' String | * '''$groupBy''' String | ||
<!--T:424--> | |||
Returns Array. | Returns Array. | ||
<!--T:425--> | |||
Returns statistics about page visits if Custom Feature [[Custom_Features#Visitor_Counter|Visitor Counter Custom Feature]] enabled. Returns | Returns statistics about page visits if Custom Feature [[Custom_Features#Visitor_Counter|Visitor Counter Custom Feature]] enabled. Returns | ||
an empty list if Custom Feature not enabled. Use <code>[[#isPluginActivated|isPluginActivated('counter')]]</code> API method | an empty list if Custom Feature not enabled. Use <code>[[#isPluginActivated|isPluginActivated('counter')]]</code> API method | ||
| Line 1,621: | Line 1,980: | ||
=== getWarnings === | === getWarnings === <!--T:426--> | ||
<!--T:427--> | |||
<code>getWarnings($lastOnly)</code> | <code>getWarnings($lastOnly)</code> | ||
<!--T:428--> | |||
Parameters: | Parameters: | ||
<!--T:429--> | |||
* '''$lastOnly''' Boolean. Default value is '''false'''. | * '''$lastOnly''' Boolean. Default value is '''false'''. | ||
<!--T:430--> | |||
Returns Array. | Returns Array. | ||
<!--T:431--> | |||
Returns a list of objects represented system warnings. Each warning contains <code>warning_type</code> and <code>warning_text</code> | Returns a list of objects represented system warnings. Each warning contains <code>warning_type</code> and <code>warning_text</code> | ||
properties. <code>warning_text</code> property contains localized message. <code>warning_type</code> can be one of the values: | properties. <code>warning_text</code> property contains localized message. <code>warning_type</code> can be one of the values: | ||
<!--T:432--> | |||
* '''sms_limit''' – warning indicates low amount of SMS credits | * '''sms_limit''' – warning indicates low amount of SMS credits | ||
* '''sheduler_limit''' – warning indicates low amount of available bookings | * '''sheduler_limit''' – warning indicates low amount of available bookings | ||
| Line 1,645: | Line 2,010: | ||
=== getWorkCalendar === | === getWorkCalendar === <!--T:433--> | ||
<!--T:434--> | |||
<code>getWorkCalendar($year, $month, $unitId)</code> | <code>getWorkCalendar($year, $month, $unitId)</code> | ||
<!--T:435--> | |||
Parameters: | Parameters: | ||
<!--T:436--> | |||
* '''$year''' Integer | * '''$year''' Integer | ||
* '''$month''' Integer | * '''$month''' Integer | ||
* '''$unitId''' Integer | * '''$unitId''' Integer | ||
<!--T:437--> | |||
Returns Object. | Returns Object. | ||
<!--T:438--> | |||
Returns company work schedule as array | Returns company work schedule as array | ||
Eg.: <code>{'2014-05-01': {'from': '09:00:00', 'to': '21:00:00', 'is_day_off': '0'}, '2014-05-02': ...}</code> | Eg.: <code>{'2014-05-01': {'from': '09:00:00', 'to': '21:00:00', 'is_day_off': '0'}, '2014-05-02': ...}</code> | ||
| Line 1,669: | Line 2,039: | ||
=== getWorkDaysInfo === | === getWorkDaysInfo === <!--T:439--> | ||
<!--T:440--> | |||
<code>getWorkDaysInfo($from, $to, $unitId, $eventId, $count)</code> | <code>getWorkDaysInfo($from, $to, $unitId, $eventId, $count)</code> | ||
<!--T:441--> | |||
Parameters: | Parameters: | ||
<!--T:442--> | |||
* '''$from''' String | * '''$from''' String | ||
* '''$to''' String | * '''$to''' String | ||
| Line 1,681: | Line 2,054: | ||
* '''$count''' Integer (optional) | * '''$count''' Integer (optional) | ||
<!--T:443--> | |||
Returns Object. | Returns Object. | ||
<!--T:444--> | |||
Returns an information about working hours and break times for specified service and performer for a period | Returns an information about working hours and break times for specified service and performer for a period | ||
between two dates. If only service specified then information about performer (or performers) will be taken from | between two dates. If only service specified then information about performer (or performers) will be taken from | ||
| Line 1,694: | Line 2,069: | ||
</pre> | </pre> | ||
<!--T:445--> | |||
Warning! Method can return a time string '24:00:00' as right edge of time range. This happens in case if time | Warning! Method can return a time string '24:00:00' as right edge of time range. This happens in case if time | ||
range finishes on midnight. | range finishes on midnight. | ||
| Line 1,705: | Line 2,081: | ||
=== getWorkDaysTimes === | === getWorkDaysTimes === <!--T:446--> | ||
<!--T:447--> | |||
<code>getWorkDaysTimes($startDateTime, $endDateTime, $type = 'unit_group')</code> | <code>getWorkDaysTimes($startDateTime, $endDateTime, $type = 'unit_group')</code> | ||
<!--T:448--> | |||
Parameters: | Parameters: | ||
<!--T:449--> | |||
* '''$startDateTime''' string | * '''$startDateTime''' string | ||
* '''$endDateTime''' string | * '''$endDateTime''' string | ||
* '''$type''' string. Optional. Either 'unit_group' or 'event'. | * '''$type''' string. Optional. Either 'unit_group' or 'event'. | ||
<!--T:450--> | |||
Returns Array. | Returns Array. | ||
<!--T:451--> | |||
Return busy time by unit id by Calendar Sync Custom Feature if enabled. Please note that this method may return not actual data because data synchronization between server and Google/Outlook Calendar may take some time and synchronized data are cached for 15 minutes. | Return busy time by unit id by Calendar Sync Custom Feature if enabled. Please note that this method may return not actual data because data synchronization between server and Google/Outlook Calendar may take some time and synchronized data are cached for 15 minutes. | ||
| Line 1,727: | Line 2,108: | ||
=== getWorkload === | === getWorkload === <!--T:452--> | ||
<!--T:453--> | |||
<code>getWorkload($dateStart, $dateEnd, $unitGroupId)</code> | <code>getWorkload($dateStart, $dateEnd, $unitGroupId)</code> | ||
<!--T:454--> | |||
Parameters: | Parameters: | ||
<!--T:455--> | |||
* '''$dateStart''' string | * '''$dateStart''' string | ||
* '''$dateEnd''' string | * '''$dateEnd''' string | ||
* '''$unitGroupId''' integer | * '''$unitGroupId''' integer | ||
<!--T:456--> | |||
Returns Array. | Returns Array. | ||
<!--T:457--> | |||
Return workload data for units in period of time. Workload for each unit represented as array with work hours | Return workload data for units in period of time. Workload for each unit represented as array with work hours | ||
at index 0, confirmed booking hours as load at index 1 and cancelled bookings hours at index 2.Example: | at index 0, confirmed booking hours as load at index 1 and cancelled bookings hours at index 2.Example: | ||
| Line 1,757: | Line 2,143: | ||
=== isPluginActivated === | === isPluginActivated === <!--T:458--> | ||
<!--T:459--> | |||
<code>isPluginActivated($pluginName)</code> | <code>isPluginActivated($pluginName)</code> | ||
<!--T:460--> | |||
Parameters: | Parameters: | ||
<!--T:461--> | |||
* '''$pluginName''' String | * '''$pluginName''' String | ||
<!--T:462--> | |||
Returns Boolean. | Returns Boolean. | ||
<!--T:463--> | |||
Return Custom Feature status true if status active, else false. <var>$pluginName</var> parameter is a Custom Feature identifier.See [[Custom_Features|Custom Features]] page for full Custom Features description. See [[Company_administration_service_methods#Custom_Features.27_identifiers|list of available plugin's names]]. | Return Custom Feature status true if status active, else false. <var>$pluginName</var> parameter is a Custom Feature identifier.See [[Custom_Features|Custom Features]] page for full Custom Features description. See [[Company_administration_service_methods#Custom_Features.27_identifiers|list of available plugin's names]]. | ||
| Line 1,778: | Line 2,169: | ||
=== pluginApproveBookingApprove === | === pluginApproveBookingApprove === <!--T:464--> | ||
<!--T:465--> | |||
<code>pluginApproveBookingApprove($id)</code> | <code>pluginApproveBookingApprove($id)</code> | ||
<!--T:466--> | |||
Parameters: | Parameters: | ||
<!--T:467--> | |||
* '''$id''' Integer | * '''$id''' Integer | ||
<!--T:468--> | |||
Returns Array. | Returns Array. | ||
<!--T:469--> | |||
Sets approve booking status to 'approved' if [[Custom_Features#Approve_Bookings|Approve booking]] Custom Feature enabled and returns | Sets approve booking status to 'approved' if [[Custom_Features#Approve_Bookings|Approve booking]] Custom Feature enabled and returns | ||
list of approved booking IDs. Returns false if Custom Feature not enabled. Use <code>[[#isPluginActivated|isPluginActivated('approve_booking')]]</code> | list of approved booking IDs. Returns false if Custom Feature not enabled. Use <code>[[#isPluginActivated|isPluginActivated('approve_booking')]]</code> | ||
| Line 1,801: | Line 2,197: | ||
=== pluginApproveBookingCancel === | === pluginApproveBookingCancel === <!--T:470--> | ||
<!--T:471--> | |||
<code>pluginApproveBookingCancel($id)</code> | <code>pluginApproveBookingCancel($id)</code> | ||
<!--T:472--> | |||
Parameters: | Parameters: | ||
<!--T:473--> | |||
* '''$id''' Integer | * '''$id''' Integer | ||
<!--T:474--> | |||
Returns Boolean. | Returns Boolean. | ||
<!--T:475--> | |||
Sets approve booking status to 'canceled' if [[Custom_Features#Approve_Bookings|Approve bookings]] Custom Feature enabled and returns | Sets approve booking status to 'canceled' if [[Custom_Features#Approve_Bookings|Approve bookings]] Custom Feature enabled and returns | ||
true. Returns false if Custom Feature not enabled. Use <code>[[#isPluginActivated|isPluginActivated('approve_booking')]]</code> | true. Returns false if Custom Feature not enabled. Use <code>[[#isPluginActivated|isPluginActivated('approve_booking')]]</code> | ||
| Line 1,824: | Line 2,225: | ||
=== pluginApproveGetPendingBookings === | === pluginApproveGetPendingBookings === <!--T:476--> | ||
<!--T:477--> | |||
<code>pluginApproveGetPendingBookings()</code> | <code>pluginApproveGetPendingBookings()</code> | ||
<!--T:478--> | |||
No arguments. | No arguments. | ||
Returns array. | Returns array. | ||
<!--T:479--> | |||
Returns list of objects with information about bookings pending approval if [[Custom_Features#Approve_Bookings|Approve bookings]] | Returns list of objects with information about bookings pending approval if [[Custom_Features#Approve_Bookings|Approve bookings]] | ||
Custom Feature enabled. Returns empty list if Custom Feature not enabled. Use <code>[[#isPluginActivated|isPluginActivated('approve_booking')]]</code> | Custom Feature enabled. Returns empty list if Custom Feature not enabled. Use <code>[[#isPluginActivated|isPluginActivated('approve_booking')]]</code> | ||
| Line 1,844: | Line 2,248: | ||
=== pluginApproveGetPendingBookingsCount === | === pluginApproveGetPendingBookingsCount === <!--T:480--> | ||
<!--T:481--> | |||
<code>pluginApproveGetPendingBookingsCount()</code> | <code>pluginApproveGetPendingBookingsCount()</code> | ||
<!--T:482--> | |||
No arguments. | No arguments. | ||
Returns Integer. | Returns Integer. | ||
<!--T:483--> | |||
Returns count of bookings pending approval if [[Custom_Features#Approve_Bookings|Approve bookings]] Custom Feature enabled. Returns | Returns count of bookings pending approval if [[Custom_Features#Approve_Bookings|Approve bookings]] Custom Feature enabled. Returns | ||
0 if Custom Feature not enabled. Use <code>[[#isPluginActivated|isPluginActivated('approve_booking')]]</code> API method | 0 if Custom Feature not enabled. Use <code>[[#isPluginActivated|isPluginActivated('approve_booking')]]</code> API method | ||
| Line 1,864: | Line 2,271: | ||
=== setBookingComment === | === setBookingComment === <!--T:484--> | ||
<!--T:485--> | |||
<code>setBookingComment($id, $comment)</code> | <code>setBookingComment($id, $comment)</code> | ||
<!--T:486--> | |||
Parameters: | Parameters: | ||
<!--T:487--> | |||
* '''$id''' Integer | * '''$id''' Integer | ||
* '''$comment''' String | * '''$comment''' String | ||
<!--T:488--> | |||
Returns Integer. | Returns Integer. | ||
<!--T:489--> | |||
Set booking comment | Set booking comment | ||
| Line 1,885: | Line 2,297: | ||
=== getBookingStatus === | === getBookingStatus === <!--T:490--> | ||
<!--T:491--> | |||
<code>getBookingStatus ($bookingId)</code> | <code>getBookingStatus ($bookingId)</code> | ||
<!--T:492--> | |||
Parameters: | Parameters: | ||
<!--T:493--> | |||
* '''$bookingId''' Integer | * '''$bookingId''' Integer | ||
<!--T:494--> | |||
Returns Array. | Returns Array. | ||
<!--T:495--> | |||
Returns an object of status of given booking (if status plugin is enabled) | Returns an object of status of given booking (if status plugin is enabled) | ||
default status will be returned if bookingId does not exists | default status will be returned if bookingId does not exists | ||
| Line 1,906: | Line 2,323: | ||
=== setStatus === | === setStatus === <!--T:496--> | ||
<!--T:497--> | |||
<code>setStatus($bookingId, $statusId)</code> | <code>setStatus($bookingId, $statusId)</code> | ||
<!--T:498--> | |||
Parameters: | Parameters: | ||
<!--T:499--> | |||
* '''$bookingId''' Integer | * '''$bookingId''' Integer | ||
* '''$statusId''' Integer | * '''$statusId''' Integer | ||
<!--T:500--> | |||
Returns Boolean. | Returns Boolean. | ||
<!--T:501--> | |||
Sets specified status for booking. Returns an error with code -32020 if logged in user don't have access to edit | Sets specified status for booking. Returns an error with code -32020 if logged in user don't have access to edit | ||
bookings. This method does nothing if [[Custom_Features#Status|Status Custom feature]] not enabled. | bookings. This method does nothing if [[Custom_Features#Status|Status Custom feature]] not enabled. | ||
| Line 1,929: | Line 2,351: | ||
=== updateNotification === | === updateNotification === <!--T:502--> | ||
<!--T:503--> | |||
<code>updateNotification($type)</code> | <code>updateNotification($type)</code> | ||
<!--T:504--> | |||
Parameters: | Parameters: | ||
<!--T:505--> | |||
* '''$type''' String | * '''$type''' String | ||
<!--T:506--> | |||
Returns . | Returns . | ||
<!--T:507--> | |||
Mark notifications as readed | Mark notifications as readed | ||
| Line 1,950: | Line 2,377: | ||
=== setWorkDayInfo=== | === setWorkDayInfo=== <!--T:508--> | ||
<!--T:509--> | |||
<code>setWorkDayInfo($info)</code> | <code>setWorkDayInfo($info)</code> | ||
<!--T:510--> | |||
Parameters: | Parameters: | ||
<!--T:511--> | |||
* '''$info''' Array | * '''$info''' Array | ||
<!--T:512--> | |||
Returns true on success | Returns true on success | ||
<!--T:513--> | |||
Set work day schedule for company|service|provider for week_day|date | Set work day schedule for company|service|provider for week_day|date | ||
<!--T:514--> | |||
Example: | Example: | ||
<pre> | <pre> | ||
| Line 1,976: | Line 2,409: | ||
} | } | ||
<!--T:515--> | |||
index is 1-7 for Monday - Sunday (used for weekly settings) | index is 1-7 for Monday - Sunday (used for weekly settings) | ||
date is used to set worktime for special date | date is used to set worktime for special date | ||
| Line 1,991: | Line 2,425: | ||
=== deleteSpecialDay=== | === deleteSpecialDay=== <!--T:516--> | ||
<!--T:517--> | |||
<code>deleteSpecialDay($date, $params = null)</code> | <code>deleteSpecialDay($date, $params = null)</code> | ||
<!--T:518--> | |||
Parameters: | Parameters: | ||
<!--T:519--> | |||
* '''$date''' String | * '''$date''' String | ||
* '''$params''' Array | * '''$params''' Array | ||
<!--T:520--> | |||
Returns true on success | Returns true on success | ||
<!--T:521--> | |||
Delete special date if set | Delete special date if set | ||
<!--T:522--> | |||
Example: | Example: | ||
<pre> | <pre> | ||
| Line 2,020: | Line 2,460: | ||
<translate> | <translate> | ||
=== addServiceProvider=== | === addServiceProvider=== <!--T:523--> | ||
<!--T:524--> | |||
<code>addServiceProvider($data)</code> | <code>addServiceProvider($data)</code> | ||
<!--T:525--> | |||
Parameters: | Parameters: | ||
<!--T:526--> | |||
* '''$data''' Array | * '''$data''' Array | ||
<!--T:527--> | |||
Returns Array with result and id of new service provider (unit_group) | Returns Array with result and id of new service provider (unit_group) | ||
<!--T:528--> | |||
Create new service provider | Create new service provider | ||
<!--T:529--> | |||
Example: | Example: | ||
<pre> | <pre> | ||
| Line 2,056: | Line 2,502: | ||
=== editServiceProvider=== | === editServiceProvider=== <!--T:530--> | ||
<!--T:531--> | |||
<code>editServiceProvider($id, $data)</code> | <code>editServiceProvider($id, $data)</code> | ||
<!--T:532--> | |||
Parameters: | Parameters: | ||
<!--T:533--> | |||
* '''$id''' Integer | * '''$id''' Integer | ||
* '''$data''' Array | * '''$data''' Array | ||
<!--T:534--> | |||
Returns Array with result and id of new service provider (unit_group) | Returns Array with result and id of new service provider (unit_group) | ||
<!--T:535--> | |||
Edit service provider | Edit service provider | ||
(there is no way to delete provider via API, in this case set is_active = 0) | (there is no way to delete provider via API, in this case set is_active = 0) | ||
<!--T:536--> | |||
Example: | Example: | ||
<pre> | <pre> | ||
| Line 2,088: | Line 2,540: | ||
</pre> | </pre> | ||
<!--T:537--> | |||
- | - | ||
</translate> | </translate> | ||
| Line 2,096: | Line 2,549: | ||
== Constants == | == Constants == <!--T:538--> | ||
=== Error codes === | === Error codes === <!--T:539--> | ||
<!--T:540--> | |||
See [[Errors handling]] for details. | See [[Errors handling]] for details. | ||
<!--T:541--> | |||
* -32001 Custom Feature is not activated | * -32001 Custom Feature is not activated | ||
* -32010 Some required params are missed | * -32010 Some required params are missed | ||
| Line 2,150: | Line 2,605: | ||
===Company params=== | ===Company params=== <!--T:542--> | ||
<!--T:543--> | |||
Use these values to get configuration params for company with <code>[[#getCompanyParam|getCompanyParam]]</code> API method. | Use these values to get configuration params for company with <code>[[#getCompanyParam|getCompanyParam]]</code> API method. | ||
=====General params===== | =====General params===== <!--T:544--> | ||
<!--T:545--> | |||
Administration API inherits all [[Company public service methods#Company_params|keys]] allowed for public API and extends this list with keys: | Administration API inherits all [[Company public service methods#Company_params|keys]] allowed for public API and extends this list with keys: | ||
<!--T:546--> | |||
* attach_ical | * attach_ical | ||
* auto_redirect | * auto_redirect | ||
| Line 2,296: | Line 2,754: | ||
<translate> | <translate> | ||
=====Accept payments Custom Feature params===== | =====Accept payments Custom Feature params===== <!--T:547--> | ||
<!--T:548--> | |||
Read more about [[Custom_Features#Accept_Payments|Accept Payments Custom Feature configuration]]. | Read more about [[Custom_Features#Accept_Payments|Accept Payments Custom Feature configuration]]. | ||
<!--T:549--> | |||
* allow_delay_payment | * allow_delay_payment | ||
*: Allow delay payment option. Boolean. | *: Allow delay payment option. Boolean. | ||
| Line 2,335: | Line 2,795: | ||
<translate> | <translate> | ||
=====Term & Conditions Custom Feature params===== | =====Term & Conditions Custom Feature params===== <!--T:550--> | ||
<!--T:551--> | |||
Read more about [[Custom_Features#Terms_and_Conditions|Terms and Conditions Custom Feature]]. | Read more about [[Custom_Features#Terms_and_Conditions|Terms and Conditions Custom Feature]]. | ||
<!--T:552--> | |||
* user_license_text | * user_license_text | ||
*: Terms and conditions text. String. | *: Terms and conditions text. String. | ||
| Line 2,350: | Line 2,812: | ||
===Custom Features' identifiers=== | ===Custom Features' identifiers=== <!--T:553--> | ||
<!--T:554--> | |||
Custom Feature identifier is a string constant which represents a Custom Feature in system. These constants used in <code>[[#isPluginActivated|isPluginActivated]]</code> and <code>[[#getPluginStatuses|getPluginStatuses]]</code> API methods. | Custom Feature identifier is a string constant which represents a Custom Feature in system. These constants used in <code>[[#isPluginActivated|isPluginActivated]]</code> and <code>[[#getPluginStatuses|getPluginStatuses]]</code> API methods. | ||
<!--T:555--> | |||
* advanced_notification | * advanced_notification | ||
*:Book Soon notification system | *:Book Soon notification system | ||
| Line 2,417: | Line 2,881: | ||
*:Cancellation Policy | *:Cancellation Policy | ||
<!--T:556--> | |||
See [[Custom_Features|Custom Features]] page for description for each Custom Feature. | See [[Custom_Features|Custom Features]] page for description for each Custom Feature. | ||
| Line 2,422: | Line 2,887: | ||
<translate> | <translate> | ||
== Examples == | == Examples == <!--T:557--> | ||
====getBookingDetails response==== | ====getBookingDetails response==== <!--T:558--> | ||
<!--T:559--> | |||
An example of data returned by [[#getBookingDetails|getBookingDetails]] API method. | An example of data returned by [[#getBookingDetails|getBookingDetails]] API method. | ||
{ | <!--T:560--> | ||
{ | |||
"id": "321", | "id": "321", | ||
"event_id": "5", | "event_id": "5", | ||
| Line 2,500: | Line 2,967: | ||
<translate> | <translate> | ||
<!--T:561--> | |||
Location field is present in response only if [[Custom_Features#Multiple_Locations|Multiple locations Custom Feature]] is enabled. Otherwise this field will be an empty array. If locations Custom Feature is enabled but booking doesn't have any locations this fields also will be an empty array. | Location field is present in response only if [[Custom_Features#Multiple_Locations|Multiple locations Custom Feature]] is enabled. Otherwise this field will be an empty array. If locations Custom Feature is enabled but booking doesn't have any locations this fields also will be an empty array. | ||
<!--T:562--> | |||
Status field is present in response only if [[Custom_Features#Status|Status Custom Feature]] is enabled. Otherwise this field will be an empty array. If Custom Feature enabled but booking doesn't have any statues specified the default status returned. | Status field is present in response only if [[Custom_Features#Status|Status Custom Feature]] is enabled. Otherwise this field will be an empty array. If Custom Feature enabled but booking doesn't have any statues specified the default status returned. | ||
<!--T:563--> | |||
Price field is present in response only if [[Custom_Features#Accept_Payments|Accept payments Custom Feature]] is enabled. Otherwise this field will be an empty array. This field contains an empty array if Custom Feature is enabled but booking was created for a free service. | Price field is present in response only if [[Custom_Features#Accept_Payments|Accept payments Custom Feature]] is enabled. Otherwise this field will be an empty array. This field contains an empty array if Custom Feature is enabled but booking was created for a free service. | ||
<!--T:564--> | |||
<!--Promo field is present in response only if [[Rewards_and_Referrals_custom_feature|Rewards and Referrals Custom Feature]] is enabled. Otherwise this field will be an empty array. This field contains false if Custom Feature is enabled but booking was created without any promo codes. | <!--Promo field is present in response only if [[Rewards_and_Referrals_custom_feature|Rewards and Referrals Custom Feature]] is enabled. Otherwise this field will be an empty array. This field contains false if Custom Feature is enabled but booking was created without any promo codes. | ||
--> | --> | ||
| Line 2,518: | Line 2,989: | ||
====book response==== | ====book response==== <!--T:565--> | ||
<!--T:566--> | |||
[[#book|<code>book</code>]] API method returns an object which contains list of objects with short description of newly create bookings. Method returns only one item in 'bookings' array for regular appointment and more than one item for recurring or batch bookings. | [[#book|<code>book</code>]] API method returns an object which contains list of objects with short description of newly create bookings. Method returns only one item in 'bookings' array for regular appointment and more than one item for recurring or batch bookings. | ||
{ | <!--T:567--> | ||
{ | |||
"require_confirm":false, | "require_confirm":false, | ||
"bookings":[ | "bookings":[ | ||
| Line 2,581: | Line 3,054: | ||
<translate> | <translate> | ||
====getCompanyInfo response==== | ====getCompanyInfo response==== <!--T:568--> | ||
<!--T:569--> | |||
An example of data returned by [[#getCompanyInfo|getCompanyInfo]] API method. | An example of data returned by [[#getCompanyInfo|getCompanyInfo]] API method. | ||
{ | <!--T:570--> | ||
{ | |||
"login": "pierrecoetzee", | "login": "pierrecoetzee", | ||
"name": "Pierre", | "name": "Pierre", | ||
| Line 2,610: | Line 3,085: | ||
} | } | ||
<!--T:571--> | |||
<code>timeline_type</code> field can be one the following values: | <code>timeline_type</code> field can be one the following values: | ||
<!--T:572--> | |||
* flexible | * flexible | ||
* modern | * modern | ||
| Line 2,622: | Line 3,099: | ||
<translate> | <translate> | ||
<!--T:573--> | |||
Please note that <code>classic</code> timeline type is deprecated and not supported anymore. | Please note that <code>classic</code> timeline type is deprecated and not supported anymore. | ||
<!--T:574--> | |||
<code>description</code> field contains raw data of company's description which can include HTML tags. <code>description_text</code> field contains only text information without HTML tags. | <code>description</code> field contains raw data of company's description which can include HTML tags. <code>description_text</code> field contains only text information without HTML tags. | ||
<!--T:575--> | |||
For information about <code> timeframe</code>, <code>timezone</code>, <code>allow_event_day_break</code> and <code>allow_event_breaktime_break</code> see [[#Company params|Company params section]]. | For information about <code> timeframe</code>, <code>timezone</code>, <code>allow_event_day_break</code> and <code>allow_event_breaktime_break</code> see [[#Company params|Company params section]]. | ||
| Line 2,633: | Line 3,113: | ||
<translate> | <translate> | ||
<!--T:576--> | |||
<!--====getPluginPromoInfoByCode response==== | <!--====getPluginPromoInfoByCode response==== | ||
{ | <!--T:577--> | ||
{ | |||
"id": "1", | "id": "1", | ||
"title": "[service\/services] with [discount]% discount!", | "title": "[service\/services] with [discount]% discount!", | ||
| Line 2,660: | Line 3,142: | ||
} | } | ||
<!--T:578--> | |||
<code>service_ids</code> contains a list of services for wich promotion discount can be applied. | <code>service_ids</code> contains a list of services for wich promotion discount can be applied. | ||
</translate> | </translate> | ||