Company administration service methods: Difference between revisions

No edit summary
Line 45: Line 45:


* '''$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')


Returns boolean.
Returns boolean.
Line 64: Line 64:
* '''$unitId''' Integer  
* '''$unitId''' Integer  
* '''$clientId''' Integer  
* '''$clientId''' Integer  
* '''$startDate''' string a date string in format 'Y-m-d'
* '''$startDate''' string a date string in format 'Y-m-d'
* '''$startTime''' string a time string in format 'H:i:s'
* '''$startTime''' string a time string in format 'H:i:s'
* '''$endDate''' string a date string in format 'Y-m-d'
* '''$endDate''' string a date string in format 'Y-m-d'
* '''$endTime''' string a time string in format 'H:i:s'
* '''$endTime''' string a time string in format 'H:i:s'
* '''$clientTimeOffset''' Integer  
* '''$clientTimeOffset''' Integer  
* '''$additional''' array|Object - additional params and fields.
* '''$additional''' array|Object - additional params and fields.
* '''$count''' Integer bookings count used to make group bookings batch. This parameter can't be less than 1. (optional)
* '''$count''' Integer bookings count used to make group bookings batch. This parameter can't be less than 1. (optional)
* '''$batchId''' Integer add booking to group bookings batch. You can't use $count and $batchId in one call. Please specify only one parameter. (optional)
* '''$batchId''' Integer add booking to group bookings batch. You can't use $count and $batchId in one call. Please specify only one parameter. (optional)
* '''$recurringData''' Array - make booking recurrent. (optional)
* '''$recurringData''' Array - make booking recurrent. (optional)


Line 102: Line 102:
Parameters:
Parameters:


* '''$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  
Line 258: Line 258:


* '''$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  


Line 274: Line 274:
Parameters:
Parameters:


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


Returns Array.
Returns Array.
Line 340: Line 340:
Parameters:
Parameters:


* '''$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  


Line 358: Line 358:
Parameters:
Parameters:


* '''$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'
* '''$unitGroupId''' integer  
* '''$unitGroupId''' integer  
* '''$serviceId''' integer  
* '''$serviceId''' integer  
Line 383: Line 383:
Parameters:
Parameters:


* '''$groupBy''' String  
* '''$groupBy''' String either 'day', 'week' or 'month'


Returns Array.
Returns Array.


Get bookings stats
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
* for 'week' methods returns data last 10 weeks period
* for 'month' time period is last 12 months




Line 540: Line 545:
Returns Object.
Returns Object.


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




Line 593: Line 598:
Returns Array.
Returns Array.


Returns all information about current tariff (subscription). For example:
Returns all information about current tariff (subscription). For example:{
  {
     "name" : "gold",
     "name" : "gold",
     "expire_date" : "2016-02-11 12:32:00",
     "expire_date" : "2016-02-11 12:32:00",
Line 627: Line 631:
Returns Array.
Returns Array.


Returns company events list
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
event's details object.




Line 734: Line 740:


Returns a list of all plugins associated with company with status.
Returns a list of all plugins associated with company with status.
----
=== getPluginPromoInfoByCode ===
<code>getPluginPromoInfoByCode($code)</code>
Parameters:
* '''$code''' 
Returns Array.
Return promotion information by code




Line 799: Line 820:
Returns Array.
Returns Array.


Get recurring settings for event
Returns an object with recurring settings for an event. Returns false if specified event does not configured as
recurring.
 
See also:


* <a href="http://blog.simplybook.me/recurring-and-periodic-bookings/">Recurring services desription</a>


----
----
Line 810: Line 835:
Parameters:
Parameters:


* '''$groupBy''' String  
* '''$groupBy''' String either 'day', 'week' or 'month'


Returns Array.
Returns Array.


Get number of registration grouped by day/week/month
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
* for 'week' methods returns data last 10 weeks period
* for 'month' time period is last 12 months




Line 897: Line 927:
Returns Integer.
Returns Integer.


Returns company 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]].




Line 942: Line 972:
Returns Array.
Returns Array.


Returns service performrs list
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
of event's details object.




Line 953: Line 985:
Parameters:
Parameters:


* '''$dateStart'''
* '''$dateStart''' string
* '''$dateEnd'''
* '''$dateEnd''' string
* '''$unitGroupId''' integer  
* '''$unitGroupId''' integer  


Line 970: Line 1,002:
Parameters:
Parameters:


* '''$dateStart''' null
* '''$dateStart''' string
* '''$dateEnd''' null
* '''$dateEnd''' string
* '''$unitGroupId''' integer  
* '''$unitGroupId''' integer  


Line 991: Line 1,023:
Returns Array.
Returns Array.


Get visitor stats
Returns statistics about page visits if plugin [[Plugins#Visitor Counter|Visitor Counter plugin]] enabled. Returns
an empty list if plugin not enabled. Use <code>[[#isPluginActivated|isPluginActivated('counter')]] API method
call to check if plugin enabled. Results can be grouped by 'day', 'week' or 'month'. A time period depends on
selected grouping parameter:
 
* for 'day' methods returns statistics for last 31 days
* for 'week' methods returns data last 10 weeks period
* for 'month' time period is last 12 months




Line 1,022: Line 1,061:
* '''$from''' String  
* '''$from''' String  
* '''$to''' String  
* '''$to''' String  
* '''$unitId''' Integer  
* '''$unitId''' Integer (optional)
* '''$eventId''' null
* '''$eventId''' Integer (optional)


Returns Object.
Returns Object.
Line 1,055: Line 1,094:
Parameters:
Parameters:


* '''$dateStart''' null
* '''$dateStart''' string
* '''$dateEnd''' null
* '''$dateEnd''' string
* '''$unitGroupId''' integer  
* '''$unitGroupId''' integer  


Line 1,098: Line 1,137:
Returns Array.
Returns Array.


Approve booking (approve booking plugin)
Sets approve booking status to 'approved' if [[Plugins#Approve booking|Approve booking]] plugin enabled and returns
Return approved booking ids
list of approved booking IDs. Returns false if plugin not enabled. Use <code>[[#isPluginActivated|isPluginActivated('approve_booking')]]
API method call to check if plugin enabled.




Line 1,114: Line 1,154:
Returns Boolean.
Returns Boolean.


Cancel booking (approve booking plugin)
Sets approve booking status to 'canceled' if [[Plugins#Approve booking|Approve booking]] plugin enabled and returns
true. Returns false if plugin not enabled. Use <code>[[#isPluginActivated|isPluginActivated('approve_booking')]]
API method call to check if plugin enabled.




Line 1,126: Line 1,168:
Returns array.
Returns array.


Return list of all pending bookings
Returns list of objects with information about bookings pending approval if [[Plugins#Approve booking|Approve booking]]
plugin enabled. Returns empty list if plugin not enabled. Use <code>[[#isPluginActivated|isPluginActivated('approve_booking')]]
API method call to check if plugin enabled.




Line 1,138: Line 1,182:
Returns Integer.
Returns Integer.


Return count of pending bookings
Returns count of bookings pending approval if [[Plugins#Approve booking|Approve booking]] plugin enabled. Returns
0 if plugin not enabled. Use <code>[[#isPluginActivated|isPluginActivated('approve_booking')]] API method call to
check if plugin enabled.




Line 1,597: Line 1,643:
     "recurrent_batch_id":"1",
     "recurrent_batch_id":"1",
     "batch_hash":"357178bce290381bb7235080941ec143"
     "batch_hash":"357178bce290381bb7235080941ec143"
  }
====getCompanyInfo response====
An example of data returned by [[#getCompanyInfo|getCompanyInfo]] API method.
  {
    "login": "pierrecoetzee",
    "name": "Pierre",
    "description": "Write a description about your company or about you as a service provider. You can add other service providers inside the system and each can have his own description.",
    "address1": "",
    "address2": "Storey's Gate, ",
    "city": "London",
    "country_id": "GB",
    "lat": "51.500435",
    "lng": "-0.129811",
    "email": "pierre.coe@gmail.com",
    "phone": "",
    "web":null,"skip_address":null,"logo":null,"address": "GB, London, Storey's Gate, ",
    "description_text": "Write a description about your company or about you as a service provider. You can add other service providers inside the system and each can have his own description.",
    "timezone": "Europe London",
    "show_in_client_timezone":false,"timeframe": "60",
    "timeline_type": "modern_week",
    "allow_event_day_break": "0",
    "allow_event_breaktime_break": "0"
   }
   }