Company public service methods: Difference between revisions
No edit summary |
No edit summary |
||
| Line 67: | Line 67: | ||
Returns Boolean. | Returns Boolean. | ||
Cancels a booking. <code>$sign</code> parameter must be a string created with formula: <code>md5($bookingId . $bookingHash . $secretKey) | |||
$sign | </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 (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. | |||
| Line 224: | Line 226: | ||
Returns Object. | Returns Object. | ||
Returns booking | Returns an object with details information about booking. <code>$sign</code> parameter must be a string created | ||
$sign | 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 | |||
(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. | |||
| Line 241: | Line 246: | ||
Returns Object. | Returns Object. | ||
Returns | Returns an object with details information about booking. <code>$sign</code> parameter must be a string created | ||
$sign | 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 | |||
(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. | |||
| Line 271: | Line 279: | ||
Returns Object. | Returns Object. | ||
Returns company | Returns an object with detailed information about company. See [[#getCompanyInfo response|example of response]]. | ||
| Line 316: | Line 324: | ||
Returns Array. | Returns Array. | ||
Returns company | 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 364: | Line 374: | ||
Returns payment processor config | Returns payment processor config | ||
---- | |||
=== getPluginPromoInfoByCode === | |||
<code>getPluginPromoInfoByCode($code)</code> | |||
Parameters: | |||
* '''$code''' | |||
Returns Array. | |||
Return promotion information by code | |||
| Line 393: | Line 418: | ||
Returns Array|null. | Returns Array|null. | ||
Returns | Returns an object with detailed information about promotion by promotion code. Returns null if no promotions with | ||
specified code were not found. | |||
| Line 449: | Line 475: | ||
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 465: | Line 491: | ||
Returns Array. | Returns Array. | ||
Returns | 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 496: | Line 524: | ||
* '''$from''' String | * '''$from''' String | ||
* '''$to''' String | * '''$to''' String | ||
* '''$unitId''' Integer | * '''$unitId''' Integer (optional) | ||
* '''$eventId''' | * '''$eventId''' Integer (optional) | ||
Returns Object. | Returns Object. | ||
| Line 530: | Line 558: | ||
Return true if event payments plugin is turned on and prices were set, | Return true if event payments plugin is turned on and prices were set, | ||
else return false | else return false. | ||
| Line 786: | Line 814: | ||
"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" | |||
} | } | ||