var token = loginClient.getToken(companyLogin, apiKey);
var loginClient = new JSONRpcClient({
'url': 'https://user-api.simplybook.me/login',
'onerror': function (error) {
alert(error);
}
});
var token = loginClient.getToken('{companyLogin}', '{apiKey}');
var events = client.getEventList();
var client = new JSONRpcClient({
'url': 'https://user-api.simplybook.me',
'headers': {
'X-Company-Login': '{companyLogin}',
'X-Token': '{token}'
},
'onerror': function (error) {
alert(error);
}
});
var services = client.getEventList();
var units = client.getUnitList();
var performers = client.getUnitList();
// fetch service and performers selects here
var serviceId;
var performerId;
jQuery('#select_event_id').empty();
jQuery('#select_unit_id').empty();
jQuery('#select_event_id').append('<option value=""></option>');
jQuery('#select_unit_id').append('<option value=""></option>');
for (var id in services) {
jQuery('#select_event_id').append('<option value="' + id + '">' + services[id].name + '</option>');
}
for (var id in performers) {
jQuery('#select_unit_id').append('<option value="' + id + '">' + performers[id].name + '</option>');
}
jQuery('#select_event_id').change(function () {
// service id
serviceId = jQuery(this).val();
var selectedService = services[serviceId];
// filter available performers
if (selectedService) {
if (typeof(selectedService.unit_map) != 'undefined' && selectedService.unit_map.length) {
jQuery('#select_unit_id option').attr('disabled', true);
jQuery('#select_unit_id option[value=""]').attr('disabled', false);
for (var i = 0; i < selectedService.unit_map.length; i++) {
jQuery('#select_unit_id option[value="' + selectedService.unit_map[i] + '"]').attr('disabled', false);
}
} else {
jQuery('#select_unit_id option').attr('disabled', false);
}
}
jQuery('#eventId').val(serviceId).change();
});
jQuery('#select_unit_id').change(function () {
performerId = jQuery(this).val();
});
var firstWorkingDay = client.getFirstWorkingDay(performerId);
var firstWorkingDay = client.getFirstWorkingDay(performerId);
workCalendar = client.getWorkCalendar(year, month, performerId);
// Init datepicker.
var workCalendar = {};
jQuery('#datepicker').datepicker({
'onChangeMonthYear': function (year, month, inst) {
workCalendar = client.getWorkCalendar(year, month, performerId);
jQuery('#datepicker').datepicker('refresh');
},
'beforeShowDay': function (date) {
var year = date.getFullYear();
var month = ("0" + (date.getMonth() + 1)).slice(-2);
var day = ("0" + date.getDate()).slice(-2);
var date = year + '-' + month + '-' + day;
if (typeof(workCalendar[date]) != 'undefined') {
if (parseInt(workCalendar[date].is_day_off) == 1) {
return [false, "", ""];
}
}
return [true, "", ""];
}
});
var firstWorkingDateArr = firstWorkingDay.split('-');
workCalendar = client.getWorkCalendar(firstWorkingDateArr[0], firstWorkingDateArr[1], performerId);
jQuery('#datepicker').datepicker('refresh');
var startMatrix = client.getStartTimeMatrix(from, to, eventId, unitId, count)
// Handle date selection
var count = 1; // How many slots book
function formatDate(date) {
var year = date.getFullYear();
var month = ("0" + (date.getMonth() + 1)).slice(-2);
var day = ("0" + date.getDate()).slice(-2);
return year + '-' + month + '-' + day;
}
function drawMatrix(matrix) {
jQuery('#starttime').empty();
for (var i = 0; i < matrix.length; i++) {
jQuery('#starttime').append('<span data-time="' + matrix[i] + '">' + matrix[i] + '</span>');
}
jQuery('#starttime span').click(function () {
startTime = jQuery(this).data('time');
jQuery('#starttime span').removeClass('selected');
jQuery(this).addClass('selected');
});
}
jQuery('#datepicker').datepicker('option', 'onSelect', function () {
var startDate = formatDate(jQuery(this).datepicker('getDate'));
jQuery('#dateFrom, #dateTo').val(startDate);
var startMatrix = client.getStartTimeMatrix(startDate, startDate, serviceId, performerId, count);
drawMatrix(startMatrix[startDate]);
});
var startMatrix = client.getStartTimeMatrix(firstWorkingDay, firstWorkingDay, serviceId, performerId, count);
drawMatrix(startMatrix[firstWorkingDay]);
var additionalFieldsActivated = client.isPluginActivated('event_field');
var additionalFieldsActivated = client.isPluginActivated('event_field');
// load additional fields
var additionalFields = [];
function clearAdditionalFields() {
jQuery('#additional-fields').empty();
additionalFields = [];
}
function addAdditionalField(field) {
var container = jQuery('<div class="form-group"></div>');
var title = jQuery('<div class="control-label">' + field.title + '</div>');
container.append(title);
var fieldContainer = jQuery('<div class="field"></div>');
container.append(fieldContainer);
var fieldNode = null;
switch (field.type) {
case 'checkbox':
fieldNode = jQuery('<input type="checkbox" name="' + field.name + '" id="' + field.name + '" value="1" />');
if (field['default']) {
fieldNode.attr('checked', true);
}
break;
case 'select':
fieldNode = jQuery('<select class="select select2" name="' + field.name + '" id="' + field.name + '"></select>');
var values = field.values.split(',');
for (var k = 0; k < values.length; k++) {
fieldNode.append(jQuery('<option value="' + values[k].trim() + '">' + values[k].trim() + '</option>'));
}
if (field['default']) {
fieldNode.val(field['default']);
}
break;
case 'textarea':
fieldNode = jQuery('<textarea name="' + field.name + '" id="' + field.name + '"></textarea>');
if (field['default']) {
fieldNode.val(field['default']);
}
break;
default:
fieldNode = jQuery('<input type="text" name="' + field.name + '" id="' + field.name + '" />');
if (field['default']) {
fieldNode.val(field['default']);
}
break;
}
if (fieldNode) {
if (field.type == 'checkbox') {
fieldNode.addClass('checkbox');
} else {
fieldNode.addClass('form-control');
}
fieldContainer.append(fieldNode);
jQuery('#additional-fields').append(container);
}
}
if (additionalFieldsActivated) {
clearAdditionalFields();
additionalFields = client.getAdditionalFields(serviceId);
for (var i = 0; i < additionalFields.length; i++) {
addAdditionalField(additionalFields[i]);
}
}
// Collect client data
var clientData = {
'name': jQuery('#clientName').val(),
'email': jQuery('#clientEmail').val(),
'phone': jQuery('#clientPhone').val()
};
// Collect additional fields
var additionalFieldValues = {};
jQuery('#additional-fields input, #additional-fields select, #additional-fields textarea').each(function () {
var val = '';
if (jQuery(this).attr('type') == 'checkbox') {
if (jQuery(this).is(':checked')) {
val = 1;
} else {
val = 0;
}
} else {
val = jQuery(this).val();
}
additionalFieldValues[jQuery(this).attr('name')] = val;
});
var count = 1;
var result = client.book(serviceId, performerId, startDate, startTime, clientData, additionalFieldValues, count);
Thank you for reading!
当社の開発者APIを使ってあなた独自の予約画面を作成することも可能です。あなたの事業内容に合わせシンプルなウィジェットから複数の機能を備えた高機能ウィジェットまで、ご自身でカスタムソリューションが作成可能です。
SimplyBook.meアプリケーションインターフェイスはJSON-RPC 2.0 protocolを使用しています。
APIベース予約インターフェースの使用例を確認し、このソリューションのソースコードを読んで下さい。
Simplybook API手法は、認証を必要とします。 Smplybook API認証のためには、アクセスキーとアクセストークンを取得する必要があります。このアクセストークンを取得するためには、個人のAPIキーをパスしてhttp://user-api.simplybook.me/loginで JSON-RPC手法getTokenを呼び出さなければなりません。管理者インターフェースでAPIキーをコピーすることができます:「プラグイン」リンクに移動して、APIプラグイン「設定」を選択します。 その後SimplyBook.me APIのリモートアクセスを起動しなければなりません。以下のヘッダーを含めて下さい: 'X-Company-Login', 'X-Token'。
アクセストークンはクライアントサイドから、もしくは更に安全なあなたのサーバーサイドから実装できます。
あなた自身のソリューション開発のために、当社の例からjavascript JSON-RPC-client library と php JSON-RPC-client library を利用することができます。
クライアントサイドコードからの承認
トークンキーを入手する。
var loginClient = new JSONRpcClient({
'url': 'https://user-api.simplybook.me' + '/login',
'onerror': function (error) {},
});
var token = loginClient.getToken( YOUR_COMPANY_LOGIN, YOUR_API_KEY);
JSON-RPC-クライアントの初期化。
this.client = new JSONRpcClient({
'url': 'https://user-api.simplybook.me',
'headers': {
'X-Company-Login': YOUR_COMPANY_LOGIN,
'X-Token': token
},
'onerror': function (error) {}
});
サーバーサイドコードからの承認
トークンキーを入手する。
$loginClient = new JsonRpcClient('https://user-api.simplybook.me' . '/login/');
$token = $loginClient->getToken(YOUR_COMPANY_LOGIN, YOUR_API_KEY);
JSON-RPC-クライアントの初期化。
$client = new JsonRpcClient( 'https://user-api.simplybook.me' . '/', array(
'headers' => array(
'X-Company-Login: ' . YOUR_COMPANY_LOGIN,
'X-Token: ' . $token
)
));
クライアントサイドコードからの承認
トークンキーを入手する。
var loginClient = new JSONRpcClient({
'url': {$api_url} + '/login',
'onerror': function (error) {},
});
var token = loginClient.getUserToken( YOUR_COMPANY_LOGIN, YOUR_USER_LOGIN, YOUR_USER_PASSWORD);
JSON-RPC-クライアントの初期化。
this.client = new JSONRpcClient({
'url': 'https://user-api.simplybook.me' + '/admin/',
'headers': {
'X-Company-Login': YOUR_COMPANY_LOGIN,
'X-User-Token': token
},
'onerror': function (error) {}
});
トークンキーを入手する。
$loginClient = new JsonRpcClient('https://user-api.simplybook.me' . '/login/');
$token = $loginClient->getUserToken({YOUR_COMPANY_LOGIN, YOUR_USER_LOGIN, YOUR_USER_PASSWORD);
JSON-RPC-クライアントの初期化。
$client = new JsonRpcClient('https://user-api.simplybook.me' . '/admin/', array(
'headers' => array(
'X-Company-Login: ' . YOUR_COMPANY_LOGIN,
'X-User-Token: ' . $token
)
));
予約ページは通常、クライアントが必要なサービス、従業員、ミーティング時間を選択するページです。クライアントは連絡先情報を入力して予約を確認します。もっと複雑なソリューションは、別の追加フィールドを記入したり、グループや複数回の予約などを作ることを含むことがあります。一番簡単な予約ページで作成のワークフローを説明しましょう。あなたのページに追加機能を追加する必要がある場合には、SimplyBook.me API メソッドのフルリストをこちらからご覧ください。
まず最初に表示すべきなのは、サービスリストとスタッフリストです。以下からデータを入手して下さいgetEventList & getUnitList。 両方とも項目の情報が揃ったリストです。これらによりサービスやスタッフの表示の仕方が広がります。スタッフのフィルタリングには選択されたサービスが提供可能なスタッフに関する情報をまとめたunit_mapをお使い下さい。
サービス取得リストのコード例
$services = $client->getEventList();
// returns array(array(
// 'id' => 1, - service id
// 'name' => 'Service 1', - service's name
// 'description' => 'Describe your service...', - service description
// 'duration' => 60, - service duration
// 'hide_duration' => 0, - Hide duration to clients flag,
// 'picture' => null, - file name of picture or null
// 'picture_path' => '/uploads/apidemo/event__picture/small/', - full path to picture,
// 'position' => 1 - service position
// 'is_active' => 1, - the service is activated
// 'is_public' => 1, - the service is allowed to book by clients
// ), ...)
サービスプロバイダーリスト取得のコード例
$services = $client->getUnitList();
// returns array(array(
// 'id' => 1, - performer id
// 'name' => 'Provider 1', - performer name
// 'phone' => '111111111', - perfomer phone number
// 'description' => 'Describe your performer...', - performer description
// 'email' => 'test@gmail.com', - perfomer email,
// 'is_active' => 1, - the performer is activated
// 'is_visible' => 1, - the perfomer is visible for clients,
// 'picture' => null, - file name of picture or null,
// 'picure_path' => '/uploads/apidemo/unit_group__picture/small/', - full path to picture
// 'position' => 1, - performer position
// 'qty' => 1, performer quantity
// ), ...)
次のステップは、サービスと時間の選択です。私たちはAPIの使用例の中でBootstrap date-pickerを使用していますが、その他のカレンダーも使用可能です。 サービススケジュールの初日を設定するにはgetFirstWorkingDayメソッドを使用して下さい。スタッフIDを変数として取得し、選択されたスタッフ(もしくはデフォルト設定である任意のスタッフ)がサービスに従事可能な日を返します。{""|t} 選択された日付のタイムスロットを表示するには営業カレンダー入手 & getStartTimeMatrixメソッドが必要です。最初のメソッドには営業スケジュールの開始時刻と終了時刻、休業日などの情報を提供します。そして、2番目のメソッドは特定の日付で予約可能なタイムスロットのリストを返します。
営業日情報取得のコード例
$year = 2020;
$month = 3; // March
$performerId = 1; // Can be null
$workDaysInfo = $client->getWorkCalendar($year, $month, $performerId);
// returns array(
// '2020-03-01' => array('from' => '09:00:00', 'to' => '18:00:00', 'is_day_off' => 0),
// '2020-03-02' => array('from' => '09:00:00', 'to' => '18:00:00', 'is_day_off' => 0),
// ...
//);
開始時間マトリックス取得のコード例
$dateFrom = '2020-03-03';
$dateTo = '2020-03-04';
$serviceId = 1;
$performerId = 1;
$qty = 1;
$availableTime = $client->getStartTimeMatrix($dateFrom, $dateTo, $serviceId, $performerId, $qty);
// returns array(
// '2015-03-03' => array('09:00:00', '09:30:00', '10:00:00', ....),
// '2015-03-04' => array('09:00:00', '09:30:00', '10:00:00', ....),
//);
さらに便利なメソッドとしては>calculateEndTimeがあります。各サービスは独自のサービス時間が設定可能で、また各スタッフも異なるスケジュールが設定できます。これらのメソッドによりクライアントに予約したサービスの終了日時を表示することができるようになります。
予約終了時間計算のコード例
$startDateTime = '2020-03-03 09:00:00';
$serviceId = 1;
$performerId = 1;
$availableTime = $client->calculateEndTime($startDateTime, $serviceId, $performerId);
// returns '2020-03-03 10:00:00'
クライアントが予約確認ボタンをクリックした時に予約メソッドを呼び出さなければなりません。 これは、SimplyBook.meシステムですべての必要な確認を実行して新しい予約を登録するメイン機能です。予約や名前・電話ん番号・追加のパラメータといったクライアントデータに関する情報を取り入れます。API 機能リストにてこのメソッドのすべてのパラメータの説明をご覧ください。 予約メソッドレスポンスは、独自のコード・その他新規予約に関する詳細とエラーリストを含み、これらの情報を基にクライアントに予約結果を直感的に表示することができます。
予約方法は、確認を必要とする場合があります。例、支払い終了後に予約を受け付けたい場合 SimplyBook.me API 予約確認方法は、予約IDとセキュア署名を変数としてを取得します(その他に署名を必要とするメソッドとして予約キャンセルがあります)。 セキュア署名を生成するためにはあなたのシークレットAPIキーの使用が必要になります。以下の例から使い方をご覧下さい。シークレットキーは管理者画面の「設定」内にあるプラグインリストのAPIプラグインからご確認下さい。
サービス予約のサンプルコードとシークレットAPIキーを使った確認例
$additionalFields = array(
'6740d3bce747107ddb9a789cbb78abf3' => 'value1',
'b0657bafaec7a2c9800b923f959f8163' => 'value2'
);
$clientData = array(
'name' => 'Client name',
'email' => 'client@email.com',
'phone' => '+13152108338'
);
$bookingsInfo = $client->book($eventId, $unitId, $date, $time, $clientData, $additionalFields);
if ($bookingsInfo->require_confirm) {
foreach ($bookingsInfo->bookings as $booking) {
$sign = md5($booking->id . $booking->hash . YOUR_API_SECRET_KEY);
$result = $client->confirmBooking($booking->id, $sign);
echo '<br>Confirm result</b><br />';
var_dump($result);
}
}
追加フィールド取得のコード例
$fields = $client->getAdditionalFields($eventId);
// returns - array(array(
// 'name' => 'b0657bafaec7a2c9800b923f959f8163', - field name
// 'title' => 'Test digits', - field title
// 'type' => 'digits', - field type
// 'values' => null, - available values for select field type
// 'default' => null, - default value for field
// 'is_null' => null, - is filed nullable
// 'on_main_page' => 1,
// 'pos' => 1, - field position
// 'value' => null
// )), ...)
あなたのサービスが追加機能を必要とする場合、追加プラグインをご利用頂けます。管理者画面内にある「プラグイン」の項目からプラグインリストと各プラグインの詳細説明が確認できます。必要なプラグインを有効にすることでり、対応するAPIメソッドが起動され、あなたのコードの中で使用が可能になります。
loginClient.getToken(companyLogin, apiKey);機能を使ってSimplyBook.me APIを許可します。
サービスカテゴリープラグインが isPluginActivated('event_category')によってアクティブ化されているかどうかを確認し、もしそうであれば、getCategoriesList()カテゴリーリストを表示します。
getEventList()とgetUnitList()機能を利用してサービス(イベント)とパーフォーマ―(ユニット)のリストを取得します。'unit_map'配列がサービスに利用可能であれば、このサービスは所定のパーフォーマ―だけが提供できるという意味です。
任意の従業員セレクタープラグインがアクティブ化されていてisPluginActivated('any_unit')”ユニットマップ”配列でサービス-パーフォーマ―の特別期間の設定がない場合には、ユーザーは 任意のプロバイダーオプションを選択する、または手動でプロバイダーを選択することとなります。 しかし、getCompanyParam('any_unit__hide_other_units')が有効の場合には、パーフォーマ―の手動選択はできないこととなります。
getStartTimeMatrix ($from as current date, $to as current date, $eventId, $unitId, $count as selected participants value )を使用して、所定の日付に利用できるタイムスロットを取得します。$unitIdは、任意の従業員オプションが選択されている場合には、ゼロでなければなりません。
任意の従業員セレクターがアクティブで任意の従業員が選択された場合には、getAvailableUnits($eventId, $dateTime, $count)を呼び出して、 利用可能な $unitIdを取得します
追加フィールドプラグインがアクティブ化されているisPluginActivated('event_field') 場合には、getAdditionalFields($eventId)機能を呼び出してクライアントが記入するフィールドリストを取得します。
book($eventId, $unitId, $date, $time, $clientData, $additional, $count, $batchId)を呼び出して、予約をします。
Returns API url for given company login
Returns an application's token string for a company. You should use this token to authenticate all calls of
[[Company public service methods|Company public service API methods]] and [[Catalogue|Catalogue API methods]]. To
get application API key you need to enable [[Plugins#API|API plugin]].
Returns an authentication token string for certain user registered for company. You should use this token to
authenticate all calls of [[Company administration service methods|Company administration service API methods]] and
[[Catalogue|Catalogue API methods]].
You can use either user password or API User Key for $userPassword parameter:
- Traditional password authentication (requires 2FA if enabled)
- API User Key (starts with "api_user_key_...") - bypasses IP verification
API User Keys can be generated in Settings > API User Keys section.
Example: var token = loginClient.getUserToken(YOUR_COMPANY_LOGIN, YOUR_USER_LOGIN, "api_user_key_...");
Returns an application's token string for an application. You should use this token to authenticate all calls of
[[Company public service methods|Company public service API methods]] and [[Catalogue|Catalogue API methods]]. To
get application API key please contact SimplyBook.me support team.
{@inheritdoc}
{@inheritdoc}
{@inheritdoc}
{@inheritdoc}
Returns payment processor config
Validate application payment.
Returns cart information by bookings ids.
cart_id and cart_hash is used to create secure signature to confirm cart payment.
status - current cart status
amount - is total amount to payment
currency - cart currency
cart - contains cart items. You can use them to provide information for payment system. Each item is object with following fields:
id - booking id
event_id - service id
name - event name + start date time (use it to provide cart information for payment system)
price - booking price
qty - qty of bookings
Returns current cart information
cart_id and cart_hash is used to create secure signature to confirm cart payment.
amount - is total amount to payment
currency - cart currency
cart - contains cart items. You can use them to provide information for payment system. Each item is object with following fields:
id - booking id
event_id - service id
name - event name + start date time (use it to provide cart information for payment system)
price - booking price
qty - qty of bookings
Returns current cart status
Possible result values:
cancel - user has canceled payment
paid - user has paid
error - error has been occurred on validation payment
not_paid - cart is not paid yet or payment status is pending
Confirm booking cart. Use it to confirm payment. Signature is required.
Confirm booking. Signature is required.
$sign = md5($bookingId . $bookingHash . $secretKey);
Call this method from server side only
Confirm booking payment. Signature is required.
$sign = md5($bookingId . $bookingHash . $secretKey);
Call this method from server side only
Confirms booking batch. Signature is required.
$sign = md5($batchId . $batchHash . $secret)
Call this method from server side only
Returns an object with details information about booking. $sign parameter must be a string created
with formula: md5($bookingId . $bookingHash . $secretKey). You can get $bookingHash
value as result of [[#book|book]] 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 $sign parameter is wrong.
Returns an object with details information about booking. $sign parameter must be a string created
with formula: md5($bookingId . $bookingHash . $secretKey). You can get $bookingHash
value as result of [[#book|book]] 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 $sign parameter is wrong.
Returns true if [[Plugins#Accept_payments|Accept payments]] plugin activated and event with specified id has
configured price. If no paramentes specified then method returns true if payments plugin activated and at least
one event has configured price. Otherwise returns false.
Creates new booking record. Returns an object with appointment information or throw exception if booking time not
available or any of required parameters missed. If appointment requires confirmation, in result object will be
require_confirm = true. $startDate and $startTime specifies a date of
booking and time slot. Time value should be multiple to 'timeframe' configuration of company (see
[[#getTimeframe|getTimeframe]] API method). $endDate and $endTime parameters
should be calculated according to service duration. However you can specify different values to make appointment
longer or shorter then service configuration. Note that $endDate and $endTime should be
later in time than $startDate and $startTime. If your clients located in different time
zone you should specify 'client_time_offset' value in $clientData object as difference
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 $clientTimeOffset will be 60 minutes. You
can get information about company's time zone using [[#getCompanyInfo|getCompanyInfo]] API method. To
create batch booking you can specify either count more then 1 or valid batchId (only one
parameter can be specified). You should specify an $additionalFields parameter if service requires
some additional fields (see [[Plugins#Additional fields|Additional fields plugin]]). To create a booking with promo code you
should pass it as additional field. For example: {"name": "promocode", "value": "some code", "type": "text"}
See [[#book response|example]] of book API method response.
Get list of dates for recurring booking
Returns availability of active promotions
Validate promotion code.
Returns true in case promocode is valid otherwise throws exception with error.
Returns an object with detailed information about promotion by promotion code. Returns null if no promotions with
specified code were not found.
Returns promotion reward by common promotion id, client id and hash.
Returns user license text if user license plugin is turned on,
otherwise throws exception
Returns user privacy policy text if user license plugin is turned on and privacy policy is enabled,
otherwise throws exception
Returns client info by client id
Returns client information by clients login (email)/password
Sends remind email for client
Get client information by client login hash
Change client password
Edit client information data
Returns list of available memberships
Returns purchased membership list
Returns client bookings, accepts $filter ($filter {upcoming_only: true/false, confirmed_only: true/false})
Returns product list with filter.
At this time filter can accept only service_id parameter
Returns company's classes list. Ordered by position
Returns captcha challenge data needed to render the SBCaptcha widget.
If captcha is disabled for the company, returns { provider: null }.
Pass the resulting object directly to `new SBCaptcha({ challenge: data, ... })`.
After the widget resolves, submit the token as `captcha_token` inside `$additional` when calling `book()`.
Response always includes:
widgetUrl — absolute URL of captcha-widget.js (the SBCaptcha universal loader)
assets — { js: [], css: [] } with all URLs already absolute
imageUrl — absolute URL (imagecaptcha only); relative path resolved against the company public domain
Edit existing booking record. See [[#book|book]] API method description for more details about date/time parameters,
time zone handling and additional fields. Returns null if parameters not valid.
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
allowed. See [[#Company_params|list of available keys]].
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_params|list of available keys]].
Returns cancellation policy rules.
If cancellation policy custom feature is not activated, method returns null.
Returns company timeline type
Returns end datetime if booking is available, else return false
Returns company work schedule as array
Eg.: {'2014-05-01': {'from': '09:00:00', 'to': '21:00:00', 'is_day_off': '0'}, '2014-05-02': ...}
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 reserved_time and type
not_worked_time. reserved_time type represents time slots working time but already booked
by clients. Nobody knows what kind of data represented by not_worked_time type. Please don't use it.
If [[Plugins#Google calendar sync plugin|Google calendar sync plugin]] enabled then object with
reserved_time type will contain not empty list of time slots marked as busy in Google calendar. Call
[[#isPluginActivated|isPluginActivated('google_calendar_export')]] API method to check if Google
calendar sync plugin activated.
Example:
{
"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"
}],
...
}
Returns an information about working hours and break times for specified service and performer for a period
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:
{'2014-05-14' : [
{'from': '09:00:00', 'to': '13:00:00'},
{'from': '14:00:00', 'to': '19:00:00'}
] }
Returns first working date for unit
Returns available start time, taking into account breaktimes, start and end working time
Eg.: {'2014-05-14': ['09:00:00', ...], ...}
If locations plugin 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
more details.
Returns available start time, taking into account breaktimes, start and end working time.
The difference between getStartTimeMatrix and getCartesianStartTimeMatrix is that getCartesianStartTimeMatrix
provides time slots for each individual provider.
Eg.: {"provider_id": 1, "service_id": 1, "timeslots": {"2014-05-14": ['09:00:00', ...], ...}, ...}
If locations plugin 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
more details.
Returns available time intervals for all service providers for given period, taking into account breaktimes, start and end working time
Eg.: {['2016-03-04': ['1': [['09:00:00','09:30:00'], ['11:15:00','14:45:00']] , ...], ...]}
Returns available time intervals for all servics for given period, taking into account breaktimes, start and end working time
Eg.: {['2016-03-04': ['1': [['09:00:00','09:30:00'], ['11:15:00','14:45:00']] , ...], ...]}
Returns not available time
Eg.: {'2014-05-14': [{'reserved_time': [{'from': '14:00', 'to': '16:30'}], 'type': "reserved_time"}, ...], ...}
Returns list of available unit ids for specified date and service or empty array if all units are not allowed.
Eg.: [1, 2, 3]
Returns information about [[Plugins#Any_Employee_selector|Any Employee selector plugin]] configuration. Returns
null if plugin not enabled.
Example:
{
"description" : "Select this option, if you want to find an available time with any of the employees",
"hide_other_units" : 1, // 1 or 0
"image" : null,
"name" : "Any employee",
"picture_path" : null,
"random_selection" : 0 // 1 or 0
}
Return additional fields for certain event if [[Plugins#Additional_fields|Additional fields plugin]] is
activated. Returns empty array otherwise. Call [[#isPluginActivated|isPluginActivated('event_field')]]
API method to check if 'event_field' plugin activated.
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]].
Return plugin status true if status active, else false. $pluginName parameter is a plugin identifier.
See [[Plugins|plugins]] page for full plugins description. See [[#Plugin's identifiers|list of available plugin's names]].
Return plugin status true if status active, else false. See [[#Plugin's identifiers|list of available plugin's names]].
Returns an object with detailed information about company. See [[#getCompanyInfo response|example of response]].
Creates new booking batch record. Returns newly created batch id. You can use this id in [[#book|book]]
API method.
Returns country phone code list
Returns an object with detailed information about promotion by promotion code. You can get promotion code
using [[Catalogue#getPromotionList|getPromotionList]] 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]]
not enabled then method returns an error with code -32001 (Plugin is not activated). Use
[[#isPluginActivated|isPluginActivated('promo')]] API method call to check if plugin enabled.
See [[#getPromotionList response|example]] of getPromotionList API method response. Please note that
response contains a list of services for wich promotion discount can be applied (service_ids key).
Returns company timezone offset and company timezone
Get user db data (id, phone, is_validated)
Save configuration keys
Get structure of SMS and Email notification config params
Returns list of bookings filtered by given params. Filter params represented as object with following fields:
* '''date_from''' a date of booking in string format 'Y-m-d'
* '''time_from''' a time string in format 'H:i:s'
* '''date_to''' a date string in format 'Y-m-d'
* '''time_to''' a time string in format 'H:i:s'
* '''created_date_from''' a date string in format 'Y-m-d'
* '''created_date_to''' a date string in format 'Y-m-d'
* '''edited_date_from''' a date string in format 'Y-m-d'
* '''edited_date_to''' a date string in format 'Y-m-d'
* '''unit_group_id''' an integer. Use it to get bookings assigned for certain service provider.
* '''event_id''' an integer. Use it to get bookings only for certain service.
* '''is_confirmed''' 1 or 0. If [[Plugins#Approve booking|Approve booking]] plugin enabled then method will return confirmed bookings with approve status 'new'.
* '''client_id''' an integer. Use it to get bookings only for certain client.
* '''order''' string either 'record_date', 'date_start' or 'date_start_asc'. By default used 'date_start' value.
* '''booking_type''' a string. Value of this field depends on Approve booking plugin status.
* '''code''' booking code
*: If plugin not active:
** '''all''' for all bookings (default value)
** '''cancelled''' alias to 'is_confirmed' equal to 0
** '''non_cancelled''' alias to 'is_confirmed' equal to 1
*: If plugin active:
** '''all''' for all bookings (default value)
** '''cancelled''' returns bookings with 'is_confirmed' field equals to 0 and approve booking status equals to 'cancelled' (or booking does not have any approve status)
** '''non_cancelled''' returns bookings with either 'is_confirmed' field equals to 1 or approve booking status equals to 'new'
** '''cancelled_by_client''' returns bookings approved by admin but cancelled by client
** '''cancelled_by_admin''' returns bookings cancelled by admin
** '''non_approved_yet''' returns bookings with approve status 'new'
** '''approved''' returns bookings with either 'is_confirmed' field equals to 1 and approve booking status equals to 'approved' (or booking does not have any approve status)
Example:
{
"date_from":"2015-12-29",
"date_to":"2015-12-29",
"booking_type":"cancelled",
"event_id":"5",
"order":"start_date"
}
'create', 'cancel', 'new_client', 'change', 'create_invoice', 'change_client', 'delete_client'
Returns client data
Returns client data
Returns client data
Returns list of bookings filtered by given params
Returns detailed bookings object by booking id. See [[#getBookingDetails_response|response example]].
Get online meeting link for booking
Return busy time by unit id by GoogleCalendar plugin if enabled.
Please note that this method may return not actual data because data synchronization between server and
Google Calendar may take some time and synchronized data are cached for 15 minutes.
Returns a list of objects represented a time intervals marked as busy in Google Calendar. Each object of result
contains from and to properties with datetime string as value. This method only actual if
[Plugins#Google calendar sync plugin|Google calendar sync plugin] enabled. If plugin not enabled an empty list will
be returned. You should call [[#isPluginActivated|isPluginActivated('google_calendar_export')]] to
check status of the plugin. Each object of result contains from and to properties with
datetime string as value. Please note that this method may return not actual data because data synchronization
between server and Google Calendar may take some time and synchronized data are cached for 15 minutes.
Example:
[
{"from" : "2016-02-16 13:30:00",
"to" : "2016-02-16 16:00:00"},
...
]
Returns configured unit ids, allowed to sync busy time
Returns time intervals not available for bookings because of configuration of [[Plugins#Limit bookings|Limit bookings]]
plugin for period of time. Returns empty array if plugin not available.
Return working durations
Return workload data for units in period of time. Workload for each unit represented as array with work hours
at index 0, confirmed booking hours as load at index 1 and cancelled bookings hours at index 2.
Example:
['2015-10-21' : {
5 : [
10, // working hours
10, // load hours (confirmed bookings hours)
0 // cancelled bookings hours
] }]
Return bookings count and revenue value for each date in specified period. Data grouped by unit id and
represented as array with bookings count at index 0 and revenue amount at index 1. You can filter data either
by unit or by service. Set $dateStart and $dateEnd to null to get data for current week.
Example:
['2015-11-12' : {
3 : [
11, // bookings count
128.53 // revenue
]}
Return workday info (date_start and date_end)
Cancels booking. Returns true on success. Returns an error with code -32080 (Appointment couldn't be found) if
no booking with specified id were found.
Cancel batch of bookings. Returns true on success. Returns an error with code -32080 (Appointment couldn't be found)
if no booking with specified id were found. A booking with first id in $bookingIds list is used for
information in notifications.
Creates new booking record. Returns an object with appointment information or throw exception if booking time not
available or any of required parameters missed. If appointment requires confirmation, in result object will be
require_confirm = true. $startDate and $startTime specifies a date of
booking and time slot. Time value should be multiple to 'timeframe' configuration of company (see
[[#getTimeframe|getTimeframe]] API method). $endDate and $endTime parameters
should be calculated according to service duration. However you can specify different values to make appointment
longer or shorter then service configuration. Note that $endDate and $endTime should be
later in time than $startDate and $startTime. If your clients located in different time
zone you should specify 'client_time_offset' value in $clientData object as difference
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 $clientTimeOffset will be 60 minutes.
You can get information about company's
time zone using [[#getCompanyInfo|getCompanyInfo]] API method. To create batch booking you can
specify either count more then 1 or valid batchId (only one parameter can be
specified). You should specify an $additionalFields parameter if service requires some additional
fields (see [[Plugins#Additional fields|Additional fields plugin]]).
To create a booking with promo code you should pass it as additional field. For example: {"promocode": "some code"}
If [[Plugins#Unit location|Unit location]] enabled you need to pass locations ID parameter as additional field
location_id. For example: {"location_id": "1"}. Use [[#isPluginActivated|isPluginActivated('location')]]
to check if plugin active and [[#getLocationsList|getLocationsList()]] method to get list of
available locations.
See [[#book response|example]] of book API method response.
Edit existing booking record. See [[#book|book]] API method description for more details about date/time parameters,
time zone handling and additional fields. Returns null if parameters not valid.
Adds new client with specified data. You can specify name, email, phone, address1, address2, city, zip,
country_id.
email, phone number or both of them can be mandatory fields. You should call
getCompanyParam('require_fields') method to check which fields are required.
Method returns an error:
* -32061 Client name value is wrong
* -32062 Client email value is wrong
* -32063 Client phone value is wrong
Example:
{
name: "Frances T. Perez",
phone: "+1502-810-4521",
email: "FrancesTPerez@teleworm.us",
address1: "3872 Earnhardt Drive",
address2: "Louisville, KY 40219",
city: Louisville,
zip: 3872
}
Edits client's record. See [[#addClient|addClient]] method description for list of available fields.
Method returns an id of client's record.
Change client password and send password email changing
Resets client password and send them emails
Sends remind email for client
Returns list of clients associated with company. You can use either phone number, email address or name as value
for $searchString. Pass an empty string for $searchString and null for $limit
parameters to get all records. See [[#addClient|addClient]] API method for list of available fields
of client data object.
Returns list of available statuses or an empty list if [[Plugins#Status|Status plugin]] not enabled.
Returns status of given booking (if status plugin is enabled)
default status will be returned if bookingId does not exists
Sets specified status for booking. Returns an error with code -32020 if logged in user don't have access to edit
bookings. This method does nothing if [[Plugins#Status|Status plugin]] not enabled.
Returns an object with recurring settings for an event. Returns false if specified event does not configured as
recurring.
Returns a list with statistics for services for a period of time. This data contains number of bookings and
revenues value for each service.
Returns a list with statistics for performers. This data contains number of bookings and revenues value for each performer.
Get list of dates for recurring booking
Get list of all countries
Get list of all country states
Get list of feedbacks
Returns latest actions
Returns a list of objects represented system warnings. Each warning contains warning_type and warning_text
properties. warning_text property contains localized message. warning_type can be one of the values:
* '''sms_limit''' – warning indicates low amount of SMS credits
* '''sheduler_limit''' – warning indicates low amount of available bookings
Mark notifications as readed
Returns last update datetime
Returns statistics about created bookings and cancellations for a time period. Data presented as array of hashes for
each type of operation (created or cancelled booking) groped by clients. "type" field can be either
"create", "cancel" or "nopayment_cancel". If "user_id" not specified then bookings where created or
cancelled by admin or employee. Data with type "nopayment_cancel" represents bookings cancelled
automatically by system.
Example:
3 bookings where created by admin or employee and 2 bookings where automatically cancelled by system.
[{
"cnt" : 3,
"firstname" : null,
"lastname" : null,
"login" : null,
"type" : "create",
"user_id"" : null
}, {
"cnt" : 2,
"firstname" : null,
"lastname" : null,
"login" : null,
"type" : "nopayment_cancel",
"user_id"" : null
}]
Sets approve booking status to 'approved' if [[Plugins#Approve booking|Approve booking]] plugin enabled and returns
list of approved booking IDs. Returns false if plugin not enabled. Use [[#isPluginActivated|isPluginActivated('approve_booking')]]
API method call to check if plugin enabled.
Sets approve booking status to 'canceled' if [[Plugins#Approve booking|Approve booking]] plugin enabled and returns
true. Returns false if plugin not enabled. Use [[#isPluginActivated|isPluginActivated('approve_booking')]]
API method call to check if plugin enabled.
Returns count of bookings pending approval if [[Plugins#Approve booking|Approve booking]] plugin enabled. Returns
0 if plugin not enabled. Use [[#isPluginActivated|isPluginActivated('approve_booking')]] API method
call to check if plugin enabled.
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 [[#isPluginActivated|isPluginActivated('approve_booking')]]
API method call to check if plugin enabled.
Returns a list of all plugins associated with company with status.
Returns booking comment
Set booking comment
Returns all information about current tariff (subscription). For example:
{
"name" : "gold",
"expire_date" : "2016-02-11 12:32:00",
"rest" : 41, // number of days until subscription expiration
"color" : "#fcb322"
}
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
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
Returns statistics about page visits if plugin [[Plugins#Visitor Counter|Visitor Counter plugin]] enabled. Returns
an empty list if plugin not enabled. Use [[#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
Returns social counters value for your domain
Returns company's currency as three chars code (ISO 4217).
Returns list of all comments for given client
Returns current SOAP information by client id
Returns SOAP history by client id
Returns current SOAP (crypt) information by client id
Returns SOAP (crypt) history by client id
Returns an object with information about logged in user. Note: you are responsible for implementation of some
access rights based on group property value. Most of API methods returns an error if user has low access
rights but not all. There are 4 roles:
* '''Administrator''' - have full access to the system
* '''Senior Employee''' - have access to calendar, services and providers, and can modify bookings related with user
* '''Junior Employee''' - can access caledar (but only to own bookings), services associated with user
* '''Viewer''' - have only access to calendar and services in read only mode
group property can be one of the values:
* shop_user - "Senior Employee" access role
* station_user - "Junior Employee" access role
* admin - "Administrator" access role
* viewer - "Viewer" access role
* reseller_company_admin - reserved
Example:
{
"id": 1,
"login": admin,
"email": "admin@mycoolcompany.com";
"firstname": "Michail",
"lastname": " ",
"phone": "",
"group": "admin",
"is_blocked": 0,
"last_access_time": "2016-06-06 17:55:51",
"unit_group_id": null
}
Returns company categories list if [[Plugins#Service categories|Service categories plugin]] is activated. Returns
an error with code -32001 if plugin is not activated. Use [[#isPluginActivated|isPluginActivated('event_category')]]
API method to check if plugin activated.
Returns available locations for company if plugin [[Plugins#Unit location|Unit location plugin]] is activated. Return
an error with code -32001 if plugin is not activated. Use [[#isPluginActivated|isPluginActivated('location')]]
API method to check if plugin 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.
Returns membership's data object.
Returns purchased membership list
Set work day schedule for company|service|provider for week_day|date
Example:
{
"start_time":"10:00",
"end_time":"18:00",
"is_day_off":0,
"breaktime":[{"start_time":"14:00","end_time":"15:00"}],
"index":"1",
"name":"Monday",
"date":"",
"unit_group_id":"",
"event_id":""
}
index is 1-7 for Monday - Sunday (used for weekly settings)
date is used to set worktime for special date
unit_group_id is provider id
event_id is service id
if unit_group_id and event_id not passed then it set data for company
Delete special date if set
Example:
{
"unit_group_id":"",
"event_id":""
}
Returns company special days and vacations
Returns special days and vacations, defined for given service (event)
Get list of company vacations in format array(vacation_id => array())
Get list of service vacations
Get list of performer vacations
Get company vacation by id
Get service vacation by id
Get service vacation by id
Save company vacation data
(create or update table depending on 'id' param existing in $data)
Save company vacation data
(create or update table depending on 'id' param existing in $data)
Save company vacation data
(create or update table depending on 'id' param existing in $data)
Delete company vacation with all it's bindings
(including created special days in work_day_special table)
Delete service vacation with all it's bindings
(including created special days in work_day_special table)
Delete performer vacation with all it's bindings
(including created special days in work_day_special table)
Returns company's classes list. If $asArray 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
class's details object.
Returns product list with filter.
At this time filter can accept only service_id parameter
Get paginated data for Booking report
The following filters can be provided in request param:
Date date_from, date_to, created_date_from, created_date_to
Integer unit_group_id, client_id
String code, promo_code
String booking_type = 'approved' | 'not_approved_yet' | 'cancelled_by_admin' | 'cancelled_by_client' | 'non_cancelled' | 'cancelled' | 'all'
Order can be one of the following values: record_date, date_start, date_start_asc
Return data in the following format:
array(
'data' => $data,
'metadata' => array(
'items_count'
'pages_count'
'page'
'on_page'
)
or Api_Service_Exception in error case
Get paginated data for Client report
The following filters can be provided in request param:
Date date_from, date_to
Integer event_id, unit_group_id, client_id
String client_search (search string, can contains client name, address, phone)
String service_using_type = 'used_in_period' | 'not_used_in_period' | 'not_used_in_period_but_used_before'
No custom ordering implemented yet
Group data = 'client' | 'client_email_phone' | 'client_email' | 'client_phone'
Return data in the following format:
array(
'data' => $data,
'metadata' => array(
'items_count'
'pages_count'
'page'
'on_page'
)
or Api_Service_Exception in error case
Get paginated data for SMS report
The following filters can be provided in request param:
Date date_from, date_to
Integer unit_group_id, client_id
String phone, message
No custom ordering implemented yet (always ordered by client name)
Return data in the following format:
array(
'data' => $data,
'metadata' => array(
'items_count'
'pages_count'
'page'
'on_page'
)
or Api_Service_Exception in error case
gets differend sms providers(transport) used by system
Get paginated data for email report
Return data in the following format:
array(
'data' => $data,
'metadata' => array(
'items_count'
'pages_count'
'page'
'on_page'
)
or Api_Service_Exception in error case
Get paginated data for Pos report
Return data in the following format:
array(
'data' => $data,
'metadata' => array(
'items_count'
'pages_count'
'page'
'on_page'
)
or Api_Service_Exception in error case
Get paginated data for Feedback report
The following filters can be provided in request param:
Date date_from, date_to
Integer from 1 to 5 rate_from, rate_to
String name, subject, message
Report can be ordered by one of the following fields:
date, rate, name, message, subject, answer
Return data in the following format:
array(
'data' => $data,
'metadata' => array(
'items_count'
'pages_count'
'page'
'on_page'
)
or Api_Service_Exception in error case
Get detailed list of promotions (new)
Get all list of promotion instances
Return promotion detailed info
Get static page list
Confirms invoice by id
Applies promo code to order (Coupons & Gift Cards custom feature)
Applies tip to order (Tips custom feature)
You can apply tip by percent or by amount
Returns company information for the current 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
allowed. See [[#Company_params|list of available keys]].
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_params|list of available keys]].
Returns cancellation policy rules.
If cancellation policy custom feature is not activated, method returns null.
Returns company timeline type
Returns company's events list. If $asArray 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.
Returns list of service performers. If $asArray 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.
Returns end datetime if booking is available, else return false
Returns company work schedule as array
Eg.: {'2014-05-01': {'from': '09:00:00', 'to': '21:00:00', 'is_day_off': '0'}, '2014-05-02': ...}
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 reserved_time and type
not_worked_time. reserved_time type represents time slots working time but already booked
by clients. Nobody knows what kind of data represented by not_worked_time type. Please don't use it.
If [[Plugins#Google calendar sync plugin|Google calendar sync plugin]] enabled then object with
reserved_time type will contain not empty list of time slots marked as busy in Google calendar. Call
[[#isPluginActivated|isPluginActivated('google_calendar_export')]] API method to check if Google
calendar sync plugin activated.
Example:
{
"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"
}],
...
}
Returns an information about working hours and break times for specified service and performer for a period
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:
{'2014-05-14' : [
{'from': '09:00:00', 'to': '13:00:00'},
{'from': '14:00:00', 'to': '19:00:00'}
] }
Returns first working date for unit
Returns available start time, taking into account breaktimes, start and end working time
Eg.: {'2014-05-14': ['09:00:00', ...], ...}
If locations plugin 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
more details.
Returns available start time, taking into account breaktimes, start and end working time.
The difference between getStartTimeMatrix and getCartesianStartTimeMatrix is that getCartesianStartTimeMatrix
provides time slots for each individual provider.
Eg.: {"provider_id": 1, "service_id": 1, "timeslots": {"2014-05-14": ['09:00:00', ...], ...}, ...}
If locations plugin 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
more details.
Returns available time intervals for all service providers for given period, taking into account breaktimes, start and end working time
Eg.: {['2016-03-04': ['1': [['09:00:00','09:30:00'], ['11:15:00','14:45:00']] , ...], ...]}
Returns available time intervals for all servics for given period, taking into account breaktimes, start and end working time
Eg.: {['2016-03-04': ['1': [['09:00:00','09:30:00'], ['11:15:00','14:45:00']] , ...], ...]}
Returns not available time
Eg.: {'2014-05-14': [{'reserved_time': [{'from': '14:00', 'to': '16:30'}], 'type': "reserved_time"}, ...], ...}
Returns list of available unit ids for specified date and service or empty array if all units are not allowed.
Eg.: [1, 2, 3]
Returns information about [[Plugins#Any_Employee_selector|Any Employee selector plugin]] configuration. Returns
null if plugin not enabled.
Example:
{
"description" : "Select this option, if you want to find an available time with any of the employees",
"hide_other_units" : 1, // 1 or 0
"image" : null,
"name" : "Any employee",
"picture_path" : null,
"random_selection" : 0 // 1 or 0
}
Return additional fields for certain event if [[Plugins#Additional_fields|Additional fields plugin]] is
activated. Returns empty array otherwise. Call [[#isPluginActivated|isPluginActivated('event_field')]]
API method to check if 'event_field' plugin activated.
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]].
Return plugin status true if status active, else false. $pluginName parameter is a plugin identifier.
See [[Plugins|plugins]] page for full plugins description. See [[#Plugin's identifiers|list of available plugin's names]].
Return plugin status true if status active, else false. See [[#Plugin's identifiers|list of available plugin's names]].
Creates new booking batch record. Returns newly created batch id. You can use this id in [[#book|book]]
API method.
Returns country phone code list
Returns an object with detailed information about promotion by promotion code. You can get promotion code
using [[Catalogue#getPromotionList|getPromotionList]] 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]]
not enabled then method returns an error with code -32001 (Plugin is not activated). Use
[[#isPluginActivated|isPluginActivated('promo')]] API method call to check if plugin enabled.
See [[#getPromotionList response|example]] of getPromotionList API method response. Please note that
response contains a list of services for wich promotion discount can be applied (service_ids key).
Returns company timezone offset and company timezone
Returns companies list
$filter filter params. Object that contains following params
'search_string': String,
'service_name': String,
'company_name': String,
'company_address': String,
'category_id': Integer,
'tag_ids': [Integer, Integer, ...],
'tags': String,
'country_id': String,
'city_id': String,
'nearby': {
'radius': Integer,
'center': {
'lat': Number,
'lng': NUmber
}
}
Returns active promotion list
$filter filter params. Object that contains following params
'search_string': String,
'service_name': String,
'company_name': String,
'company_address': String,
'tag_ids': [Integer, Integer, ...],
'tags': String,
'country_id': String,
'city_id': String,
'nearby': {
'radius': Integer,
'center': {
'lat': Number,
'lng': NUmber
}
}
Returns active promotion list
Returns total companies count with specified filter
$filter filter params. Object that contains following params
'search_string': String,
'service_name': String,
'company_name': String,
'company_address': String,
'tag_ids': [Integer, Integer, ...],
'tags': String,
'country_id': String,
'city_id': String,
'nearby': {
'radius': Integer,
'center': {
'lat': Number,
'lng': NUmber
}
}
Returns total active promotions count with specified filter
$filter filter params. Object that contains following params
'search_string': String,
'service_name': String,
'company_name': String,
'company_address': String,
'tag_ids': [Integer, Integer, ...],
'tags': String,
'country_id': String,
'city_id': String,
'nearby': {
'radius': Integer,
'center': {
'lat': Number,
'lng': NUmber
}
}
Returns country list as Array order by company count in country
Returns city list as Array order by company count in city
Returns a list of objects with just two properties each: id and country. An id
is a two character string with ISO 3166-1 country code.
Returns a list of objects. If $country parametr specified then method returns only cities of this
country. Each object in list has 4 properties:
* id - number. A unique identificator of city. You should use it as filter options in methods getCompanyList.
* city - string. A city name.
* count_id - string. Two chars ISO 3166-1 country code.
* count - number.
Example:
[{
"cnt" : 7,
"country_id"" : "GB",
"id" : 4607,
"name" : "Uxbridge"
},
...]
Returns tags list
$filter filter params. Object that contains following params
'tag_ids': [Integer, Integer, ...],
'tags': String,
'country_id': String,
'city_id': String
Returns company information by company login
Returns promotion information by id
Returns related promotions by given promotion id
Returns a list of company's review objects.
[{
"company_id" : 86409,
"domain" : "simplybook.me",
"feedback_datetime" : "2015-10-27 13:06:57",
"feedback_id" : 4623,
"feedback_link" : "",
"id" : 17384,
"image" : "http://graph.facebook.com/1020443689023222/picture",
"link" : "https://www.facebook.com/app_scoped_user_id/1020443689023222/",
"message" : "Brilliant!",
"name" : "Simply Booker",
"provider" : "",
"provider_data" : "...", // String. An object encoded with PHP's serialize method.
"rate" : 5, // 0 to 5 rate
"status" : "approved", // 'new' or 'approved'
"subject" : "Good",
"with_comment" : 1
},
...]
Returns company's reviews count
Returns a company's review objects.
Returns a list of company's review likes.
Adds company review
Add promotion review
Returns promotion reviews list
Returns list of promotions ordered by date DESC
Returns list of feedbacs ordered by date DESC
Returns list of companies ordered by date DESC
Returns all categories as list of objects. Each category can have a subcategories. Each subcategory contains parent
category id in company_category_id field. For top level categories this field is null and
is_header field is true.
Example:
[{
"company_category_id": null,
"id": "1",
"image": "/common/images/category_icons/car.png",
"is_active": "1",
"is_header": "1",
"name": "Cars",
},
{
"company_category_id": "1",
"id" = 11;
"image": null,
"is_active": "1",
"is_header": "0",
"name": "Car wash",
},
...]
Get list of ALL simplybook feedbacks
Returns a list of promotions objects associated with specified company. If company doesn't have any promotions or
[[Plugins#Simply_Smart_Promotions|Simply Smart Promotions plugin]] not active for this company method returns an
empty list.
Returns user location info
Returns suggestions for autocompeter
$filter filter params. Object that contains following params
'search_string': String,
'service_name': String,
'company_name': String,
'company_address': String,
'category_id': Integer,
'tag_ids': [Integer, Integer, ...],
'tags': String,
'country_id': String,
'city_id': String,
'nearby': {
'radius': Integer,
'center': {
'lat': Number,
'lng': NUmber
}
}
Anonymize client feedbacks and feedback likes
according to GDPR client's right to be forgotten
Delete promotion_feedbak and promotion_feedback_response data
according to GDPR client's right to be forgotten
Swagger (also known as OpenAPI) is a standard format for describing REST APIs. It allows both humans and computers to understand the capabilities of an API without access to source code, documentation, or network traffic inspection.
Key benefits of using Swagger/OpenAPI include:
Useful Tools:
Swagger (also known as OpenAPI) is a standard format for describing REST APIs. It allows both humans and computers to understand the capabilities of an API without access to source code, documentation, or network traffic inspection.
Key benefits of using Swagger/OpenAPI include:
Useful Tools:
クリアでシンプルなインターフェイス。スムーズにあなた自身の予約サービスが構築できます。
必要なプラグイン機能を拡張できます
リアルタイムスケジューリング – クライアントは24時間・365日、どこからでも予約ができます
このアプリは別の使いやすい機能を豊富に提供します。ここをクリックして、機能に関してもっと知りましょう。
クライアントが望む機能を提供することで、あなたのウェブサイトとアプリをより興味深く、より収益性が高く、よりクライアントとの関係性の高いものに。私たちのAPIを使うことで、簡単に「今すぐ予約」ボタンをあなたのウェブサイトに。これであなたのクライアントはリアルタイムで昼でも夜でも予約が取れるようになります。
私たちのAPIはあなたが予約機能を立ち上げるために必要なすべての予約データへのアクセスを可能にします。
クライアントとあなたのビジネススケジュールをつなぐことで、私たちは新たなビジネスレイヤーを創造します。 ウェブサイトやアプリからのダイレクト予約システムは潜在的なカスタマーの発掘ではなく、実際にカスタマーとしてあなたにお届けします。