

操作ガイド
ここでは、予約に関連するAPIエンドポイントを確認できます。
リクエストとレスポンスの例を含むすべてのAPIエンドポイントは、こちらからダウンロードできるAmelia API Postmanコレクションで確認できます。
APIエンドポイントの使用には一定レベルのコーディングスキルが必要であり、プラグイン付属のサポートには含まれていません。
すべてのAmeliaエンドポイントは、「Amelia」という名前のヘッダープロパティを使用したAPIキー認証を使用します。
Amelia APIのパスは、以下の形式で始まります。
{{your_site_URL}}/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1
予約情報を含めて予約を作成します。
メソッド
このエンドポイントはPOSTリクエストを受け付けます。
パス
/appointments
必須プロパティ
以下のプロパティが必須です。
| キー | タイプ | 説明 |
bookingStart | string | 予約の開始日時。「YYYY-MM-DD HH:mm」形式。 |
bookings | array | 予約情報の配列。予約オブジェクトには、既存のお客様のcustomerIdが含まれている必要があります。予約時に新しいお客様を作成したい場合は、/bookingsエンドポイントを使用してください。 |
notifyParticipants | boolean | お客様に予約について通知するかどうか。 |
locationId | integer | 予約の場所ID。 |
providerId | integer | 予約に割り当てられたスタッフのID。 |
serviceId | integer | 予約のサービスID。 |
recurring | array | 定期的な予約の配列。予約が定期的なものである場合は必須です。 |
その他のプロパティ
| キー | タイプ | 説明 |
internalNotes | string | 内部メモ。 |
timeZone | string | お客様のタイムゾーン。例:「Europe/Belgrade」 |
lessonSpace | string | 予約に割り当てるレッスン空間ID。デフォルトでは新規作成されます。 |
utc | boolean | 日付時刻がUTC(協定世界時)で送信されるかどうか。デフォルトはFalseです。 |
例:
curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/appointments' \
--header 'Content-Type: application/json' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0' \
--data '{
"bookingStart": "2023-10-05 13:00",
"bookings": [
{
"customFields": "{\"1\":{\"label\":\"text\",\"value\":\"\",\"type\":\"text\"}}",
"customerId": 10,
"duration": 1800,
"extras": [],
"packageCustomerId": null,
"persons": 1,
"status": "approved"
}
],
"internalNotes": "",
"lessonSpace": "",
"locationId": 2,
"notifyParticipants": 1,
"providerId": 1,
"recurring": [],
"serviceId": 1,
"timeZone": "Europe/Belgrade",
"utc": false
}'{
"message": "Successfully added new appointment",
"data": {
"appointment": {
"id": 742,
"bookings": [
{
"id": 979,
"customerId": 10,
"customer": null,
"status": "approved",
"extras": [],
"couponId": null,
"price": 23,
"coupon": null,
"customFields": "{\"1\":{\"label\":\"text\",\"value\":\"\",\"type\":\"text\"}}",
"info": null,
"appointmentId": 742,
"persons": 1,
"token": "e22f812066",
"payments": [
{
"id": 1000,
"customerBookingId": 979,
"packageCustomerId": null,
"parentId": null,
"amount": 0,
"gateway": "onSite",
"gatewayTitle": "",
"dateTime": "2023-10-05 13:00:00",
"status": "pending",
"data": "",
"entity": "appointment",
"created": null,
"actionsCompleted": true,
"wcOrderId": null,
"wcOrderUrl": null,
"wcItemCouponValue": null,
"wcItemTaxValue": null,
"transactionId": null
}
],
"utcOffset": null,
"aggregatedPrice": true,
"isChangedStatus": true,
"isLastBooking": null,
"packageCustomerService": null,
"ticketsData": [],
"duration": 1800,
"created": "2023-09-26 10:19:00",
"actionsCompleted": true,
"isUpdated": null
}
],
"notifyParticipants": 1,
"internalNotes": "",
"status": "approved",
"serviceId": 1,
"parentId": null,
"providerId": 1,
"locationId": 2,
"provider": null,
"service": null,
"location": null,
"googleCalendarEventId": null,
"googleMeetUrl": null,
"outlookCalendarEventId": null,
"zoomMeeting": null,
"lessonSpace": null,
"bookingStart": "2023-10-05 13:00:00",
"bookingEnd": "2023-10-05 13:30:00",
"type": "appointment",
"isRescheduled": null,
"isFull": null,
"resources": []
},
"recurring": []
}
}予約の詳細を更新します。予約ステータスを更新するには、/appointments/statusエンドポイントを使用してください。
メソッド
このエンドポイントはPOSTリクエストを受け付けます。
パス
/appointments/{{appointment_id}}
オプションプロパティ
更新したいプロパティのみを送信してください。
| キー | タイプ | 説明 |
bookingStart | string | 予約の開始日時。「YYYY-MM-DD HH:mm」形式。 |
bookings | array | 予約情報の配列。 |
notifyParticipants | boolean | お客様に予約について通知するかどうか。 |
locationId | integer | 予約の場所ID。 |
providerId | integer | 予約に割り当てられたスタッフのID。 |
serviceId | integer | 予約のサービスID。 |
internalNotes | string | 内部メモ。 |
lessonSpace | string | 予約に割り当てるレッスン空間ID。デフォルトでは新規作成されます。 |
removedBookings | array | 削除される予約の配列。 |
recurring | array | 定期的な予約の配列。予約が定期的なものである場合は必須です。 |
例:
curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/appointments/742' \
--header 'Content-Type: application/json' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0' \
--data '{
"bookingStart": "2023-10-05 11:00",
"bookings": [
{
"id": 979,
"customFields": "{\"1\":{\"label\":\"text\",\"value\":\"\",\"type\":\"text\"}}",
"customerId": 10,
"duration": 1800,
"extras": [],
"packageCustomerId": null,
"persons": 2,
"status": "approved"
}
],
"internalNotes": "",
"lessonSpace": "",
"locationId": 2,
"notifyParticipants": 1,
"providerId": 1,
"removedBookings": [],
"serviceId": 1
}{
"message": "Successfully updated appointment",
"data": {
"appointment": {
"id": 742,
"bookings": [
{
"id": 979,
"customerId": 10,
"customer": null,
"status": "approved",
"extras": [],
"couponId": null,
"price": 23,
"coupon": null,
"customFields": "{\"1\":{\"label\":\"text\",\"value\":\"\",\"type\":\"text\"}}",
"info": null,
"appointmentId": null,
"persons": 2,
"token": null,
"payments": [],
"utcOffset": null,
"aggregatedPrice": null,
"isChangedStatus": false,
"isLastBooking": null,
"packageCustomerService": null,
"ticketsData": [],
"duration": 1800,
"created": "2023-09-26 10:19:00",
"actionsCompleted": null,
"isUpdated": true
}
],
"notifyParticipants": 1,
"internalNotes": "",
"status": "approved",
"serviceId": 1,
"parentId": null,
"providerId": 1,
"locationId": 2,
"provider": null,
"service": null,
"location": null,
"googleCalendarEventId": "hlda2snvbh7llqbupsgnels3io",
"googleMeetUrl": null,
"outlookCalendarEventId": "AQMkADAwATYwMAItZTk0ZS1lMGRmLTAwAi0wMAoARgAAA3egvCudOo1GsyywV8xCQ2wHANjP2dT7pGFAu0b6VBSGJOoAAAIBDQAAANjP2dT7pGFAu0b6VBSGJOoABsaEPm0AAAA=",
"zoomMeeting": {
"id": 76092515836,
"startUrl": "https://us04web.zoom.us/s/76092515836?zak=eyJ0eXAiOiJKV1QiLCJzdiI6IjAwMDAwMSIsInptX3NrbSI6InptX28ybSIsImFsZyI6IkhTMjU2In0.eyJhdWQiOiJjbGllbnRzbSIsInVpZCI6IlBNUVVXdlVXVEJLMVh6cW11YVM2LUEiLCJpc3MiOiJ3ZWIiLCJzayI6Ijg0OTc4OTYwMzQ5OTI5NjU2NDUiLCJzdHkiOjEwMCwid2NkIjoidXMwNCIsImNsdCI6MCwibW51bSI6Ijc2MDkyNTE1ODM2IiwiZXhwIjoxNjk1NzIzNTQyLCJpYXQiOjE2OTU3MTYzNDIsImFpZCI6Ing4ejhiTG1WUzJLODA0aktOa09lTmciLCJjaWQiOiIifQ.5stnr-oa5EhUGp5H_oIrb9ckfTq6WGu0TxGw7Mzo7t4",
"joinUrl": "https://us04web.zoom.us/j/76092515836?pwd=O3kmYBTPHsxTSMKe7mKrAbSllftaJ7.1"
},
"lessonSpace": null,
"bookingStart": "2023-10-05 11:00:00",
"bookingEnd": "2023-10-05 11:30:00",
"type": "appointment",
"isRescheduled": null,
"isFull": null,
"resources": []
},
"appointmentStatusChanged": false,
"appointmentRescheduled": false,
"initialAppointmentDateTime": {
"bookingStart": "2023-10-05 11:00:00",
"bookingEnd": "2023-10-05 11:30:00"
},
"bookingsWithChangedStatus": [],
"appointmentEmployeeChanged": null,
"appointmentZoomUserChanged": false,
"bookingAdded": false,
"appointmentZoomUsersLicenced": false,
"createPaymentLinks": null
}
}予約グループのステータスを更新します。
メソッド
このエンドポイントはPOSTリクエストを受け付けます。
パス
appointments/status/{{appointment_id}}
必須プロパティ
以下のプロパティが必須です。
| キー | タイプ | 説明 |
status | string | 新しい予約ステータス。取りうる値: approved (承認済み)、pending (保留中)、canceled (キャンセル済み)、rejected (拒否済み)、no-show (無断欠席) |
packageCustomerId | integer | 予約がコースの一部である場合、お客様コースID。 |
例:
curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/appointments/status/742'
--header 'Content-Type: application/json'
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0'
--data '{
"status": "pending",
"packageCustomerId": null
}'{
"message": "Successfully updated appointment status",
"data": {
"appointment": {
"id": 742,
"bookings": [
{
"id": 979,
"customerId": 10,
"customer": null,
"status": "pending",
"extras": [],
"couponId": null,
"price": 23,
"coupon": null,
"customFields": "{\"1\":{\"label\":\"text\",\"value\":\"\",\"type\":\"text\"}}",
"info": null,
"appointmentId": 742,
"persons": 2,
"token": null,
"payments": [
{
"id": 1000,
"customerBookingId": 979,
"packageCustomerId": null,
"parentId": null,
"amount": 0,
"gateway": "onSite",
"gatewayTitle": "",
"dateTime": "2023-10-05 13:00:00",
"status": "pending",
"data": "",
"entity": null,
"created": null,
"actionsCompleted": null,
"wcOrderId": null,
"wcOrderUrl": null,
"wcItemCouponValue": null,
"wcItemTaxValue": null,
"transactionId": null
}
],
"utcOffset": null,
"aggregatedPrice": true,
"isChangedStatus": false,
"isLastBooking": null,
"packageCustomerService": null,
"ticketsData": [],
"duration": 1800,
"created": "2023-09-26 10:19:00",
"actionsCompleted": null,
"isUpdated": null
}
],
"notifyParticipants": 1,
"internalNotes": "",
"status": "pending",
"serviceId": 1,
"parentId": null,
"providerId": 1,
"locationId": 2,
"provider": null,
"service": null,
"location": null,
"googleCalendarEventId": "hlda2snvbh7llqbupsgnels3io",
"googleMeetUrl": null,
"outlookCalendarEventId": null,
"zoomMeeting": null,
"lessonSpace": null,
"bookingStart": "2023-10-05 11:00:00",
"bookingEnd": "2023-10-05 11:30:00",
"type": "appointment",
"isRescheduled": null,
"isFull": null,
"resources": []
},
"bookingsWithChangedStatus": [],
"status": "pending",
"oldStatus": "pending",
"message": "Appointment status has been changed to pending"
}
}予約の詳細を取得します。
メソッド
このエンドポイントはGETリクエストを受け付けます。
パス
appointments/{{appointment_id}}
例:
curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/appointments/742'
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0'{
"message": "Successfully retrieved appointment",
"data": {
"appointment": {
"id": 742,
"bookings": [
{
"id": 979,
"customerId": 10,
"customer": null,
"status": "pending",
"extras": [],
"couponId": null,
"price": 23,
"coupon": null,
"customFields": "{\"1\":{\"label\":\"text\",\"value\":\"\",\"type\":\"text\"}}",
"info": null,
"appointmentId": 742,
"persons": 2,
"token": null,
"payments": [
{
"id": 1000,
"customerBookingId": 979,
"packageCustomerId": null,
"parentId": null,
"amount": 0,
"gateway": "onSite",
"gatewayTitle": "",
"dateTime": "2023-10-05 13:00:00",
"status": "pending",
"data": "",
"entity": null,
"created": null,
"actionsCompleted": null,
"wcOrderId": null,
"wcOrderUrl": null,
"wcItemCouponValue": null,
"wcItemTaxValue": null,
"transactionId": null
}
],
"utcOffset": null,
"aggregatedPrice": true,
"isChangedStatus": null,
"isLastBooking": null,
"packageCustomerService": null,
"ticketsData": [],
"duration": 1800,
"created": "2023-09-26 10:19:00",
"actionsCompleted": null,
"isUpdated": null
}
],
"notifyParticipants": 1,
"internalNotes": "",
"status": "pending",
"serviceId": 1,
"parentId": null,
"providerId": 1,
"locationId": 2,
"provider": null,
"service": null,
"location": null,
"googleCalendarEventId": "hlda2snvbh7llqbupsgnels3io",
"googleMeetUrl": null,
"outlookCalendarEventId": null,
"zoomMeeting": null,
"lessonSpace": null,
"bookingStart": "2023-10-05 11:00:00",
"bookingEnd": "2023-10-05 11:30:00",
"type": "appointment",
"isRescheduled": null,
"isFull": null,
"resources": []
},
"recurring": []
}
}複数の予約の詳細を取得します。
メソッド
このエンドポイントはGETリクエストを受け付けます。
パス
appointments
| キー | タイプ | 説明 |
dates | string | 予約を取得する開始日と終了日。 |
page | integer | ページ番号。制限は基本設定で定められています。 |
skipServices | boolean | サービスの詳細も取得するかどうか。 |
skipProviders | boolean | スタッフの詳細も取得するかどうか。 |
asArray | boolean | 取得された予約が配列形式になるかどうか。デフォルトはFalseで、キーが予約日であるオブジェクトとして送信されます。 |
例:
curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/appointments/742'
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0'{
"message": "Successfully retrieved appointment",
"data": {
"appointment": {
"id": 742,
"bookings": [
{
"id": 979,
"customerId": 10,
"customer": null,
"status": "pending",
"extras": [],
"couponId": null,
"price": 23,
"coupon": null,
"customFields": "{\"1\":{\"label\":\"text\",\"value\":\"\",\"type\":\"text\"}}",
"info": null,
"appointmentId": 742,
"persons": 2,
"token": null,
"payments": [
{
"id": 1000,
"customerBookingId": 979,
"packageCustomerId": null,
"parentId": null,
"amount": 0,
"gateway": "onSite",
"gatewayTitle": "",
"dateTime": "2023-10-05 13:00:00",
"status": "pending",
"data": "",
"entity": null,
"created": null,
"actionsCompleted": null,
"wcOrderId": null,
"wcOrderUrl": null,
"wcItemCouponValue": null,
"wcItemTaxValue": null,
"transactionId": null
}
],
"utcOffset": null,
"aggregatedPrice": true,
"isChangedStatus": null,
"isLastBooking": null,
"packageCustomerService": null,
"ticketsData": [],
"duration": 1800,
"created": "2023-09-26 10:19:00",
"actionsCompleted": null,
"isUpdated": null
}
],
"notifyParticipants": 1,
"internalNotes": "",
"status": "pending",
"serviceId": 1,
"parentId": null,
"providerId": 1,
"locationId": 2,
"provider": null,
"service": null,
"location": null,
"googleCalendarEventId": "hlda2snvbh7llqbupsgnels3io",
"googleMeetUrl": null,
"outlookCalendarEventId": null,
"zoomMeeting": null,
"lessonSpace": null,
"bookingStart": "2023-10-05 11:00:00",
"bookingEnd": "2023-10-05 11:30:00",
"type": "appointment",
"isRescheduled": null,
"isFull": null,
"resources": []
},
"recurring": []
}
}予約の詳細を削除します。
メソッド
このエンドポイントはDELETEリクエストを受け付けます。
パス
appointments/{{appointment_id}}
例:
curl --location --request POST 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/appointments/delete/173'
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0'{
"message": "Successfully deleted appointment",
"data": {
"appointment": {
"id": 173,
"bookings": [
{
"id": 254,
"customerId": 10,
"customer": null,
"status": "rejected",
"extras": [],
"couponId": null,
"price": 20,
"coupon": null,
"customFields": "{\"1\":{\"label\":\"text\",\"value\":\"\",\"type\":\"text\"}}",
"info": null,
"appointmentId": 173,
"persons": 1,
"token": null,
"payments": [
{
"id": 295,
"customerBookingId": 254,
"packageCustomerId": null,
"parentId": null,
"amount": 0,
"gateway": "onSite",
"gatewayTitle": "",
"dateTime": "2023-05-11 09:00:00",
"status": "pending",
"data": "",
"entity": null,
"created": null,
"actionsCompleted": null,
"wcOrderId": null,
"wcOrderUrl": null,
"wcItemCouponValue": null,
"wcItemTaxValue": null
}
],
"utcOffset": null,
"aggregatedPrice": true,
"isChangedStatus": true,
"isLastBooking": null,
"packageCustomerService": null,
"ticketsData": [],
"duration": 1800,
"created": null,
"actionsCompleted": null
}
],
"notifyParticipants": 1,
"internalNotes": "",
"status": "rejected",
"serviceId": 1,
"parentId": null,
"providerId": 1,
"locationId": 1,
"provider": null,
"service": null,
"location": null,
"googleCalendarEventId": null,
"googleMeetUrl": null,
"outlookCalendarEventId": null,
"zoomMeeting": null,
"lessonSpace": null,
"bookingStart": "2023-05-11 09:00:00",
"bookingEnd": "2023-05-11 09:30:00",
"type": "appointment",
"isRescheduled": null,
"resources": []
},
"bookingsWithChangedStatus": [
{
"id": 254,
"customerId": 10,
"customer": null,
"status": "pending",
"extras": [],
"couponId": null,
"price": 20,
"coupon": null,
"customFields": "{\"1\":{\"label\":\"text\",\"value\":\"\",\"type\":\"text\"}}",
"info": null,
"appointmentId": 173,
"persons": 1,
"token": null,
"payments": [
{
"id": 295,
"customerBookingId": 254,
"packageCustomerId": null,
"parentId": null,
"amount": 0,
"gateway": "onSite",
"gatewayTitle": "",
"dateTime": "2023-05-11 09:00:00",
"status": "pending",
"data": "",
"entity": null,
"created": null,
"actionsCompleted": null,
"wcOrderId": null,
"wcOrderUrl": null,
"wcItemCouponValue": null,
"wcItemTaxValue": null
}
],
"utcOffset": null,
"aggregatedPrice": true,
"isChangedStatus": true,
"isLastBooking": null,
"packageCustomerService": null,
"ticketsData": [],
"duration": 1800,
"created": null,
"actionsCompleted": null
}
]
}
}