Company public service methods: Difference between revisions
No edit summary |
|||
| Line 84: | Line 84: | ||
===Authentication=== | ===Authentication=== | ||
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#getToken|getToken]]</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 ' | 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#getToken|getToken]]</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 == | ||
| Line 120: | Line 120: | ||
create batch booking you can specify either <code>count</code> more then 1 or valid <code>batchId</code> (only one | create batch booking you can 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 | parameter can be specified). You should specify an <code>$additionalFields</code> parameter if service requires | ||
some additional fields (see [[ | some additional fields (see [[Custom_Features#Additional_Fields|Additional fields Custom feature]]). To create a booking with promo code you | ||
should pass it as additional field. For example: <code>{"name": "promocode", "value": "some code", "type": "text"}</code>See [[#book response|example]] of <code>book</code> API method response. | should pass it as additional field. For example: <code>{"name": "promocode", "value": "some code", "type": "text"}</code>See [[#book response|example]] of <code>book</code> API method response. | ||
| Line 280: | Line 280: | ||
Returns Array. | Returns Array. | ||
Returns list of available unit ids for specified date and service from provided $unitIds list.You can use this method with location | 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. | ||
Eg.: <code>[1, 2, 3]</code> | Eg.: <code>[1, 2, 3]</code> | ||
| Line 297: | Line 297: | ||
Returns Array. | Returns Array. | ||
Return additional fields for certain event if [[ | Return additional fields for certain event if [[Custom_Features#Additional_Fields|Additional fields 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> | ||
API method to check if 'event_field' | API method to check if 'event_field' Custom Feature activated. | ||
| Line 311: | Line 311: | ||
Returns Object|null. | Returns Object|null. | ||
Returns information about [[ | Returns information about [[Custom_Features#Any_Employee_Selector|Any Employee Selector Custom Feature]] configuration. Returns | ||
null if | null if Custom Feature not enabled.Example: | ||
{ | { | ||
"description" : "Select this option, if you want to find an available time with any of the employees", | "description" : "Select this option, if you want to find an available time with any of the employees", | ||
| Line 437: | Line 437: | ||
Returns Array. | Returns Array. | ||
Returns company categories list if [[ | Returns company categories list if [[Custom_Features#Service_Categories|Service Categories Custom Feature]] is activated. Returns | ||
an error with code -32001 if | an error with code -32001 if Custom Feature is not activated. Use <code>[[#isPluginActivated|isPluginActivated('event_category')]]</code> | ||
API method to check if | API method to check if Custom Feature activated. | ||
| Line 557: | Line 557: | ||
Returns Array. | Returns Array. | ||
Returns available locations for company if | Returns available locations for company if Custom Feature [[Custom_Features#Unit_Location|Unit location Custom Feature]] is activated. Return | ||
an error with code -32001 if | an error with code -32001 if Custom Feature is not activated. Use <code>[[#isPluginActivated|isPluginActivated('location')]]</code> | ||
API method to check if | API method to check if Custom Feature activated. | ||
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 | ||
| Line 594: | Line 594: | ||
Returns an object with detailed information about promotion by promotion code. You can get promotion code | Returns an object with detailed information about promotion by promotion code. You can get promotion code | ||
using <code>[[Catalogue#getPromotionList|getPromotionList]]</code> API method. If promotion record with specified | 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 [[ | code not found then method returns an empty array (an empty object). If [[Custom_Features#Simply_Smart_Promotions|Simply Smart Promotions Custom Feature]] | ||
not enabled then method returns an error with code -32001 ( | not enabled then method returns an error with code -32001 (Custom Feature is not activated). Use | ||
<code>[[#isPluginActivated|isPluginActivated('promo')]]</code> API method call to check if | <code>[[#isPluginActivated|isPluginActivated('promo')]]</code> API method call to check if Custom Feature enabled.See [[#getPromotionList response|example]] of <code>getPromotionList</code> API method response. Please note that | ||
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). | ||
| Line 612: | Line 612: | ||
Returns Array. | Returns Array. | ||
Return | Return Custom Feature status true if status active, else false. See [[#Plugin's identifiers|list of available Custom Feature's names]]. | ||
| Line 686: | Line 686: | ||
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 | ||
<code>not_worked_time</code>. <code>reserved_time</code> type represents time slots working time but already booked | <code>not_worked_time</code>. <code>reserved_time</code> type represents time slots working time but already booked | ||
by clients. Nobody knows what kind of data represented by <code>not_worked_time</code> type. Please don't use it.If [[ | by clients. Nobody knows what kind of data represented by <code>not_worked_time</code> type. Please don't use it.If [[Custom_Features#Google_Calendar_Sync|Google calendar sync Custom Feature]] enabled then object with | ||
<code>reserved_time</code> type will contain not empty list of time slots marked as busy in Google calendar. Call | <code>reserved_time</code> type will contain not empty list of time slots marked as busy in Google calendar. Call | ||
<code>[[#isPluginActivated|isPluginActivated('google_calendar_export')]]</code> API method to check if Google | <code>[[#isPluginActivated|isPluginActivated('google_calendar_export')]]</code> API method to check if Google | ||
calendar sync | calendar sync Custom Feature activated. | ||
| Line 755: | Line 755: | ||
Eg.: <code>{'2014-05-14': ['09:00:00', ...], ...}</code> | Eg.: <code>{'2014-05-14': ['09:00:00', ...], ...}</code> | ||
If locations | 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 [[ | units available only for selected location. See [[Custom_Features#Unit_Location|Unit Location]] Custom Feature description for | ||
more details. | more details. | ||
| Line 811: | Line 811: | ||
Returns String. | Returns String. | ||
Returns user license text if user license | Returns user license text if user license Custom Feature is turned on, | ||
otherwise throws exception | otherwise throws exception | ||
| Line 890: | Line 890: | ||
Returns Boolean. | Returns Boolean. | ||
Returns true if [[ | Returns true if [[Custom_Features#Accept_Payments|Accept Payments]] Custom Feature activated and event with specified id has | ||
configured price. If no | configured price. If no parameters specified then method returns true if payments Custom Feature activated and at least | ||
one event has configured price. Otherwise returns false. | one event has configured price. Otherwise returns false. | ||
| Line 906: | Line 906: | ||
Returns Boolean. | Returns Boolean. | ||
Return | 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 [[#Plugin's identifiers|list of available Custom Features' names]]. | ||
| Line 952: | Line 952: | ||
See [[Errors handling]] for details. | See [[Errors handling]] for details. | ||
* -32001 | * -32001 Custom Feature is not activated | ||
* -32010 Some required params are missed | * -32010 Some required params are missed | ||
* -32011 Params is not array | * -32011 Params is not array | ||
| Line 1,007: | Line 1,007: | ||
* fixed_country_prefix | * fixed_country_prefix | ||
* max_group_bookings | * max_group_bookings | ||
*: [[ | *: [[Custom_Features#Group_Bookings|Group Bookings Custom Feature]] configuration. Integer. | ||
* max_time_till_event | * max_time_till_event | ||
* min_time_till_event | * min_time_till_event | ||
| Line 1,032: | Line 1,032: | ||
*: 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. | ||
=====Accept | =====Accept Payments Custom Feature params===== | ||
Read more about [[ | Read more about [[Custom_Features#Accept_Payments|Accept Payments Custom Feature configuration]]. | ||
* allow_delay_payment | * allow_delay_payment | ||
| Line 1,045: | Line 1,045: | ||
*: Sales tax option. Integer. You should divide by 100 to get percent value. | *: Sales tax option. Integer. You should divide by 100 to get percent value. | ||
=====Cancellation Policy | =====Cancellation Policy Custom Feature params===== | ||
Read more about [[ | Read more about [[Custom_Features#Cancellation_Policy|Cancellation Policy Custom Feature configuration]]. | ||
* cancelation_policy_text | * cancelation_policy_text | ||
| Line 1,058: | Line 1,058: | ||
---- | ---- | ||
==== | ====Custom Features' identifiers==== | ||
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. | |||
* advanced_notification | * advanced_notification | ||
*:Book Soon notification system | *:Book Soon notification system | ||
* any_unit | * any_unit | ||
*:Any Employee selector | *:Any Employee selector | ||
* api | * api | ||
*:API | *:API | ||
* approve_booking | * approve_booking | ||
*:Approve booking | *:Approve booking | ||
* back_to_site | * back_to_site | ||
*:Take me back home | *:Take me back home | ||
* contact_widget | * contact_widget | ||
*:Contact widget | *:Contact widget | ||
* counter | * counter | ||
*:Visitor Counter | *:Visitor Counter | ||
* custom_css | * custom_css | ||
*:Custom CSS | *:Custom CSS | ||
* data_security | * data_security | ||
*:Clean history | *:Clean history | ||
* description | * description | ||
*:HTML description field for events | *:HTML description field for events | ||
* event_category | * event_category | ||
*:Service categories | *:Service categories | ||
* event_field | * event_field | ||
*:Additional fields | *:Additional fields | ||
* facebookImage | * facebookImage | ||
*:Facebook client info | *:Facebook client info | ||
* financial_dashboard | * financial_dashboard | ||
*:Insights | *:Insights | ||
* google_analytics | * google_analytics | ||
*:Google Adwords and analytics | *:Google Adwords and analytics | ||
* google_calendar_export | * google_calendar_export | ||
*:Google calendar sync | *:Google calendar sync | ||
* group_booking | * group_booking | ||
*:Group bookings | *:Group bookings | ||
* hipaa | * hipaa | ||
*:HIPAA | *:HIPAA | ||
* limit_bookings | * limit_bookings | ||
*:Limit bookings | *:Limit bookings | ||
* location | * location | ||
*:Unit location | *:Unit location | ||
* mobile_app_backend | * mobile_app_backend | ||
*:Mobile application | *:Mobile application | ||
* multiple_booking | * multiple_booking | ||
*:Multiple bookings | *:Multiple bookings | ||
* news | * news | ||
*:News | *:News | ||
* paid_events | * paid_events | ||
*:Accept payments | *:Accept payments | ||
* promo | * promo | ||
*:Simply Smart Promotions | *:Simply Smart Promotions | ||
* recap | * recap | ||
*:Daily report | *:Daily report | ||
* secure | * secure | ||
*:SSL | *:SSL | ||
* status | * status | ||
*:Status | *:Status | ||
* unit_colors | * unit_colors | ||
*:Providers color coding | *:Providers color coding | ||
* user_license | * user_license | ||
*:Terms and conditions | *:Terms and conditions | ||
* cancelation_policy | * cancelation_policy | ||
*:Cancellation Policy | *:Cancellation Policy | ||
See [[ | See [[Custom_Features|Custom Features]] page for description for each . | ||
---- | ---- | ||