Company public service methods: Difference between revisions

No edit summary
 
(28 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{#seo:
|title=Company public service methods - SimplyBook.me
|description=Explore public-facing service methods to improve client access. Manage service visibility with ease. Learn more now!
|titlemode=append
|keywords=faq, frequently asked questions, booking software, appointment system questions, appointments online, calendar software, booking system, booking calendar, scheduling software, online appointment scheduling, online scheduling, setup, setup help, support, help content
}}
==General Information==
==General Information==


Line 14: Line 21:
* <code>id</code> - The id of the request it is responding to.
* <code>id</code> - The id of the request it is responding to.


Example:
Example


<pre>
<pre>
Line 30: Line 37:
         "1": {
         "1": {
             "id": "1",
             "id": "1",
             "name": "Часовая фотосесcия",
             "name": "Hourly photoshoot",
             "duration": "60",
             "duration": "60",
             "hide_duration": "0",
             "hide_duration": "0",
             "description": "<p>Sample service description</p>",
             "description": "<p>If you want to try yourself as a model but haven't decided on an image. <br /> 5-7 retouched and print-ready photos + the raw footage on a disc </p>",
             "picture": "a200edab10b669225e22d2b3803a38b5.jpg",
             "picture": "a200edab10b669225e22d2b3803a38b5.jpg",
             "is_public": "1",
             "is_public": "1",
Line 76: Line 83:


* <code>X-Company-Login</code>  
* <code>X-Company-Login</code>  
* <code>X-Token</code> an authentication token. See [[#Authentication|authentication]] section.
* <code>X-Token</code> an authentication token. See [[Company public service methods#Authentication|authentication]] section.


===Endpoint===
===Endpoint===
Line 84: Line 91:
===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 'Plugins' link and select [[Plugins#API|API plugin]] '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#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 110: Line 117:
<code>require_confirm = true</code>. <code>$startDate</code> and <code>$startTime</code> specifies a date of
<code>require_confirm = true</code>. <code>$startDate</code> and <code>$startTime</code> specifies a date of
booking and time slot. Time value should be multiple to 'timeframe' configuration of company (see
booking and time slot. Time value should be multiple to 'timeframe' configuration of company (see
<code>[[#getTimeframe|getTimeframe]]</code> API method). <code>$endDate</code> and <code>$endTime</code> parameters
<code>[[Company public service methods#getTimeframe|getTimeframe]]</code> API method). <code>$endDate</code> and <code>$endTime</code> parameters
should be calculated according to service duration. However you can specify different values to make appointment
should be calculated according to service duration. However you can specify different values to make appointment
longer or shorter then service configuration. Note that <code>$endDate</code> and <code>$endTime</code> should be
longer or shorter then service configuration. Note that <code>$endDate</code> and <code>$endTime</code> should be
later in time than <code>$startDate</code> and <code>$startTime</code>. If your clients located in different time
later in time than <code>$startDate</code> and <code>$startTime</code>. If your clients located in different time
zone you should specify <code>'client_time_offset'</code> value in <code>$clientData</code> object as difference
zone you should specify <code>'client_time_offset'</code> value in <code>$clientData</code> object as difference
between company's time zone and client's time zone in seconds. For example if company located in city with time
between client's time zone and company's time zone in minutes. For example if company located in city with time
zone GMT+2 and customer located in city with GMT+3 then <code>$clientTimeOffset</code> will be -3600 seconds. You
zone GMT+2 and customer located in city with GMT+3 then <code>$clientTimeOffset</code> will be 60 minutes. You
can get information about company's time zone using <code>[[#getCompanyInfo|getCompanyInfo]]</code> API method. To
can get information about company's time zone using <code>[[Company public service methods#getCompanyInfo|getCompanyInfo]]</code> API method. To
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 [[Plugins#Additional fields|Additional fields plugin]]). To create a booking with promo code you
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>{"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 [[Company public service methods#book response|example]] of <code>book</code> API method response.


See also:
See also:


* [http://wiki.simplybook.me/index.php/Settings#Timeframe Timeframe information]
* [https://help.simplybook.me/index.php/Need_to_change_interval_(timeframe) Timeframe information]


----
----
Line 158: Line 165:


Cancels a booking. <code>$sign</code> parameter must be a string created with formula: <code>md5($bookingId . $bookingHash . $secretKey)
Cancels a booking. <code>$sign</code> parameter must be a string created with formula: <code>md5($bookingId . $bookingHash . $secretKey)
</code>. You can get <code>$bookingHash</code> value as result of <code>[[#book|book]]</code> API method call. Method
</code>. You can get <code>$bookingHash</code> value as result of <code>[[Company public service methods#book|book]]</code> API method call. Method
return an error with code -32080 (Appointment couldn't be found) if record with specified id not exists. Methods returns
return an error with code -32080 (Appointment couldn't be found) if record with specified id not exists. Methods returns
an error with code -32085 (Signature error) if <code>$sign</code> parameter is wrong.
an error with code -32085 (Signature error) if <code>$sign</code> parameter is wrong.
Line 219: Line 226:
----
----


=== confirmBookingPayment ===
=== confirmBookingCart ===
 
<code>confirmBookingCart($cartId, $paymentProcessor, $sign)</code>
 
Parameters:
 
* '''$cartId''' Integer - cart id
* '''$paymentProcessor''' String - payment processor name
* '''$sign''' String - signature. (md5($cartId . $cartHash . $secretKey))
 
Returns Boolean.
 
Confirm booking cart. Use it to confirm payment. Signature is required.
 
 
----
 
=== confirmBookingPayment !Deprecated!===


<code>confirmBookingPayment($id, $paymentProcessor, $sign)</code>
<code>confirmBookingPayment($id, $paymentProcessor, $sign)</code>
Line 244: Line 268:
Returns Integer.
Returns Integer.


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>[[Company public service methods#book|book]]</code>
API method.
API method.
----
=== filterAvailableUnits ===
<code>filterAvailableUnits($eventId, $dateTime, $unitIds, $count)</code>
Parameters:
* '''$eventId''' Integer
* '''$dateTime''' String a date and time string in format 'Y-m-d H:i:s'
* '''$unitIds''' 
* '''$count''' Integer
Returns Array.
Returns list of available unit ids for specified date and service from provided $unitIds list.You can use this method with locations Custom feature.
Returns empty array if all units are not allowed.
Eg.: <code>[1, 2, 3]</code>




Line 260: Line 304:
Returns Array.
Returns Array.


Return additional fields for certain event if [[Plugins#Additional_fields|Additional fields plugin]] 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>[[Company public service methods#isPluginActivated|isPluginActivated('event_field')]]</code>
API method to check if 'event_field' plugin activated.
API method to check if 'event_field' Custom Feature activated.




Line 274: Line 318:
Returns Object|null.
Returns Object|null.


Returns information about [[Plugins#Any_Employee_selector|Any Employee selector plugin]] configuration. Returns
Returns information about [[Custom Features#Any Employee Selector|Any Employee Selector Custom Feature]] configuration. Returns
null if plugin not enabled.Example:
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 284: Line 328:
     "random_selection" : 0 // 1 or 0
     "random_selection" : 0 // 1 or 0
   }
   }
----
=== getAvailableTimeIntervals ===
<code>getAvailableTimeIntervals($dateFrom, $dateTo, $eventId, $unitId, $count)</code>
Parameters:
* '''$dateFrom''' String
* '''$dateTo''' String
* '''$eventId''' Integer
* '''$unitId''' Mixed can be Integer or Array of Integers
* '''$count''' Integer
Returns Object.
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>




Line 318: Line 382:
Returns an object with details information about booking. <code>$sign</code> parameter must be a string created
Returns an object with details information about booking. <code>$sign</code> parameter must be a string created
with formula: <code>md5($bookingId . $bookingHash . $secretKey)</code>. You can get <code>$bookingHash</code>
with formula: <code>md5($bookingId . $bookingHash . $secretKey)</code>. You can get <code>$bookingHash</code>
value as result of <code>[[#book|book]]</code> API method call. Method return an error with code -32080
value as result of <code>[[Company public service methods#book|book]]</code> API method call. Method return an error with code -32080
(Appointment couldn't be found) if record with specified id not exists. Methods returns an error with code -32085
(Appointment couldn't be found) if record with specified id not exists. Methods returns an error with code -32085
(Signature error) if <code>$sign</code> parameter is wrong.
(Signature error) if <code>$sign</code> parameter is wrong.
----
=== getBookingCart ===
<code>getBookingCart($bookingIds)</code>
Parameters:
* '''$bookingIds''' Array
Returns Object.
Returns cart information by bookings ids.
* <code>cart_id</code> and <code>cart_hash</code> is used to create secure signature to confirm cart payment.
* <code>amount</code> - is total amount to payment
* <code>currency</code> - cart currency
* <code>cart</code> - contains cart items. You can use them to provide information for payment system. Each item is object with following fields:
* <code>id</code> - booking id
* <code>event_id</code> - service id
* <code>name</code> - event name + start date time (use it to provide cart information for payment system)
* <code>price</code> - booking price
* <code>qty</code> - qty of bookings




Line 338: Line 427:
Returns an object with details information about booking. <code>$sign</code> parameter must be a string created
Returns an object with details information about booking. <code>$sign</code> parameter must be a string created
with formula: <code>md5($bookingId . $bookingHash . $secretKey)</code>. You can get <code>$bookingHash</code>
with formula: <code>md5($bookingId . $bookingHash . $secretKey)</code>. You can get <code>$bookingHash</code>
value as result of <code>[[#book|book]]</code> API method call. Method return an error with code -32080
value as result of <code>[[Company public service methods#book|book]]</code> API method call. Method return an error with code -32080
(Appointment couldn't be found) if record with specified id not exists. Methods returns an error with code -32085
(Appointment couldn't be found) if record with specified id not exists. Methods returns an error with code -32085
(Signature error) if <code>$sign</code> parameter is wrong.
(Signature error) if <code>$sign</code> parameter is wrong.
Line 355: Line 444:
Returns Array.
Returns Array.


Returns company categories list if [[Plugins#Service categories|Service categories plugin]] 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 plugin is not activated. Use <code>[[#isPluginActivated|isPluginActivated('event_category')]]</code>
an error with code -32001 if Custom Feature is not activated. Use <code>[[Company public service methods#isPluginActivated|isPluginActivated('event_category')]]</code>
API method to check if plugin activated.
API method to check if Custom Feature activated.




Line 369: Line 458:
Returns Object.
Returns Object.


Returns an object with detailed information about company. See [[#getCompanyInfo response|example of response]].
Returns an object with detailed information about company. See [[Company public service methods#getCompanyInfo response|example of response]].




Line 386: Line 475:
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
allowed. See [[#Company_params|list of available keys]].
allowed. See [[Company public service methods#Company params|list of available keys]].
 
 
----
 
=== getCompanyParams ===
 
<code>getCompanyParams($keys)</code>
 
Parameters:
 
* '''$keys''' Array
 
Returns Array.
 
Returns company's config values for specified keys as key-value map. For non-existent and not-allowed param keys
it will return '''false''' as result. A different set of keys available for public API and for company
administration API. See [[Company public service methods#Company params|list of available keys]].
 
----
 
=== getCompanyTimezoneOffset ===
 
<code>getCompanyTimezoneOffset()</code>
 
No arguments.
Returns array.
 
Returns company timezone offset and company timezone




Line 438: Line 555:
=== getLocationsList ===
=== getLocationsList ===


<code>getLocationsList($isPublic)</code>
<code>getLocationsList($isPublic, $asArray)</code>


Parameters:
Parameters:


* '''$isPublic''' Boolean  
* '''$isPublic''' Boolean Optional. Default value is '''false'''.
* '''$asArray''' boolean Optional. Default value is '''false'''.


Returns Array.
Returns Array.


Returns available locations for company if plugin [[Plugins#Unit location|Unit location plugin]] 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 plugin is not activated. Use <code>[[#isPluginActivated|isPluginActivated('location')]]</code>
an error with code -32001 if Custom Feature is not activated. Use <code>[[Company public service methods#isPluginActivated|isPluginActivated('location')]]</code>
API method to check if plugin activated.
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
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.


----
----
Line 468: Line 589:
----
----


=== getPluginPromoInfoByCode ===
<!----=== getPluginPromoInfoByCode ===


<code>getPluginPromoInfoByCode($code)</code>
<code>getPluginPromoInfoByCode($code)</code>
Line 478: Line 599:
Returns Array.
Returns Array.


Returns an object with detailed information about 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
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 [[Plugins#Simply Smart Promotions|Simply Smart Promotions plugin]]
code not found then method returns an empty array (an empty object). If [[Rewards_and_Referrals_custom_feature|Rewards and Referrals Custom Feature]]
not enabled then method returns an error with code -32001 (Plugin is not activated). Use
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 plugin enabled.See [[#getPromotionList response|example]] of <code>getPromotionList</code> API method response. Please note that
<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 498: Line 619:
Returns Array.
Returns Array.


Return plugin status true if status active, else false. See [[#Plugin's identifiers|list of available plugin's names]].
Return Custom Feature status true if status active, else false. See [[Company public service methods#Custom Features.27 identifiers|list of available Custom Feature's names]].




Line 515: Line 636:
Returns an object with detailed information about promotion by promotion code. Returns null if no promotions with
Returns an object with detailed information about promotion by promotion code. Returns null if no promotions with
specified code were not found.
specified code were not found.
----
<!---=== getPromotionRewardInfo ===
<code>getPromotionRewardInfo($commonPromotionId, $clientId, $hash)</code>
Parameters:
* '''$commonPromotionId''' Integer
* '''$clientId''' Integer
* '''$hash''' String
Returns Array|null.
Returns promotion reward by common promotion id, client id and hash.
-->
----
=== getRecurringDatetimes ===
<code>getRecurringDatetimes($eventId, $unitId, $date, $time, $recurringData)</code>
Parameters:
* '''$eventId''' Integer
* '''$unitId''' Integer
* '''$date''' String
* '''$time''' String
* '''$recurringData''' Array
Returns Array.
Get list of dates for recurring booking




Line 529: Line 686:
* '''$eventId''' Integer  
* '''$eventId''' Integer  
* '''$unitId''' Integer  
* '''$unitId''' Integer  
* '''$count''' Integer
Returns Object.
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
<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 [[Custom Features#Calendar Sync|Calendar Sync Custom Feature]] is 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>[[Company public service methods#isPluginActivated|isPluginActivated('google_calendar_export')]]</code> API method to check if  Calendar Sync Custom Feature activated.
Example:
<pre>
  {
    "2016-02-05": [
      {
        "dd": [], // time slots from Google calendar
        "events": [ // reserved time slots
          { "from": "16:00", "to": "16:30" },
          { "from": "16:30", "to": "17:00" },
          ... ],
        "type": "reserved_time",
      },
      {
        "events": [
          { "from": "09:00", "to": "09:30" },
          { "from": "09:30", "to": "10:00" },
          ... ],
        "type": "not_worked_time"
    }],
    ...
  }
</pre>
----
=== getReservedTimeIntervals ===
<code>getReservedTimeIntervals($dateFrom, $dateTo, $eventId, $unitId, $count)</code>
Parameters:
* '''$dateFrom''' String
* '''$dateTo''' String
* '''$eventId''' Integer
* '''$unitId''' Integer|Array
* '''$count''' Integer  
* '''$count''' Integer  


Line 534: Line 739:


Returns not available time
Returns not available time
Eg.: <code>{'2014-05-14': [{'events': [{'from': '14:00', 'to': '14:30'}], 'type': "reserved_time"}, ...], ...}</code>
Eg.: <code>{'2014-05-14': [{'reserved_time': [{'from': '14:00', 'to': '16:30'}], 'type': "reserved_time"}, ...], ...}</code>




Line 556: Line 761:
Eg.: <code>{'2014-05-14': ['09:00:00', ...], ...}</code>
Eg.: <code>{'2014-05-14': ['09:00:00', ...], ...}</code>


If locations plugin 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 [[Plugins#Unit_location|Unit location]] plugin description for
units available only for selected location. See [[Custom Features#Multiple Locations|Multiple Locations]] Custom Feature description for
more details.
more details.


Line 570: Line 775:
Returns Integer.
Returns Integer.


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 [[Settings#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]].
 
 
----
 
=== getTimelineType ===
 
<code>getTimelineType()</code>
 
No arguments.
Returns String.
 
Returns company calendar layout type




Line 589: Line 806:
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
of event's details object.
of event's details object.
----
=== getUserLicenseText ===
<code>getUserLicenseText()</code>
No arguments.
Returns String.
Returns user license text if user license Custom Feature is turned on,
otherwise throws exception




Line 613: Line 843:
=== getWorkDaysInfo ===
=== getWorkDaysInfo ===


<code>getWorkDaysInfo($from, $to, $unitId, $eventId)</code>
<code>getWorkDaysInfo($from, $to, $unitId, $eventId, $count)</code>


Parameters:
Parameters:
Line 621: Line 851:
* '''$unitId''' Integer (optional)
* '''$unitId''' Integer (optional)
* '''$eventId''' Integer (optional)
* '''$eventId''' Integer (optional)
* '''$count''' Integer (optional)


Returns Object.
Returns Object.


Returns working time for date period, taking into account breaktimes
Returns an information about working hours and break times for specified service and performer for a period
Eg.: <code>{'2014-05-14': [{'from': '09:00:00', 'to': '10:00:00'}, ...], ...}</code>
between two dates. If only service specified then information about performer (or performers) will be taken from
service configuration. Method returns a list of objects for each date in specified period. Count of objects in
list depends on break times. For example if performer works from 9:00 till 19:00 with one hour break at 13:00 method
returns:
 
<pre>
  {'2014-05-14' : [
    {'from': '09:00:00', 'to': '13:00:00'},
    {'from': '14:00:00', 'to': '19:00:00'}
  ] }
</pre>
 
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.




Line 652: Line 896:
Returns Boolean.
Returns Boolean.


Return true if event payments plugin is turned on and prices were set,
Returns true if [[Custom Features#Accept Payments|Accept Payments]] Custom Feature activated and event with specified id has
else return false.
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.


----
----
Line 668: Line 912:
Returns Boolean.
Returns Boolean.


Return plugin status true if status active, else false. <var>$pluginName</var> parameter is a plugin identifier.See [[Plugins|plugins]] page for full plugins description. See [[#Plugin's 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]] page for full Custom Features description. See [[Company public service methods#Custom Features.27 identifiers|list of available Custom Features' names]].




Line 714: Line 958:
See [[Errors handling]] for details.
See [[Errors handling]] for details.


* -32001 Plugin is not activated
* -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
* -32012 Sheduler id not found
* -32012 Sheduler id not found
* -32015 Passed event id is not reccuren
* -32020 Sorry, you have no permissions to perform this action
* -32020 Sorry, you have no permissions to perform this action
* -32030 Invalid promotion code
* -32030 Invalid promotion code
Line 735: Line 980:
* -32062 Client email value is wrong
* -32062 Client email value is wrong
* -32063 Client phone value is wrong
* -32063 Client phone value is wrong
* -32070 Additional field values are wrong
* -32070 Intake forms values are wrong
* -32080 Appointemnt couldn't be found
* -32080 Appointemnt couldn't be found
* -32085 Signature error
* -32085 Signature error
Line 753: Line 998:
----
----


====Company params====
===Company params===


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>[[Company public service methods#getCompanyParam|getCompanyParam]]</code> API method.
 
=====General params=====


* allow_delay_payment
* allow_event_breaktime_break
* allow_event_breaktime_break
*: <code>true</code> if service can extend over breaktime
*: <code>true</code> if service can extend over breaktime
* allow_event_day_break
* allow_event_day_break
*: <code>true</code> if service can extend over closing hours
*: <code>true</code> if service can extend over closing hours
* changable_prefix_by_client
* company_timezone
* company_timezone
* date_format
* date_format
* fixed_country_prefix
* fixed_country_prefix
* hide_sale_tax
* 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
* monday_is_first_day
* monday_is_first_day
*: <code>true</code> if monday specified as first day of the week in company's settings
*: <code>true</code> if monday specified as first day of the week in company's settings
* payment_timeout
* require_fields
* require_fields
*: String. Client's data fields required for booking. Possible values:  
*: Client's data fields required for booking. String. Possible values:  
** phone - phone number is required
** phone - phone number is required
** email - email address is required
** email - email address is required
** email_phone - phone number and email address are required
** email_phone - phone number and email address are required
* sale_tax
* send_notifications_in_client_timezone
* send_notifications_in_client_timezone
* show_booking_page_in_client_timezone
* show_booking_page_in_client_timezone
* time_format
* time_format
* timeframe
* timeframe
*: 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 [[Settings#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]]
* user_public_timeline_type
* user_public_timeline_type
*: String. Can be one of the following values:
*: String. Can be one of the following values:
Line 789: Line 1,034:
** flexible_week
** flexible_week
** modern_week
** modern_week
** classes
** classic
** classic
*: 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 Payments Custom Feature params=====
Read more about [[Custom Features#Accept Payments|Accept Payments Custom Feature configuration]].
* allow_delay_payment
*: Allow delay payment option. Boolean.
* hide_sale_tax
*: Hide sales tax option. Boolean.
* payment_timeout
*: Payment timeout option. String ("5 minutes", "1 hour", ...)
* sale_tax
*: Sales tax option. Integer. You should divide by 100 to get percent value.
=====Cancellation Policy Custom Feature params=====
Read more about [[Custom Features#Cancellation Policy|Cancellation Policy Custom Feature configuration]].
* cancelation_policy_text
*: Full policy text. String.
* cancelation_policy_label
*: Short label for confirmation control. String.
* cancelation_policy_period
*: Time period value. String ("5 minutes", "1 hour", ...)
----
----


====Plugin's identifiers====
====Custom Features' identifiers====


Plugin identifier is a string constant which represents a plugin 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>[[Company public service methods#isPluginActivated|isPluginActivated]]</code> and <code>[[Company public service methods#getPluginStatuses|getPluginStatuses]]</code> API methods.


* advanced_notification
* advanced_notification
*:Book Soon notification system plugin
*:Book Soon notification system
* any_unit
* any_unit
*:Any Employee selector plugin
*:Any Employee selector
* api
* api
*:API plugin
*:API  
* approve_booking
* approve_booking
*:Approve booking plugin
*:Approve booking
* back_to_site
* back_to_site
*:Take me back home plugin
*:Take me back home
* contact_widget
* contact_widget
*:Contact widget plugin
*:Contact widget
* counter
* counter
*:Visitor Counter plugin
*:Visitor Counter
* custom_css
* custom_css
*:Custom CSS plugin
*:Custom CSS
* data_security
* data_security
*:Clean history plugin
*:Clean history
* description
* description
*:HTML description field for events
*:HTML description field for events
* event_category
* event_category
*:Service categories plugin
*:Service categories
* event_field
* event_field
*:Additional fields plugin
*:Intake forms
* facebookImage
* facebookImage
*:Facebook client info plugin
*:Facebook client info
* financial_dashboard
* financial_dashboard
*:Insights plugin
*:Insights
* google_analytics
* google_analytics
*:Google Adwords and analytics plugin
*:Google Adwords and analytics
* google_calendar_export
* google_calendar_export
*:Google calendar sync plugin
*:Calendar sync
* group_booking
* group_booking
*:Group bookings plugin
*:Group bookings
* hipaa
* hipaa
*:HIPAA plugin
*:HIPAA  
* limit_bookings
* limit_bookings
*:Limit bookings plugin
*:Limit bookings
* location
* location
*:Unit location plugin
*:Multiple locations
* mobile_app_backend
* mobile_app_backend
*:Mobile application plugin
*:Mobile application  
* multiple_booking
* multiple_booking
*:Multiple bookings plugin
*:Multiple bookings  
* news
* news
*:News plugin
*:News  
* paid_events
* paid_events
*:Accept payments plugin
*:Accept payments  
* promo
<!--* promo
*:Simply Smart Promotions plugin
*:Rewards and Referrals-->
* recap
* recap
*:Daily report plugin
*:Daily report  
* secure
* secure
*:SSL plugin
*:SSL  
* status
* status
*:Status plugin
*:Status  
* unit_colors
* unit_colors
*:Providers color coding plugin
*:Providers color coding  
* user_license
* user_license
*:Terms and conditions plugin
*:Terms and conditions  
* cancelation_policy
*:Cancellation Policy


See [[Plugins]] page for description for each plugin.
See [[Custom Features]] page for description for each .


----
----
Line 867: Line 1,140:
====book response====
====book response====


[[#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.
[[Company public service methods#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.


   {
   {
Line 926: Line 1,199:
====getCompanyInfo response====
====getCompanyInfo response====


An example of data returned by [[#getCompanyInfo|getCompanyInfo]] API method.
An example of data returned by [[Company public service methods#getCompanyInfo|getCompanyInfo]] API method.


   {
   {
Line 960: Line 1,233:
* modern_week
* modern_week
* classic
* classic
* classes




<code>timeframe</code> field can be 5, 10, 15, 20, 30 or 60 minutes. More information about timeframe you can read [[Settings#Timeframe|here]].
Please note that <code>classic</code> timeline type is deprecated and not supported anymore.


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


For information about <code>timeframe</code>, <code>timezone</code>, <code>allow_event_day_break</code> and <code>allow_event_breaktime_break</code> see [[Company public service methods#Company params|Company params section]].
----
----


====getPluginPromoInfoByCode response====
<!----====getPluginPromoInfoByCode response====


   {
   {
Line 995: Line 1,270:
   }
   }


<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.-->
----
 
====getLocationsList response====
 
  {
    "1": {
        "id": "1",
        "title": "location 1",
        "description": null,
        "picture": "e1e9409fe9682c78b2f8f294dc151af0.jpg",
        "address1": null,
        "address2": "Saint Margaret Street",
        "city": "London",
        "zip": null,
        "country_id": "GB",
        "lat": "51.50013000000000000000",
        "lng": "-0.12630500000000000000",
        "phone": "",
        "position": "1",
        "is_default": "1",
        "file_id": "4",
        "picture_sub_path": "\/image_files",
        "picture_path": "\/uploads\/mycompany\/image_files\/small\/e1e9409fe9682c78b2f8f294dc151af0.jpg",
        "units": ["1", "3", "4", "5"]
    },
    ...
  }
 
<code>position</code> property of location object used for order list. <code>units</code> array contains list of performers ids associated with location.