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リクエストを受け付けます。

パス

/resources

必須プロパティ

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

キータイプ説明
namestring内部使用のための備品・設備の名前。
quantityinteger備品・設備の数量。

オプションのプロパティ

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

キータイプ説明
sharedstring備品・設備の共有タイプ。使用可能な値:service(サービス)、location場所)、NULL
statusstring備品・設備のステータス。使用可能な値:hidden(非表示)、visible(表示)。デフォルトはvisibleです。
entitiesarray備品・設備に関連付けられたエンティティの配列。デフォルトはすべてのエンティティです。
countAdditionalPeopleboolean備品・設備が予約の人数ごとにカウントされるか、予約ごと(1回)にカウントされるか。

リクエスト
curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/resources' \
--header 'Content-Type: application/json' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0' \
--data '{ "name": "Resource1", "quantity": 8, "shared": null, "status": "visible", "entities": [ { "entityId": 1, "entityType": "service" } ] }'
レスポンス
{
"message": "Successfully added new resource.",
"data": {
"resource": {
"id": 7,
"name": "Resource1",
"quantity": 8,
"shared": false,
"status": "visible",
"entities": [
{
"entityId": 1,
"entityType": "service"
}
],
"countAdditionalPeople": null
}
}
}

備品・設備の更新

備品・設備詳細を更新します。

メソッド

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

パス

/resources/{{resource_id}}

オプションのプロパティ

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

キータイプ説明
namestring内部使用のための備品・設備の名前。
quantityinteger備品・設備の数量。
sharedstring備品・設備の共有タイプ。使用可能な値:service(サービス)、location場所)、NULL
statusstring備品・設備のステータス。使用可能な値:hidden(非表示)、visible(表示)。デフォルトはvisibleです。
entitiesarray備品・設備に関連付けられたエンティティの配列。デフォルトはすべてのエンティティです。
countAdditionalPeopleboolean備品・設備が予約の人数ごとにカウントされるか、予約ごと(1回)にカウントされるか。

リクエスト
curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/resources/6' \
--header 'Content-Type: application/json' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0' \
--data '{ "name": "Resource new name", "quantity": 10, "shared": null, "status": "visible", "entities": [ { "entityId": 2, "entityType": "service" } ] }'
レスポンス
{
"message": "Successfully updated resource.",
"data": {
"resource": {
"id": 6,
"name": "Resource new name",
"quantity": 10,
"shared": false,
"status": "visible",
"entities": [
{
"entityId": 2,
"entityType": "service"
}
],
"countAdditionalPeople": null
}
}
}

複数の備品・設備の取得

備品・設備を取得します。

メソッド

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

パス

/resources

リクエスト
curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=?api/v1/resources' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0'
レスポンス
{
"message": "Successfully retrieved resources.",
"data": {
"resources": [
{
"id": 4,
"name": "res3",
"quantity": 1,
"shared": "location",
"status": "hidden",
"entities": {
"20": {
"id": 20,
"resourceId": 4,
"entityId": 13,
"entityType": "service"
},
...
},
"countAdditionalPeople": null
},
{
"id": 6,
"name": "Resource new name",
"quantity": 10,
"shared": false,
"status": "visible",
"entities": {
"25": {
"id": 25,
"resourceId": 6,
"entityId": 2,
"entityType": "service"
}
},
"countAdditionalPeople": null
},
{
"id": 7,
"name": "Resource1",
"quantity": 8,
"shared": false,
"status": "visible",
"entities": {
"24": {
"id": 24,
"resourceId": 7,
"entityId": 1,
"entityType": "service"
}
},
"countAdditionalPeople": null
}
]
}
}

備品・設備の削除

備品・設備を削除します。

メソッド

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

パス

/resources/delete/{{resource_id}}

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