アラート購読エンドポイント
Adobe Experience Platform クエリサービスを使用すると、アドホッククエリとスケジュールされたクエリの両方でアラートを受け取ることができます。 アラートは、電子メール、Experience Platform UI、またはその両方で受信できます。 Experience Platform内アラートとメールアラートの通知コンテンツは同じです。
基本を学ぶ
このガイドで使用されているエンドポイントは、Adobe Experience Platform Query Service APIの一部です。 続行する前に、必須ヘッダーやサンプル API呼び出しの読み取り方法など、APIへの呼び出しを正常に行うために知っておく必要がある重要な情報については、入門ガイド を確認してください。
アラートタイプ alert-types
次の表に、サポートされるクエリアラートタイプを示します。
delayまたは クエリ実行遅延 アラートタイプは、現在、Query Service APIでサポートされていません。 このアラートは、スケジュールされたクエリ実行の結果が、指定されたしきい値を超えて遅延した場合に通知します。 このアラートを使用するには、クエリがその期間に実行されるときに、完了または失敗せずにアラートをトリガーするカスタム時間を設定する必要があります。 UIでこのアラートを設定する方法については、 クエリスケジュール のドキュメントまたは インラインクエリアクションのガイド を参照してください。startsuccessfailedquarantine次のアラートは、アラート購読なしで適用されます。
- バッチクエリジョブが終了すると、ユーザーは通知を受け取ります。
- バッチクエリジョブの期間がしきい値を超えると、クエリをスケジュールしたユーザーに対してアラートがトリガーされます。
サンプル API 呼び出し
以下の節では、クエリサービス API を使用しておこなえる様々な API 呼び出しについて説明します。 各呼び出しでは一般的な API 形式、必須ヘッダーを示すリクエスト例および応答例が示されています。
組織およびサンドボックスのすべてのアラートのリストの取得 get-list-of-org-alert-subs
/alert-subscriptions エンドポイントに対して GET リクエストを実行して、組織のサンドボックスのすべてのアラートのリストを取得します。
API 形式
GET /alert-subscriptions
GET /alert-subscriptions?{QUERY_PARAMETERS}
{QUERY_PARAMETERS}クエリパラメータ
次に、クエリの一覧表示に使用可能なクエリパラメーターのリストを示します。 これらのパラメーターはすべてオプションです。 パラメーターを指定せずにこのエンドポイントを呼び出すと、組織で使用可能なすべてのクエリが取得されます。
orderbycreated と updated です。 プロパティ名の前に、昇順に+、降順に-を付けます。 デフォルトは -created です。 プラス記号(+)は%2Bでエスケープする必要があることに注意してください。 例えば、%2Bcreatedは昇順の作成済み注文の値です。pagesizepageproperty選択したフィールドに基づいて結果をフィルタリングします。 フィルターは HTML エスケープする必要があります。 複数のフィルターのセットを組み合わせるには、コンマを使用します。 次のプロパティを使用すると、フィルタリングが可能になります。
- ID
- assetId
- status
- alertType
サポートされている演算子は== (等しい)です。 例えば、id==6ebd9c2d-494d-425a-aa91-24033f3abeecは、一致するIDを持つアラートを返します。
リクエスト
curl -X GET 'https://platform.adobe.io/data/foundation/query/alert-subscriptions' \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-sandbox-name: {SANDBOX_NAME}' \
-H 'Content-Type: application/json' \
-H 'x-sandbox-id: {SANDBOX_ID}'
応答
応答が成功すると、HTTP 200 ステータスと、ページネーションおよびバージョン情報を含む alerts 配列が返されます。 この alerts 配列には、組織と特定のサンドボックスに関するすべてのアラートの詳細が含まれます。 1 回の応答で最大 3 つのアラートを使用できます。応答本文には、各アラートタイプごとに 1 つのアラートが含まれます。
alerts 配列の alerts._links オブジェクトは、簡潔にするために切り捨てられました。 alerts._links オブジェクトの完全な例は、POST リクエストの応答で見ることができます。{
"alerts": [
{
"assetId": "0ca168f4-e46b-4f7f-be6a-bdc386271b4a",
"id": "query_service_flow_run_start-dcf7b4be-ccd7-4c73-ae0c-a4bb34a40adada84",
"status": "enabled",
"alertType": "start",
"_links":{
"self": {…},
"subscribe": {…},
"patch_status": {…},
"get_list_of_subscribers_by_alert_type": {…},
"delete": {…}
}
},
{
"assetId": "0ca168f4-e46b-4f7f-be6a-bdc386271b4a",
"id": "query_service_flow_run_success-dcf7b4be-ccd7-4c73-ae0c-a4bb34a40adada84",
"status": "enabled",
"alertType": "success",
"_links":{
"self": {…},
"subscribe": {…},
"patch_status": {…},
"get_list_of_subscribers_by_alert_type": {…},
"delete": {…}
}
},
{
"assetId": "700d43d9-3b99-4d4c-8dbb-29c911c0e0df",
"id": "query_service_flow_run_start-75da972a-e859-47a5-934c-629904daa1ef",
"status": "enabled",
"alertType": "start",
"_links":{
"self": {…},
"subscribe": {…},
"patch_status": {…},
"get_list_of_subscribers_by_alert_type": {…},
"delete": {…}
}
}
],
"_page": {
"orderby": "-created",
"page": 1,
"count": 26,
"pageSize": 50
},
"_links": {
"next": {
"href": "https://platform.adobe.io/data/foundation/query/queries/alert-subscriptions?orderby=-created&page=2"
},
"prev": {
"href": "https://platform.adobe.io/data/foundation/query/queries/alert-subscriptions?orderby=-created&page=0"
}
},
"version": 1
}
alerts.assetIdalerts.idalertType、フロー ID で構成されます。 使用可能なアラートに関する情報は、Experience Platform アラートダッシュボードのドキュメント を参照してください。alerts.statusenabled、enabling、disabled、disabling の 4 つです。 アラートは、イベントをアクティブにリッスンしているか、関連するすべての購読者と設定を保持したまま将来利用するために一時停止されているか、または、これらのステート間を移行中です。alerts.alertTypeアラートのタイプ。 スケジュールされたクエリで使用できるアラート状態は5つありますが、アドホッククエリで使用できるアラート状態は4つだけです。 quarantine アラートは、スケジュールされたクエリでのみ使用できます。 また、delay アラートはExperience Platform UIからのみ設定できます。 そのため、delayについては、ここでは説明しません。 利用可能なアラートは次のとおりです。
start:クエリの実行が開始されると、ユーザーに通知します。success:クエリが完了すると、ユーザーに通知します。failure:クエリが失敗した場合にユーザーに通知します。quarantine:スケジュールされたクエリ実行が強制隔離された状態になったときにアクティブになります。
alerts._links_page_links特定のクエリまたはスケジュール ID のアラート購読情報を取得 retrieve-all-alert-subscriptions-by-id
/alert-subscriptions/{QUERY_ID} または /alert-subscriptions/{SCHEDULE_ID} エンドポイントに対して GET リクエストを実行して、特定のクエリ ID またはスケジュール ID のアラート購読情報を取得します。
API 形式
GET /alert-subscriptions/{QUERY_ID}
GET /alert-subscriptions/{SCHEDULE_ID}
{QUERY_ID}{SCHEDULE_ID}リクエスト
curl -X GET 'https://platform.adobe.io/data/foundation/query/alert-subscriptions/4422fc69-eaa7-464e-945b-63cfd435d3d1' \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-sandbox-name: {SANDBOX_NAME}' \
-H 'Content-Type: application/json' \
-H 'x-sandbox-id: {SANDBOX_ID}'
応答
正常な応答は、HTTP ステータス 200 と、指定されたクエリ ID またはスケジュール ID の購読情報を含む alerts 配列を返します。
{
"alerts": [
{
"assetId": "6df22232-f427-4250-a4e1-43cd30990641",
"id": "query_service_flow_run_failure-5cdc3bbe-750a-4d80-9c43-96e5e09f1a96",
"status": "enabled",
"alertType": "failure",
"subscriptions": {
"emailNotifications": [
"rrunner@adobe.com",
"jsnow@adobe.com",
"keverdeen@adobe.com"
],
"inContextNotifications": [
"rrunner@adobe.com",
"jsnow@adobe.com",
"keverdeen@adobe.com"
]
},
"_links": {
"self": {
"href": "https://platform.adobe.io/data/foundation/query/alert-subscriptions/c4f67291-1161-4943-bc29-8736469bb928",
"method": "GET"
},
"subscribe": {
"href": "https://platform.adobe.io/data/foundation/query/alert-subscriptions",
"method": "POST",
"body": "{\"assetId\": \"queryId/scheduleId\", \"alertType\": \"start/success/failure\", \"subscriptions\": {\n\"emailIds\": [\"xyz@example.com\", \"abc@example.com\"], \"email\": true, \"inContext\": false}}"
},
"patch_status": {
"href": "https://platform.adobe.io/data/foundation/query/alert-subscriptions/c4f67291-1161-4943-bc29-8736469bb928/failure",
"method": "PATCH",
"body": "{ \"op\": \"replace\", \"path\": \"/status\", \"value\": \"enable/disable\" }"
},
"get_list_of_subscribers_by_alert_type": {
"href": "https://platform.adobe.io/data/foundation/query/alert-subscriptions/c4f67291-1161-4943-bc29-8736469bb928/failure",
"method": "GET"
},
"delete": {
"href": "https://platform.adobe.io/data/foundation/query/alert-subscriptions/c4f67291-1161-4943-bc29-8736469bb928/failure",
"method": "DELETE"
}
}
},
{
"assetId": "6df22232-f427-4250-a4e1-43cd30990641",
"id": "query_service_flow_run_start-5cdc3bbe-750a-4d80-9c43-96e5e09f1a96",
"status": "enabled",
"alertType": "start",
"subscriptions": {
"emailNotifications": [
"rrunner@adobe.com"
],
"inContextNotifications": [
"rrunner@adobe.com"
]
},
"_links": {
"self": {
"href": "https://platform.adobe.io/data/foundation/query/alert-subscriptions/c4f67291-1161-4943-bc29-8736469bb928",
"method": "GET"
},
"subscribe": {
"href": "https://platform.adobe.io/data/foundation/query/alert-subscriptions",
"method": "POST",
"body": "{\"assetId\": \"queryId/scheduleId\", \"alertType\": \"start/success/failure\", \"subscriptions\": {\n\"emailIds\": [\"xyz@example.com\", \"abc@example.com\"], \"email\": true, \"inContext\": false}}"
},
"patch_status": {
"href": "https://platform.adobe.io/data/foundation/query/alert-subscriptions/c4f67291-1161-4943-bc29-8736469bb928/failure",
"method": "PATCH",
"body": "{ \"op\": \"replace\", \"path\": \"/status\", \"value\": \"enable/disable\" }"
},
"get_list_of_subscribers_by_alert_type": {
"href": "https://platform.adobe.io/data/foundation/query/alert-subscriptions/c4f67291-1161-4943-bc29-8736469bb928/failure",
"method": "GET"
},
"delete": {
"href": "https://platform.adobe.io/data/foundation/query/alert-subscriptions/c4f67291-1161-4943-bc29-8736469bb928/failure",
"method": "DELETE"
}
}
}
]
}
assetIdidalertType、フロー ID で構成されます。 使用可能なアラートに関する情報は、Experience Platform アラートダッシュボードのドキュメント を参照してください。statusenabled、enabling、disabled、disabling の 4 つです。 アラートは、イベントをアクティブにリッスンしているか、関連するすべての購読者と設定を保持したまま将来利用するために一時停止されているか、または、これらのステート間を移行中です。alertType各アラートは、3 つの異なるアラートタイプを持つことができます。 次のとおりです。
start:クエリの実行が開始されると、ユーザーに通知します。success:クエリが完了すると、ユーザーに通知します。failure:クエリが失敗した場合、ユーザーに通知します。
subscriptions.emailNotificationssubscriptions.inContextNotifications特定のクエリ、スケジュール ID とアラートタイプのアラート購読情報を取得する get-alert-info-by-id-and-alert-type
/alert-subscriptions/{QUERY_ID}/{ALERT_TYPE} エンドポイントに対して GET リクエストを実行して、特定の ID およびアラートタイプのアラート購読情報を取得します。 これは、クエリ ID とスケジュール済みクエリ ID の両方に適用できます。
API 形式
GET /alert-subscriptions/{QUERY_ID}/{ALERT_TYPE}
GET /alert-subscriptions/{SCHEDULE_ID}/{ALERT_TYPE}
ALERT_TYPEこのプロパティは、アラートをトリガーするクエリの実行状態を示します。 応答には、このタイプのアラートのアラート購読情報のみが含まれます。 各アラートは、3 つの異なるアラートタイプを持つことができます。 次のとおりです。
start:クエリの実行が開始されると、ユーザーに通知します。success:クエリが完了すると、ユーザーに通知します。failure:クエリが失敗した場合、ユーザーに通知します。
QUERY_IDSCHEDULE_IDリクエスト
curl -X GET 'https://platform.adobe.io/data/foundation/query/alert-subscriptions/4422fc69-eaa7-464e-945b-63cfd435d3d1/start'' \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-sandbox-name: {SANDBOX_NAME}' \
-H 'Content-Type: application/json' \
-H 'x-sandbox-id: {SANDBOX_ID}'
応答
応答が成功すると、HTTP ステータス 200 と、購読しているすべてのアラートが返されます。 これには、アラート ID、アラートのタイプ、購読者のアドビ登録メール ID、優先通知チャネルが含まれます。
{
"alerts": [
{
"assetId": "6df22232-f427-4250-a4e1-43cd30990641",
"id": "query_service_flow_run_success-5cdc3bbe-750a-4d80-9c43-96e5e09f1a96",
"status": "enabled",
"alertType": "success",
"subscriptions": {
"emailNotifications": [
"rrunner@adobe.com",
"jsnow@adobe.com"
],
"inContextNotifications": [
"jsnow@adobe.com"
]
},
"_links": {
"self": {
"href": "https://platform.adobe.io/data/foundation/query/alert-subscriptions/c4f67291-1161-4943-bc29-8736469bb928",
"method": "GET"
},
"subscribe": {
"href": "https://platform.adobe.io/data/foundation/query/alert-subscriptions",
"method": "POST",
"body": "{\"assetId\": \"queryId/scheduleId\", \"alertType\": \"start/success/failure\", \"subscriptions\": {\n\"emailIds\": [\"xyz@example.com\", \"abc@example.com\"], \"email\": true, \"inContext\": false}}"
},
"patch_status": {
"href": "https://platform.adobe.io/data/foundation/query/alert-subscriptions/c4f67291-1161-4943-bc29-8736469bb928/failure",
"method": "PATCH",
"body": "{ \"op\": \"replace\", \"path\": \"/status\", \"value\": \"enable/disable\" }"
},
"get_list_of_subscribers_by_alert_type": {
"href": "https://platform.adobe.io/data/foundation/query/alert-subscriptions/c4f67291-1161-4943-bc29-8736469bb928/failure",
"method": "GET"
},
"delete": {
"href": "https://platform.adobe.io/data/foundation/query/alert-subscriptions/c4f67291-1161-4943-bc29-8736469bb928/failure",
"method": "DELETE"
}
}
}
]
}
assetIdalertTypeアラートのタイプ。 スケジュールされたクエリで使用できるアラート状態は5つありますが、アドホッククエリで使用できるアラート状態は4つだけです。 quarantine アラートは、スケジュールされたクエリでのみ使用できます。 また、delay アラートはExperience Platform UIからのみ設定できます。 そのため、delayについては、ここでは説明しません。 利用可能なアラートは次のとおりです。
start:クエリの実行が開始されると、ユーザーに通知します。success:クエリが完了すると、ユーザーに通知します。failure:クエリが失敗した場合にユーザーに通知します。quarantine:スケジュールされたクエリ実行が強制隔離された状態になったときにアクティブになります。
subscriptionssubscriptions.inContextNotificationssubscriptions.emailNotificationsユーザーが購読しているすべてのアラートのリストを取得 get-alert-subscription-list
/alert-subscriptions/user-subscriptions/{EMAIL_ID} エンドポイントに対して GET リクエストを行って、ユーザーが購読しているすべてのアラートのリストを取得します。 応答には、アラート名、ID、ステータス、アラートタイプ、通知チャネルが含まれます。
API 形式
GET /alert-subscriptions/user-subscriptions/{EMAIL_ID}
{EMAIL_ID}orderbycreated と updated です。 プロパティ名の前に、昇順に+、降順に-を付けます。 デフォルトは -created です。 プラス記号(+)は%2Bでエスケープする必要があることに注意してください。 例えば、%2Bcreatedは昇順の作成済み注文の値です。pagesizepageproperty選択したフィールドに基づいて結果をフィルタリングします。 フィルターは HTML エスケープする必要があります。 複数のフィルターのセットを組み合わせるには、コンマを使用します。 次のプロパティを使用すると、フィルタリングが可能になります。
- ID
- assetId
- status
- alertType
サポートされている演算子は== (等しい)です。 例えば、id==6ebd9c2d-494d-425a-aa91-24033f3abeecは、一致するIDを持つアラートを返します。
リクエスト
curl -X GET 'https://platform.adobe.io/data/foundation/query/alert-subscriptions/user-subscriptions/rrunner@adobe.com' \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-sandbox-name: {SANDBOX_NAME}' \
-H 'Content-Type: application/json' \
-H 'x-sandbox-id: {SANDBOX_ID}'
応答
正常な応答は、HTTP ステータス 200 と、指定した emailId が購読しているアラートの詳細を含む items 配列が返されます。
{
"items": [
{
"name": "query_service_flow_run_success-8f057161-b312-4274-b629-f346c7d15c1f",
"assetId": "39e65373-e47a-4feb-9e5a-dffa2f677bca",
"status": "enabled",
"alertType": "success",
"subscriptions": {
"inContextNotification": true,
"emailNotifications": true
},
"_links": {
"self": {
"href": "https://platform.adobe.io/data/foundation/query/alert-subscriptions/c4f67291-1161-4943-bc29-8736469bb928",
"method": "GET"
},
"subscribe": {
"href": "https://platform.adobe.io/data/foundation/query/alert-subscriptions",
"method": "POST",
"body": "{\"assetId\": \"queryId/scheduleId\", \"alertType\": \"start/success/failure\", \"subscriptions\": {\n\"emailIds\": [\"xyz@example.com\", \"abc@example.com\"], \"email\": true, \"inContext\": false}}"
},
"patch_status": {
"href": "https://platform.adobe.io/data/foundation/query/alert-subscriptions/c4f67291-1161-4943-bc29-8736469bb928/failure",
"method": "PATCH",
"body": "{ \"op\": \"replace\", \"path\": \"/status\", \"value\": \"enable/disable\" }"
},
"get_list_of_subscribers_by_alert_type": {
"href": "https://platform.adobe.io/data/foundation/query/alert-subscriptions/c4f67291-1161-4943-bc29-8736469bb928/failure",
"method": "GET"
},
"delete": {
"href": "https://platform.adobe.io/data/foundation/query/alert-subscriptions/c4f67291-1161-4943-bc29-8736469bb928/failure",
"method": "DELETE"
}
}
},
{
"name": "query_service_flow_run_start-8f057161-b312-4274-b629-f346c7d15c1f",
"assetId": "39e65373-e47a-4feb-9e5a-dffa2f677bca",
"status": "enabled",
"alertType": "start",
"subscriptions": {
"inContextNotification": true,
"emailNotifications": true
},
"_links": {
"self": {
"href": "https://platform.adobe.io/data/foundation/query/alert-subscriptions/c4f67291-1161-4943-bc29-8736469bb928",
"method": "GET"
},
"subscribe": {
"href": "https://platform.adobe.io/data/foundation/query/alert-subscriptions",
"method": "POST",
"body": "{\"assetId\": \"queryId/scheduleId\", \"alertType\": \"start/success/failure\", \"subscriptions\": {\n\"emailIds\": [\"xyz@example.com\", \"abc@example.com\"], \"email\": true, \"inContext\": false}}"
},
"patch_status": {
"href": "https://platform.adobe.io/data/foundation/query/alert-subscriptions/c4f67291-1161-4943-bc29-8736469bb928/failure",
"method": "PATCH",
"body": "{ \"op\": \"replace\", \"path\": \"/status\", \"value\": \"enable/disable\" }"
},
"get_list_of_subscribers_by_alert_type": {
"href": "https://platform.adobe.io/data/foundation/query/alert-subscriptions/c4f67291-1161-4943-bc29-8736469bb928/failure",
"method": "GET"
},
"delete": {
"href": "https://platform.adobe.io/data/foundation/query/alert-subscriptions/c4f67291-1161-4943-bc29-8736469bb928/failure",
"method": "DELETE"
}
}
}
], "_page": {
"orderby": "-created",
"page": 1,
"count": 26,
"pageSize": 50
},
"_links": {
"next": {
"href": "https://platform-int.adobe.io/data/foundation/query/queries/alert-subscriptions?orderby=-created&page=2"
},
"prev": {
"href": "https://platform-int.adobe.io/data/foundation/query/queries/alert-subscriptions?orderby=-created&page=0"
}
},
"version": 1
}
namealertType、フロー ID で構成されます。 使用可能なアラートに関する情報は、Experience Platform アラートダッシュボードのドキュメント を参照してください。assetIdstatusenabled、enabling、disabled、disabling の 4 つです。 アラートは、イベントをアクティブにリッスンしているか、関連するすべての購読者と設定を保持したまま将来利用するために一時停止されているか、または、これらのステート間を移行中です。alertTypeアラートのタイプ。 スケジュールされたクエリで使用できるアラート状態は5つありますが、アドホッククエリで使用できるアラート状態は4つだけです。 quarantine アラートは、スケジュールされたクエリでのみ使用できます。 また、delay アラートはExperience Platform UIからのみ設定できます。 そのため、delayについては、ここでは説明しません。 利用可能なアラートは次のとおりです。
start:クエリの実行が開始されると、ユーザーに通知します。success:クエリが完了すると、ユーザーに通知します。failure:クエリが失敗した場合にユーザーに通知します。quarantine:スケジュールされたクエリ実行が強制隔離された状態になったときにアクティブになります。
subscriptionssubscriptions.inContextNotificationstrue 値は、UI を通じてアラートを提供する必要があることを確認します。 false 値は、そのチャネルを通じてユーザーに通知されないことを確認します。subscriptions.emailNotificationstrue 値は、アラートをメールで提供する必要があることを確認します。 false 値は、そのチャネルを通じてユーザーに通知されないことを確認します。アラートの作成とユーザーの購読 subscribe-users
アラートを作成し、ユーザーが購読して受信するには、/alert-subscriptions エンドポイントに対して POST リクエストを行います。 このリクエストは、assetId プロパティを使用して新しく作成されたアラートにクエリを関連付け、emailIds を使用してそのクエリのアラートをユーザーが購読できるようにします。
API 形式
POST /alert-subscriptions
リクエスト
curl -X POST https://platform.adobe.io/data/foundation/query/alert-subscriptions
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-sandbox-name: {SANDBOX_NAME}'
-d '
{
"assetId": "a679dd0e-bcb2-4e69-a610-22d17ba98cac",
"alertType": "failure",
"subscriptions": {
"emailIds": [
"rrunner@adobe.com",
"jsnow@adobe.com"
],
"inContextNotifications": true,
"emailNotifications": true
}
}'
assetIdalertTypeアラートのタイプ。 スケジュールされたクエリで使用できるアラート状態は5つありますが、アドホッククエリで使用できるアラート状態は4つだけです。 quarantine アラートは、スケジュールされたクエリでのみ使用できます。 また、delay アラートはExperience Platform UIからのみ設定できます。 そのため、delayについては、ここでは説明しません。 利用可能なアラートは次のとおりです。
start:クエリの実行が開始されると、ユーザーに通知します。success:クエリが完了すると、ユーザーに通知します。failure:クエリが失敗した場合にユーザーに通知します。quarantine:スケジュールされたクエリ実行が強制隔離された状態になったときにアクティブになります。
subscriptionssubscriptions.emailIdssubscriptions.inContextNotificationstrue 値は、UI を通じてアラートを提供する必要があることを確認します。 false 値は、そのチャネルを通じてユーザーに通知されないことを確認します。subscriptions.emailNotificationstrue 値は、アラートをメールで提供する必要があることを確認します。 false 値は、そのチャネルを通じてユーザーに通知されないことを確認します。応答
正常な応答は HTTP ステータス 202(許可済み)とともに、新たに作成されたクエリの詳細を返します。
{
"assetId": "c4f67291-1161-4943-bc29-8736469bb928",
"id": "query_service_flow_run_failure-5f4cb942-b67c-4ea4-a90d-5b6245e60aca",
"alertType": "failure",
"subscriptions": {
"emailIds": [
"{USER_EMAIL_ID}"
],
"inContextNotifications": false,
"emailNotifications": true
},
"_links": {
"self": {
"href": "https://platform.adobe.io/data/foundation/query/alert-subscriptions/c4f67291-1161-4943-bc29-8736469bb928",
"method": "GET"
},
"subscribe": {
"href": "https://platform.adobe.io/data/foundation/query/alert-subscriptions",
"method": "POST",
"body": "{\"assetId\": \"queryId/scheduleId\", \"alertType\": \"start/success/failure\", \"subscriptions\": {\n\"emailIds\": [\"xyz@example.com\", \"abc@example.com\"], \"email\": true, \"inContext\": false}}"
},
"patch_status": {
"href": "https://platform.adobe.io/data/foundation/query/alert-subscriptions/c4f67291-1161-4943-bc29-8736469bb928/failure",
"method": "PATCH",
"body": "{ \"op\": \"replace\", \"path\": \"/status\", \"value\": \"enable/disable\" }"
},
"get_list_of_subscribers_by_alert_type": {
"href": "https://platform.adobe.io/data/foundation/query/alert-subscriptions/c4f67291-1161-4943-bc29-8736469bb928/failure",
"method": "GET"
},
"delete": {
"href": "https://platform.adobe.io/data/foundation/query/alert-subscriptions/c4f67291-1161-4943-bc29-8736469bb928/failure",
"method": "DELETE"
}
}
}
idalertType、フロー ID で構成されます。 使用可能なアラートに関する情報は、Experience Platform アラートダッシュボードのドキュメント を参照してください。_linksアラートの有効/無効を切り替える enable-or-disable-alert
このリクエストは、クエリ ID またはスケジュール ID とアラートタイプを使用して特定のアラートを参照し、アラートステータスを enable または disable に更新します。 アラートのステータスは、/alert-subscriptions/{queryId}/{alertType} または /alert-subscriptions/{scheduleId}/{alertType} エンドポイントに対して PATCH リクエストを行うことで更新できます。
API 形式
PATCH /alert-subscriptions/{QUERY_ID}/{ALERT_TYPE}
PATCH /alert-subscriptions/{SCHEDULE_ID}/{ALERT_TYPE}
ALERT_TYPEアラートのタイプ。 スケジュールされたクエリで使用できるアラート状態は5つありますが、アドホッククエリで使用できるアラート状態は4つだけです。 quarantine アラートは、スケジュールされたクエリでのみ使用できます。 また、delay アラートはExperience Platform UIからのみ設定できます。 そのため、delayについては、ここでは説明しません。 利用可能なアラートは次のとおりです。
start:クエリの実行が開始されると、ユーザーに通知します。success:クエリが完了すると、ユーザーに通知します。failure:クエリが失敗した場合にユーザーに通知します。quarantine:スケジュールされたクエリ実行が強制隔離された状態になったときにアクティブになります。
変更するには、エンドポイントの名前空間で現在のアラートタイプを指定する必要があります。
QUERY_IDSCHEDULE_IDリクエスト
curl -X PATCH 'https://platform.adobe.io/data/foundation/query/alert-subscriptions/4422fc69-eaa7-464e-945b-63cfd435d3d1/start'' \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-sandbox-name: {SANDBOX_NAME}'
-H 'Content-Type: application/json' \
-H 'x-sandbox-id: {SANDBOX_ID}' \
-d '{
"op": "replace",
"path" : "/status",
"value": "enable"
}'
opreplace のみです。path/status のみです。valuestatus 値に変更されます。 現在、指定できる値は enable または disable です。応答
正常に行われた応答は、HTTP ステータス 200 と、アラートのステータス、タイプ、ID の詳細および関連するクエリを返します。
{
"id" : "query_service_flow_run_success-4422fc69-eaa7-464e-945b-63cfd435d3d1",
"assetId": "4422fc69-eaa7-464e-945b-63cfd435d3d1",
"alertType": "start",
"status": "enabled"
}
idalertType、フロー ID で構成されます。 使用可能なアラートに関する情報は、Experience Platform アラートダッシュボードのドキュメント を参照してください。assetIdalertType各アラートは、3 つの異なるアラートタイプを持つことができます。 次のとおりです。
start:クエリの実行が開始されると、ユーザーに通知します。success:クエリが完了すると、ユーザーに通知します。failure:クエリが失敗した場合にユーザーに通知します。
statusenabled、enabling、disabled、disabling の 4 つです。 アラートは、イベントをアクティブにリッスンしているか、関連するすべての購読者と設定を保持したまま将来利用するために一時停止されているか、または、これらのステート間を移行中です。特定のクエリおよびアラートタイプのアラートの削除 delete-alert-info-by-id-and-alert-type
/alert-subscriptions/{QUERY_ID}/{ALERT_TYPE} または /alert-subscriptions/{SCHEDULE_ID}/{ALERT_TYPE} エンドポイントに DELETE リクエストを行い、特定のクエリまたはスケジュール ID およびアラートタイプのアラートを削除できます。
DELETE /alert-subscriptions/{QUERY_ID}/{ALERT_TYPE}
DELETE /alert-subscriptions/{SCHEDULE_ID}/{ALERT_TYPE}
ALERT_TYPEアラートのタイプ。 スケジュールされたクエリで使用できるアラート状態は5つありますが、アドホッククエリで使用できるアラート状態は4つだけです。 quarantine アラートは、スケジュールされたクエリでのみ使用できます。 また、delay アラートはExperience Platform UIからのみ設定できます。 そのため、delayについては、ここでは説明しません。 利用可能なアラートは次のとおりです。
start:クエリの実行が開始されると、ユーザーに通知します。success:クエリが完了すると、ユーザーに通知します。failure:クエリが失敗した場合にユーザーに通知します。quarantine:スケジュールされたクエリ実行が強制隔離された状態になったときにアクティブになります。
DELETE リクエストは、指定された特定のアラートタイプにのみ適用されます。
QUERY_IDSCHEDULE_IDリクエスト
curl -X DELETE 'https://platform.adobe.io/data/foundation/query/alert-subscriptions/4422fc69-eaa7-464e-945b-63cfd435d3d1/start' \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-sandbox-name: {SANDBOX_NAME}' \
-H 'Content-Type: application/json' \
-H 'x-sandbox-id: {SANDBOX_ID}'
応答
応答が成功すると、HTTP 200 ステータスと、アセット ID と削除されたアラートのアラートタイプを含む確認メッセージが返されます。
{
"message": "Alert Deleted Successfully for assetId: 6df22232-f427-4250-a4e1-43cd30990641 and alertType: success",
"statusCode": 200
}
次の手順
このガイドでは、Query Service API の /alert-subscriptions エンドポイントの使用について説明しました。 このガイドを読むことで、クエリのアラートの作成、ユーザーのアラートへの登録、使用可能なアラートのタイプ、アラート購読情報の取得、更新、削除方法に関する理解が深まりました。
詳しくは、Query Service API ガイドを参照して、その他の使用可能な機能や操作をご確認ください。