MENU

料金プラン

機能一覧

デモ

ご利用の流れ

お役立ちコラム



スタッフ

操作ガイド

Amelia API – スタッフ

ここでは、スタッフに関連する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リクエストを受け付けます。

パス

/users/providers

必須プロパティ

以下のプロパティは必須です。

キータイプ説明
firstNamestringスタッフの名。
lastNamestringスタッフの姓。
emailstringスタッフメール。このフィールドは一意である必要があります。
locationIdintegerスタッフのデフォルトの場所。このフィールドは、システムに場所が設定されている場合にのみ必須です。
serviceListarrayスタッフに割り当てられたサービスの配列。このフィールドは、スタッフがフォームに表示されるために必須です。
weekDayListarrayスタッフの勤務時間を定義する配列。このフィールドは、スタッフがフォームに表示されるために必須です。

オプションのプロパティ

以下のプロパティはオプションです。

キータイプ説明
statusstringスタッフのステータス。使用可能な値:hidden(非表示)、visible(表示)。デフォルト値はvisibleです。
externalIdintegerこのAmeliaユーザーに関連付けられたWPユーザーのID。
countryPhoneIsostring電話番号に関連付けられた国別電話ISO。
phonestringスタッフの電話番号。
zoomUserIdstringZoomユーザーID。
notestringスタッフの内部メモ。
descriptionstringスタッフの説明。
pictureFullPathstringスタッフの画像のパス。
pictureThumbPathstringスタッフの画像のパス。
specialDayListarray特別な日の配列。
dayOffListarray休みの日(days off)の配列。
sendEmployeePanelAccessEmailbooleanスタッフ作成後にスタッフマイページのリンクをメールで送信するかどうか。
descriptionHtmlstringHTML形式でのスタッフの説明。
timeZonestringスタッフのタイムゾーン。デフォルトではWordPressのタイムゾーンが使用されます。

リクエスト
curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/users/providers' \
--header 'Content-Type: application/json' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0' \
--data-raw '{ "status": "visible", "firstName": "Amelia2", "lastName": "Employee2", "email": "ameliaEmployee2@test.test", "externalId": "", "locationId": 1, "phone": "", "countryPhoneIso": "rs", "googleCalendar": {}, "outlookCalendar": {}, "zoomUserId": "", "note": "", "description": "", "pictureFullPath": "", "pictureThumbPath": "", "serviceList": [ { "id": 4, "price": 45, "minCapacity": 1, "maxCapacity": 1, "customPricing": "{\"enabled\":false,\"durations\":{}}" }, { "id": 2, "price": 0, "minCapacity": 1, "maxCapacity": 1, "customPricing": "{\"enabled\":false,\"durations\":{}}" } ], "weekDayList": [ { "dayIndex": 1, "startTime": "09:00:00", "endTime": "17:00:00", "timeOutList": [], "periodList": [ { "startTime": "09:00:00", "endTime": "17:00:00", "locationId": null, "periodLocationList": [ { "id": null, "locationId": 2 } ], "periodServiceList": [] } ] }, { "dayIndex": 2, "startTime": "09:00:00", "endTime": "17:00:00", "timeOutList": [], "periodList": [ { "startTime": "09:00:00", "endTime": "17:00:00", "locationId": null, "periodLocationList": [], "periodServiceList": [] } ] }, { "dayIndex": 3, "startTime": "09:00:00", "endTime": "17:00:00", "timeOutList": [], "periodList": [ { "startTime": "09:00:00", "endTime": "17:00:00", "locationId": null, "periodLocationList": [], "periodServiceList": [] } ] }, { "dayIndex": 4, "startTime": "09:00:00", "endTime": "17:00:00", "timeOutList": [], "periodList": [ { "startTime": "09:00:00", "endTime": "17:00:00", "locationId": null, "periodLocationList": [], "periodServiceList": [] } ] }, { "dayIndex": 5, "startTime": "09:00:00", "endTime": "17:00:00", "timeOutList": [], "periodList": [ { "startTime": "09:00:00", "endTime": "17:00:00", "locationId": null, "periodLocationList": [], "periodServiceList": [] } ] } ], "specialDayList": [ { "startDate": "2023-11-15", "endDate": "2023-11-15", "periodList": [ { "startTime": "13:00:00", "endTime": "14:30:00", "periodLocationList": [ { "locationId": 2 }, { "locationId": 1 } ], "periodServiceList": [ { "serviceId": 2 } ] } ] } ], "dayOffList": [ { "name": "Day off 1", "startDate": "2023-09-17", "endDate": "2023-09-17", "repeat": 0 } ], "sendEmployeePanelAccessEmail": true, "descriptionHtml": "", "timeZone": "Europe/Belgrade" }'
レスポンス
{
"message": "Successfully added new user.",
"data": {
"user": {
"id": 88,
"firstName": "Amelia2",
"lastName": "Employee2",
"birthday": null,
"email": "ameliaEmployee2@test.test",
"phone": "",
"type": "provider",
"status": "visible",
"note": null,
"zoomUserId": null,
"countryPhoneIso": "rs",
"externalId": null,
"pictureFullPath": null,
"pictureThumbPath": null,
"translations": null,
"weekDayList": [
{
"id": 89,
"dayIndex": 1,
"startTime": "09:00:00",
"endTime": "17:00:00",
"timeOutList": [],
"periodList": [
{
"id": null,
"startTime": "09:00:00",
"endTime": "17:00:00",
"locationId": 2,
"periodServiceList": [],
"periodLocationList": []
}
]
},
...
],
"serviceList": [
{
"id": 4,
"name": null,
"description": null,
"color": null,
"price": 45,
"deposit": null,
"depositPayment": null,
"depositPerPerson": null,
"pictureFullPath": null,
"pictureThumbPath": null,
"extras": [],
"coupons": [],
"position": null,
"settings": null,
"fullPayment": null,
"minCapacity": 1,
"maxCapacity": 1,
"duration": null,
"timeBefore": null,
"timeAfter": null,
"bringingAnyone": null,
"show": null,
"aggregatedPrice": null,
"status": null,
"categoryId": null,
"category": null,
"priority": [],
"gallery": [],
"recurringCycle": null,
"recurringSub": null,
"recurringPayment": null,
"translations": null,
"minSelectedExtras": null,
"mandatoryExtra": null,
"customPricing": "{\"enabled\":false,\"durations\":{}}",
"maxExtraPeople": null,
"limitPerCustomer": null
},
...
],
"dayOffList": [
{
"id": 10,
"name": "Day off 1",
"startDate": "2023-09-17",
"endDate": "2023-09-17",
"repeat": 0
}
],
"specialDayList": [
{
"id": 7,
"startDate": "2023-11-15",
"endDate": "2023-11-15",
"periodList": [
{
"id": null,
"startTime": "13:00:00",
"endTime": "14:30:00",
"locationId": 2,
"periodServiceList": [
{
"id": null,
"serviceId": 2
}
],
"periodLocationList": [
{
"id": null,
"locationId": 2
},
{
"id": null,
"locationId": 1
}
]
}
]
}
],
"locationId": 1,
"googleCalendar": null,
"outlookCalendar": null,
"timeZone": "Europe/Belgrade",
"description": null
},
"sendEmployeePanelAccessEmail": false,
"password": null
}
}

スタッフの更新

スタッフ詳細を更新します。

メソッド

このエンドポイントはPOSTリクエストを受け付けます。

パス

/users/providers/{{provider_id}}

オプションのプロパティ

更新したいプロパティのみを送信してください。

キータイプ説明
firstNamestringスタッフの名。
lastNamestringスタッフの姓。
emailstringスタッフメール。このフィールドは一意である必要があります。
locationIdintegerスタッフのデフォルトの場所。システムに場所が設定されている場合にのみ必須です。
serviceListarrayスタッフに割り当てられたサービスの配列。スタッフがフォームに表示されるために必須です。
weekDayListarrayスタッフの勤務時間を定義する配列。スタッフがフォームに表示されるために必須です。
statusstringスタッフのステータス。使用可能な値:hidden(非表示)、visible(表示)。デフォルト値はvisibleです。
externalIdintegerこのAmeliaユーザーに関連付けられたWPユーザーのID。
countryPhoneIsostring電話番号に関連付けられた国別電話ISO。
phonestringスタッフの電話番号。
zoomUserIdstringZoomユーザーID。
notestringスタッフの内部メモ。
descriptionstringスタッフの説明。
pictureFullPathstringスタッフの画像のパス。
pictureThumbPathstringスタッフの画像のパス。
specialDayListarray特別な日の配列。
dayOffListarray休みの日(days off)の配列。
sendEmployeePanelAccessEmailbooleanスタッフ作成後にスタッフマイページのリンクをメールで送信するかどうか。
descriptionHtmlstringHTML形式でのスタッフの説明。
timeZonestringスタッフのタイムゾーン。デフォルトではWordPressのタイムゾーンが使用されます。

リクエスト
curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/users/providers/88' \
--header 'Content-Type: application/json' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0' \
--data-raw '{ "status": "visible", "firstName": "Amelia2", "lastName": "New Last Name", "email": "ameliaEmployee2@test.test", "externalId": "", "locationId": 1, "phone": "", "countryPhoneIso": "rs", "note": "", "description": "", "pictureFullPath": "", "pictureThumbPath": "", "serviceList": [ { "id": 4, "price": 45, "minCapacity": 1, "maxCapacity": 6, "customPricing": "{\"enabled\":false,\"durations\":{}}" }, { "id": 2, "price": 20, "minCapacity": 1, "maxCapacity": 1, "customPricing": "{\"enabled\":false,\"durations\":{}}" } ] }'
レスポンス
{
"message": "Successfully updated user.",
"data": {
"user": {
"id": 88,
"firstName": "Amelia2",
"lastName": "New Last Name",
"birthday": null,
"email": "ameliaEmployee2@test.test",
"phone": "",
"type": "provider",
"status": "visible",
"note": null,
"zoomUserId": null,
"countryPhoneIso": "rs",
"externalId": null,
"pictureFullPath": null,
"pictureThumbPath": null,
"translations": null,
"weekDayList": [
{
"id": 89,
"dayIndex": 1,
"startTime": "09:00:00",
...
}
],
"serviceList": [
{
"id": 4,
"name": null,
"description": null,
"color": null,
"price": 45,
...
}
],
...
"locationId": 1,
"googleCalendar": null,
"outlookCalendar": null,
"timeZone": "Europe/Belgrade",
"description": null
},
"sendEmployeePanelAccessEmail": false
}
}

スタッフの取得

スタッフ詳細を取得します。

メソッド

このエンドポイントはGETリクエストを受け付けます。

パス

/users/providers/{{provider_id}}

リクエスト
curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/users/providers/88' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0'
レスポンス
{
    "message": "ユーザーを正常に取得しました。",
    "data": {
        "user": {
            "id": 88,
            "firstName": "Amelia2",
            "lastName": "新しい姓",
            "birthday": null,
            "email": " ameliaEmployee2@test.test ",
            "phone": "",
            "type": "provider",
            "status": "visible",
            "note": null,
            "zoomUserId": null,
            "countryPhoneIso": "rs",
            "externalId": null,
            "pictureFullPath": null,
            "pictureThumbPath": null,
            "translations": null,
            "weekDayList": [
                {
                    "id": 89,
                    "dayIndex": 1,
                    "startTime": "09:00:00",
                    "endTime": "17:00:00",
                    "timeOutList": [],
                    "periodList": [
                        {
                            "id": 82,
                            "startTime": "09:00:00",
                            "endTime": "17:00:00",
                            "locationId": null,
                            "periodServiceList": [],
                            "periodLocationList": []
                        }
                    ]
                },
                {
                    "id": 90,
                    "dayIndex": 2,
                    "startTime": "09:00:00",
                    "endTime": "17:00:00",
                    "timeOutList": [],
                    "periodList": [
                        {
                            "id": 83,
                            "startTime": "09:00:00",
                            "endTime": "17:00:00",
                            "locationId": null,
                            "periodServiceList": [],
                            "periodLocationList": []
                        }
                    ]
                },
                {
                    "id": 91,
                    "dayIndex": 3,
                    "startTime": "09:00:00",
                    "endTime": "17:00:00",
                    "timeOutList": [],
                    "periodList": [
                        {
                            "id": 84,
                            "startTime": "09:00:00",
                            "endTime": "17:00:00",
                            "locationId": null,
                            "periodServiceList": [],
                            "periodLocationList": []
                        }
                    ]
                },
                {
                    "id": 92,
                    "dayIndex": 4,
                    "startTime": "09:00:00",
                    "endTime": "17:00:00",
                    "timeOutList": [],
                    "periodList": [
                        {
                            "id": 85,
                            "startTime": "09:00:00",
                            "endTime": "17:00:00",
                            "locationId": null,
                            "periodServiceList": [],
                            "periodLocationList": []
                        }
                    ]
                },
                {
                    "id": 93,
                    "dayIndex": 5,
                    "startTime": "09:00:00",
                    "endTime": "17:00:00",
                    "timeOutList": [],
                    "periodList": [
                        {
                            "id": 86,
                            "startTime": "09:00:00",
                            "endTime": "17:00:00",
                            "locationId": null,
                            "periodServiceList": [],
                            "periodLocationList": []
                        }
                    ]
                }
            ],
            "serviceList": [
                {
                    "id": 4,
                    "name": "サービス2",
                    "description": "",
                    "color": "#1788FB",
                    "price": 45,
                    "deposit": 20,
                    "depositPayment": "fixed",
                    "depositPerPerson": true,
                    "pictureFullPath": null,
                    "pictureThumbPath": null,
                    "extras": [],
                    "coupons": [],
                    "position": 16,
                    "settings": "{\"payments\":{\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"onSite\":true,\"payPal\":{\"enabled\":true},\"stripe\":{\"enabled\":true},\"mollie\":{\"enabled\":false},\"razorpay\":{\"enabled\":false},\"square\":{\"enabled\":true}},\"zoom\":{\"enabled\":true},\"lessonSpace\":{\"enabled\":true},\"activation\":{\"version\":\"6.2.3\"}}",
                    "fullPayment": false,
                    "minCapacity": 1,
                    "maxCapacity": 6,
                    "duration": 3600,
                    "timeBefore": null,
                    "timeAfter": null,
                    "bringingAnyone": true,
                    "show": true,
                    "aggregatedPrice": true,
                    "status": "visible",
                    "categoryId": 2,
                    "category": null,
                    "priority": [],
                    "gallery": [],
                    "recurringCycle": "disabled",
                    "recurringSub": "future",
                    "recurringPayment": 0,
                    "translations": null,
                    "minSelectedExtras": null,
                    "mandatoryExtra": false,
                    "customPricing": "{\"enabled\":false,\"durations\":{}}",
                    "maxExtraPeople": null,
                    "limitPerCustomer": "{\"enabled\":false,\"numberOfApp\":1,\"timeFrame\":\"day\",\"period\":1,\"from\":\"bookingDate\"}"
                },
                {
                    "id": 2,
                    "name": "milica service",
                    "description": "",
                    "color": "#1788FB",
                    "price": 20,
                    "deposit": 20,
                    "depositPayment": "fixed",
                    "depositPerPerson": false,
                    "pictureFullPath": null,
                    "pictureThumbPath": null,
                    "extras": [],
                    "coupons": [],
                    "position": 5,
                    "settings": "{\"payments\":{\"onSite\":true,\"stripe\":{\"enabled\":true},\"razorpay\":{\"enabled\":false},\"paymentLinks\":{\"enabled\":true,\"changeBookingStatus\":false,\"redirectUrl\":null},\"payPal\":{\"enabled\":false},\"mollie\":{\"enabled\":false}},\"zoom\":{\"enabled\":true},\"lessonSpace\":{\"enabled\":false},\"activation\":{\"version\":\"6.6\"}}",
                    "fullPayment": false,
                    "minCapacity": 1,
                    "maxCapacity": 1,
                    "duration": 1800,
                    "timeBefore": null,
                    "timeAfter": null,
                    "bringingAnyone": true,
                    "show": true,
                    "aggregatedPrice": true,
                    "status": "visible",
                    "categoryId": 1,
                    "category": null,
                    "priority": [],
                    "gallery": [],
                    "recurringCycle": "all",
                    "recurringSub": "future",
                    "recurringPayment": 999,
                    "translations": null,
                    "minSelectedExtras": null,
                    "mandatoryExtra": false,
                    "customPricing": "{\"enabled\":false,\"durations\":{}}",
                    "maxExtraPeople": null,
                    "limitPerCustomer": "{\"enabled\":false,\"numberOfApp\":null,\"period\":null,\"timeFrame\":null,\"from\":null}"
                }
            ],
            "dayOffList": [
                {
                    "id": 10,
                    "name": "休日 1",
                    "startDate": "2023-09-17",
                    "endDate": "2023-09-17",
                    "repeat": 0
                }
            ],
            "specialDayList": [
                {
                    "id": 7,
                    "startDate": "2023-11-15",
                    "endDate": "2023-11-15",
                    "periodList": [
                        {
                            "id": 7,
                            "startTime": "13:00:00",
                            "endTime": "14:30:00",
                            "locationId": 1,
                            "periodServiceList": [
                                {
                                    "id": 4,
                                    "serviceId": 2
                                }
                            ],
                            "periodLocationList": [
                                {
                                    "id": 6,
                                    "locationId": 1
                                },
                                {
                                    "id": 5,
                                    "locationId": 2
                                }
                            ]
                        }
                    ]
                }
            ],
            "locationId": 1,
            "googleCalendar": {
                "calendarList": [],
                "calendarId": null
            },
            "outlookCalendar": {
                "calendarList": [],
                "calendarId": null
            },
            "timeZone": "Europe/Belgrade",
            "description": null,
            "activity": "available"
        },
        "successfulGoogleConnection": true,
        "successfulOutlookConnection": true,
        "futureAppointmentsServicesIds": []
    }
}

スタッフ削除の影響の取得

スタッフを安全に削除できるかどうか、将来の予約に基づいて確認します。

メソッド

このエンドポイントはGETリクエストを受け付けます。

パス

/users/providers/effect/{{provider_id}}

リクエスト
curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/users/providers/effect/88' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0'
レスポンス
{
"message": "Successfully retrieved message.",
"data": {
"valid": true,
"message": ""
}
}

複数のスタッフの取得

スタッフ詳細を取得します。

メソッド

このエンドポイントはGETリクエストを受け付けます。

パス

/users/providers

オプションのプロパティ

スタッフのページング/並べ替えのために、以下のクエリパラメータを使用できます。

キータイプ説明
pageinteger返されるスタッフのページ。
sortstring並べ替え順序。使用可能な値:firstName-firstNamelastName-lastNameemail-email。マイナス記号は降順を示します。

リクエスト
curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/users/providers&page=1&sort=lastName' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0'
レスポンス
{
"message": "Successfully retrieved users.",
"data": {
"users": [
{
"id": 1,
"firstName": "Milica",
"lastName": "Employee",
"birthday": null,
"email": "kpop.lover.10000@gmail.com",
"phone": "+381631652656",
"type": "provider",
"status": "visible",
"note": "note 123345678900",
"zoomUserId": "PMQUWvVWVBK1XzqmuaS6-A",
"countryPhoneIso": "rs",
"externalId": 6,
"pictureFullPath": null,
"pictureThumbPath": null,
"translations": null,
"weekDayList": [],
"serviceList": [],
"dayOffList": [],
"specialDayList": [],
"locationId": null,
"googleCalendar": null,
"outlookCalendar": null,
"timeZone": null,
"description": "",
"activity": "available"
},
{
"id": 88,
"firstName": "Amelia2",
"lastName": "New Last Name",
"birthday": null,
"email": "ameliaEmployee2@test.test",
"phone": "",
"type": "provider",
"status": "visible",
"note": null,
"zoomUserId": null,
"countryPhoneIso": "rs",
"externalId": null,
"pictureFullPath": null,
"pictureThumbPath": null,
"translations": null,
"weekDayList": [],
"serviceList": [],
"dayOffList": [],
"specialDayList": [],
"locationId": null,
"googleCalendar": null,
"outlookCalendar": null,
"timeZone": "Europe/Belgrade",
"description": null,
"activity": "available"
}
],
"countFiltered": 2,
"countTotal": 6
}
}

スタッフの削除

スタッフを削除します。

メソッド

このエンドポイントはPOSTリクエストを受け付けます。

パス

/users/providers/delete/{{provider_id}}

リクエスト
curl --location --request POST 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/users/providers/delete/88' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0'
レスポンス
{
"message": "Successfully deleted user.",
"data": []
}
}