Company administration service methods: Difference between revisions

No edit summary
No edit summary
Line 1: Line 1:
<languages/>
<translate>
{{#seo:
{{#seo:
|title=Company administration service methods - SimplyBook.me
|title=Company administration service methods - SimplyBook.me
Line 6: Line 9:
}}
}}


</translate>
<translate>


==General Information==
==General Information==


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:
</translate>
<translate>


* <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>
Line 15: Line 25:
* <code>params</code> - An Array of objects to be passed as parameters to the defined method.
* <code>params</code> - An Array of objects to be passed as parameters to the defined method.
* <code>id</code> - A value of any type, which is used to match the response with the request that it is replying to.
* <code>id</code> - A value of any type, which is used to match the response with the request that it is replying to.
</translate>
<translate>


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.
Line 21: Line 35:
* <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.
* <code>id</code> - The id of the request it is responding to.
* <code>id</code> - The id of the request it is responding to.
</translate>
<translate>


Example
Example
Line 58: Line 76:
   }
   }
</pre>
</pre>
</translate>
<translate>


Example of request with error response:
Example of request with error response:
Line 80: Line 102:
   }
   }
</pre>
</pre>
</translate>
<translate>


All calls of public service methods should have additional HTTP header:
All calls of public service methods should have additional HTTP header:
Line 106: Line 132:


Returns Integer.
Returns Integer.
</translate>
<translate>


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,
Line 131: Line 161:
   }
   }


</translate>
<translate>


----
----
Line 150: Line 184:


----
----
</translate>
<translate>


=== book ===
=== book ===
Line 171: Line 208:


Returns Object.
Returns Object.
</translate>
<translate>


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
Line 186: Line 227:
specify either <code>count</code> more then 1 or valid <code>batchId</code> (only one parameter can be
specify either <code>count</code> more then 1 or valid <code>batchId</code> (only one parameter can be
specified). You should specify an <code>$additionalFields</code> parameter if service requires some intake forms (see [[Custom_Features#Intake_Forms|Intake Forms Custom feature]]).To create a booking with promo code you should pass it as additional field. For example: <code>{"promocode": "some code"}</code>
specified). You should specify an <code>$additionalFields</code> parameter if service requires some intake forms (see [[Custom_Features#Intake_Forms|Intake Forms Custom feature]]).To create a booking with promo code you should pass it as additional field. For example: <code>{"promocode": "some code"}</code>
</translate>
<translate>


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
Line 199: Line 244:


----
----
</translate>
<translate>


=== calculateEndTime ===
=== calculateEndTime ===
Line 216: Line 265:


----
----
</translate>
<translate>


=== cancelBatch ===
=== cancelBatch ===
Line 234: Line 287:


----
----
</translate>
<translate>


=== cancelBooking ===
=== cancelBooking ===
Line 250: Line 307:


----
----
</translate>
<translate>


=== createBatch ===
=== createBatch ===
Line 263: Line 324:


----
----
</translate>
<translate>


=== deleteDeviceToken ===
=== deleteDeviceToken ===
Line 278: Line 343:


----
----
</translate>
<translate>


=== editBook ===
=== editBook ===
Line 303: Line 371:


----
----
</translate>
<translate>


=== editClient ===
=== editClient ===
Line 319: Line 391:


----
----
</translate>
<translate>


=== filterAvailableUnits ===
=== filterAvailableUnits ===
Line 339: Line 415:


----
----
</translate>
<translate>


=== getAdditionalFields ===
=== getAdditionalFields ===
Line 356: Line 436:


----
----
</translate>
<translate>


=== getAnyUnitData ===
=== getAnyUnitData ===
Line 377: Line 461:


----
----
</translate>
<translate>


=== getAvailableTimeIntervals ===
=== getAvailableTimeIntervals ===
Line 397: Line 485:


----
----
</translate>
<translate>


=== getAvailableUnits ===
=== getAvailableUnits ===
Line 414: Line 506:


----
----
</translate>
<translate>


=== getBookingCancellationsInfo ===
=== getBookingCancellationsInfo ===
Line 450: Line 546:


----
----
</translate>
<translate>


=== getBookingComment ===
=== getBookingComment ===
Line 465: Line 565:


----
----
</translate>
<translate>


=== getBookingDetails ===
=== getBookingDetails ===
Line 480: Line 584:


----
----
</translate>
<translate>


=== getBookingLimitUnavailableTimeInterval ===
=== getBookingLimitUnavailableTimeInterval ===
Line 498: Line 606:


----
----
</translate>
<translate>


=== getBookingRevenue ===
=== getBookingRevenue ===
Line 523: Line 635:


----
----
</translate>
<translate>


=== getBookingStats ===
=== getBookingStats ===
Line 541: Line 657:


----
----
</translate>
<translate>


=== getBookings ===
=== getBookings ===
Line 588: Line 708:


----
----
</translate>
<translate>


=== getBookingsZapier ===
=== getBookingsZapier ===
Line 600: Line 724:


----
----
</translate>
<translate>


=== getCategoriesList ===
=== getCategoriesList ===
Line 617: Line 745:


----
----
</translate>
<translate>


=== getClient ===
=== getClient ===
Line 633: Line 765:


----
----
</translate>
<translate>


=== getClientComments ===
=== getClientComments ===
Line 649: Line 785:


----
----
</translate>
<translate>


=== getClientList ===
=== getClientList ===
Line 668: Line 808:


----
----
</translate>
<translate>


=== getCompanyCurrency ===
=== getCompanyCurrency ===
Line 680: Line 824:


----
----
</translate>
<translate>


=== getCompanyInfo ===
=== getCompanyInfo ===
Line 692: Line 840:


----
----
</translate>
<translate>


=== getCompanyParam ===
=== getCompanyParam ===
Line 709: Line 861:


----
----
</translate>
<translate>


=== getCompanyParams ===
=== getCompanyParams ===
Line 726: Line 882:


----
----
</translate>
<translate>


=== getCompanyTimezoneOffset ===
=== getCompanyTimezoneOffset ===
Line 738: Line 898:


----
----
</translate>
<translate>


=== getCountryList ===
=== getCountryList ===
Line 750: Line 914:


----
----
</translate>
<translate>


=== getCountryPhoneCodes ===
=== getCountryPhoneCodes ===
Line 762: Line 930:


----
----
</translate>
<translate>


=== getCurrentTariffInfo ===
=== getCurrentTariffInfo ===
Line 779: Line 951:


----
----
</translate>
<translate>


=== getCurrentUserDetails ===
=== getCurrentUserDetails ===
Line 822: Line 998:


----
----
</translate>
<translate>


=== getEventList ===
=== getEventList ===
Line 840: Line 1,020:


----
----
</translate>
<translate>


=== getFeedbacks ===
=== getFeedbacks ===
Line 858: Line 1,042:


----
----
</translate>
<translate>


=== getFirstWorkingDay ===
=== getFirstWorkingDay ===
Line 873: Line 1,061:


----
----
</translate>
<translate>


=== getGoogleCalendarBusyTime ===
=== getGoogleCalendarBusyTime ===
Line 904: Line 1,096:


----
----
</translate>
<translate>


=== getGoogleCalendarBusyTimeAvailableUnits ===
=== getGoogleCalendarBusyTimeAvailableUnits ===
Line 916: Line 1,112:


----
----
</translate>
<translate>


=== getLastNotificationUpdate ===
=== getLastNotificationUpdate ===
Line 931: Line 1,131:


----
----
</translate>
<translate>


=== getLocationsList ===
=== getLocationsList ===
Line 952: Line 1,156:


----
----
</translate>
<translate>


=== getPluginList ===
=== getPluginList ===
Line 964: Line 1,172:


----
----
</translate>
<translate>


<!---=== getPluginPromoInfoByCode ===
<!---=== getPluginPromoInfoByCode ===
Line 981: Line 1,193:
response contains a list of services for wich promotion discount can be applied (<code>service_ids</code> key).
response contains a list of services for wich promotion discount can be applied (<code>service_ids</code> key).
--->
--->
</translate>
----
----
<translate>


=== getPluginStatuses ===
=== getPluginStatuses ===
Line 995: Line 1,212:
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]].


</translate>


----
----
<translate>


=== getRecentActions ===
=== getRecentActions ===
Line 1,011: Line 1,232:
Returns latest actions
Returns latest actions


</translate>


----
----
<translate>


=== getRecurringDatetimes ===
=== getRecurringDatetimes ===
Line 1,031: Line 1,257:
Get list of dates for recurring booking
Get list of dates for recurring booking


</translate>


----
----
<translate>


=== getRecurringSettings ===
=== getRecurringSettings ===
Line 1,050: Line 1,280:


* [http://blog.simplybook.me/recurring-and-periodic-bookings/ Recurring services desription]
* [http://blog.simplybook.me/recurring-and-periodic-bookings/ Recurring services desription]
</translate>


----
----
<translate>


=== getRegistrations ===
=== getRegistrations ===
Line 1,068: Line 1,304:
* for 'month' time period is last 12 months
* for 'month' time period is last 12 months


</translate>


----
----
<translate>


=== getReservedTime ===
=== getReservedTime ===
Line 1,116: Line 1,358:
</pre>
</pre>


</translate>


----
----
<translate>


=== getReservedTimeIntervals ===
=== getReservedTimeIntervals ===
Line 1,136: Line 1,384:
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>


</translate>


----
----
<translate>


=== getSocialCounterStats ===
=== getSocialCounterStats ===
Line 1,151: Line 1,405:
Returns social counters value for your domain
Returns social counters value for your domain


</translate>


----
----
<translate>


=== getStartTimeMatrix ===
=== getStartTimeMatrix ===
Line 1,175: Line 1,435:
more details.
more details.


</translate>


----
----
<translate>


=== getStatuses ===
=== getStatuses ===
Line 1,187: Line 1,453:
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.


</translate>


----
----
<translate>


=== getTimeframe ===
=== getTimeframe ===
Line 1,199: Line 1,471:
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]].


</translate>


----
----
<translate>


=== getTimelineType ===
=== getTimelineType ===
Line 1,211: Line 1,489:
Returns company calendar layout type
Returns company calendar layout type


</translate>


----
----
<translate>


=== getTopPerformers ===
=== getTopPerformers ===
Line 1,223: Line 1,507:
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.


</translate>


----
----
<translate>


=== getTopServices ===
=== getTopServices ===
Line 1,240: Line 1,530:
revenues value for each service.
revenues value for each service.


</translate>


----
----
<translate>


=== getUnitList ===
=== getUnitList ===
Line 1,258: Line 1,554:
of event's details object.
of event's details object.


</translate>


----
----
<translate>


=== getUnitWorkdayInfo ===
=== getUnitWorkdayInfo ===
Line 1,275: Line 1,577:
Return workday info (date_start and date_end)
Return workday info (date_start and date_end)


</translate>


----
----
<translate>


=== getUnitWorkingDurations ===
=== getUnitWorkingDurations ===
Line 1,292: Line 1,600:
Return working durations
Return working durations


</translate>


----
----
<translate>


=== getVisitorStats ===
=== getVisitorStats ===
Line 1,312: Line 1,626:
* for 'month' time period is last 12 months
* for 'month' time period is last 12 months


</translate>


----
----
<translate>


=== getWarnings ===
=== getWarnings ===
Line 1,330: Line 1,650:
* '''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
</translate>


----
----
<translate>


=== getWorkCalendar ===
=== getWorkCalendar ===
Line 1,348: Line 1,674:
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>


</translate>


----
----
<translate>


=== getWorkDaysInfo ===
=== getWorkDaysInfo ===
Line 1,379: Line 1,711:
range finishes on midnight.
range finishes on midnight.


</translate>


----
----
<translate>


=== getWorkDaysTimes ===
=== getWorkDaysTimes ===
Line 1,395: Line 1,732:


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.
</translate>


----
----
<translate>


=== getWorkload ===
=== getWorkload ===
Line 1,419: Line 1,762:
   ] }]
   ] }]


</translate>


----
----


=== isPluginActivated ===
<translate>
 
 
=== isPluginActivated ===


<code>isPluginActivated($pluginName)</code>
<code>isPluginActivated($pluginName)</code>
Line 1,434: Line 1,783:
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]].


</translate>


----
----
<translate>


=== pluginApproveBookingApprove ===
=== pluginApproveBookingApprove ===
Line 1,451: Line 1,806:
API method call to check if Custom Feature enabled.
API method call to check if Custom Feature enabled.


</translate>


----
----
<translate>


=== pluginApproveBookingCancel ===
=== pluginApproveBookingCancel ===
Line 1,468: Line 1,829:
API method call to check if Custom Feature enabled.
API method call to check if Custom Feature enabled.


</translate>


----
----
<translate>


=== pluginApproveGetPendingBookings ===
=== pluginApproveGetPendingBookings ===
Line 1,482: Line 1,849:
API method call to check if Custom Feature enabled.
API method call to check if Custom Feature enabled.


</translate>


----
----
<translate>


=== pluginApproveGetPendingBookingsCount ===
=== pluginApproveGetPendingBookingsCount ===
Line 1,496: Line 1,869:
call to check if Custom Feature enabled.
call to check if Custom Feature enabled.


</translate>


----
----
<translate>


=== setBookingComment ===
=== setBookingComment ===
Line 1,512: Line 1,891:
Set booking comment
Set booking comment


</translate>


----
----
<translate>
=== getBookingStatus ===
=== getBookingStatus ===


Line 1,526: Line 1,911:
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
</translate>


----
----
<translate>


=== setStatus ===
=== setStatus ===
Line 1,544: Line 1,935:




----
 
</translate>
 
----
 
<translate>
 


=== updateNotification ===
=== updateNotification ===
Line 1,558: Line 1,955:
Mark notifications as readed
Mark notifications as readed


</translate>


----
----
<translate>


=== setWorkDayInfo===
=== setWorkDayInfo===
Line 1,593: Line 1,996:
if unit_group_id and event_id not passed then it set data for company
if unit_group_id and event_id not passed then it set data for company
</pre>
</pre>
</translate>


----
----
<translate>


=== deleteSpecialDay===
=== deleteSpecialDay===
Line 1,617: Line 2,026:
}
}
</pre>
</pre>
</translate>


----
----
<translate>
=== addServiceProvider===
=== addServiceProvider===


Line 1,646: Line 2,061:
}
}
</pre>
</pre>
</translate>


----
----
<translate>


=== editServiceProvider===
=== editServiceProvider===
Line 1,680: Line 2,101:
}
}
</pre>
</pre>
-
</translate>


----
----
<translate>


== Constants ==
== Constants ==
Line 1,728: Line 2,155:
* -32603 Internal error
* -32603 Internal error
* -3264 Client with given id not found
* -3264 Client with given id not found
</translate>


----
----
<translate>


===Company params===
===Company params===
Line 1,870: Line 2,303:
* user_public_theme
* user_public_theme
* waiting_video
* waiting_video
</translate>
----
<translate>


=====Accept payments Custom Feature params=====
=====Accept payments Custom Feature params=====
Line 1,903: Line 2,342:
* liqpay_merchant_id
* liqpay_merchant_id
* liqpay_merchant_pass
* liqpay_merchant_pass
</translate>
----
<translate>


=====Term & Conditions Custom Feature params=====
=====Term & Conditions Custom Feature params=====
Line 1,910: Line 2,355:
* user_license_text
* user_license_text
*: Terms and conditions text. String.
*: Terms and conditions text. String.
</translate>


----
----
<translate>


===Custom Features' identifiers===
===Custom Features' identifiers===
Line 1,981: Line 2,432:


See [[Custom_Features|Custom Features]] page for description for each Custom Feature.
See [[Custom_Features|Custom Features]] page for description for each Custom Feature.
</translate>


----
----
<translate>


== Examples ==
== Examples ==
Line 2,056: Line 2,513:
     "promo": false
     "promo": false
   }
   }
</translate>
----
<translate>


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.
Line 2,066: Line 2,530:
-->
-->
<code>additional_fields</code> field is present in response only if [[Custom_Features#Intake_Forms|Intake Forms 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 service with no intake forms.
<code>additional_fields</code> field is present in response only if [[Custom_Features#Intake_Forms|Intake Forms 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 service with no intake forms.
</translate>


----
----
<translate>


====book response====
====book response====
Line 2,125: Line 2,595:
     "batch_hash":"357178bce290381bb7235080941ec143"
     "batch_hash":"357178bce290381bb7235080941ec143"
   }
   }
</translate>
----
<translate>


====getCompanyInfo response====
====getCompanyInfo response====
Line 2,164: Line 2,640:
* classes
* classes


</translate>
----
<translate>


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.
Line 2,171: Line 2,653:
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]].
----
----
</translate>
----
<translate>


<!--====getPluginPromoInfoByCode response====
<!--====getPluginPromoInfoByCode response====
Line 2,201: Line 2,689:
<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>