Flow Service API を使用したデータテーブルの調査
このチュートリアルでは、Flow Service API を使用してデータテーブルの構造と内容を調査およびプレビューする手順を説明します。
はじめに
このガイドでは、Adobe Experience Platform の次のコンポーネントに関する十分な知識が必要です。
Experience Platform API の使用
Experience Platform API を正常に呼び出す方法について詳しくは、Experience Platform API の概要を参照してください。
データテーブルの探索
ソースのベース接続 ID を指定したうえで Flow Service API に対してGET リクエストを実行すると、データテーブルの構造に関する情報を取得できます。
API 形式
GET /connections/{BASE_CONNECTION_ID}/explore?objectType=root
{BASE_CONNECTION_ID}
リクエスト
curl -X GET \
'https://platform.adobe.io/data/foundation/flowservice/connections/5e73e5a2-dc36-45a8-9f16-93c7a43af318/explore?objectType=root' \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {IMS_ORG}' \
-H 'x-sandbox-name: {SANDBOX_NAME}'
応答
応答が成功すると、ソースからテーブルの配列が返されます。 Experience Platformに取り込むテーブルを見つけ、その path
プロパティをメモします。これは、次の手順で構造を調べるときに指定する必要があるからです。
[
{
"type": "table",
"name": "ACME Spring Campaign",
"path": "acmeSpringCampaign",
"canPreview": true,
"canFetchSchema": true
},
{
"type": "table",
"name": "ACME Summer Campaign",
"path": "acmeSummerCampaign",
"canPreview": true,
"canFetchSchema": true
}
]
テーブルの構造を検査する
データテーブルの内容を調べるには、Flow Service API に対してGET リクエストを実行し、その際にテーブルのパスをクエリパラメーターとして指定します。
API 形式
GET /connections/{BASE_CONNECTION_ID}/explore?objectType=table&object={TABLE_PATH}
{BASE_CONNECTION_ID}
{TABLE_PATH}
リクエスト
curl -X GET \
'https://platform.adobe.io/data/foundation/flowservice/connections/5e73e5a2-dc36-45a8-9f16-93c7a43af318/explore?objectType=table&object=acmeSpringCampaign' \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {IMS_ORG}' \
-H 'x-sandbox-name: {SANDBOX_NAME}'
応答
応答が成功すると、指定されたテーブルのコンテンツと構造に関する情報が返されます。 テーブルの各列に関する詳細は、columns
配列の要素内にあります。
{
"format": "flat",
"schema": {
"columns": [
{
"name": "TestID",
"type": "string",
"xdm": {
"type": "string"
}
},
{
"name": "Name",
"type": "string",
"xdm": {
"type": "string"
}
},
{
"name": "Datefield",
"type": "string",
"meta:xdmType": "date-time",
"xdm": {
"type": "string",
"format": "date-time"
}
},
{
"name": "complaint_type",
"type": "string",
"xdm": {
"type": "string"
}
},
{
"name": "complaint_description",
"type": "string",
"xdm": {
"type": "string"
}
},
{
"name": "status",
"type": "string",
"xdm": {
"type": "string"
}
},
{
"name": "status_change_date",
"type": "string",
"meta:xdmType": "date-time",
"xdm": {
"type": "string",
"format": "date-time"
}
},
{
"name": "city",
"type": "string",
"xdm": {
"type": "string"
}
},
{
"name": "Datefield2",
"type": "string",
"meta:xdmType": "date-time",
"xdm": {
"type": "string",
"format": "date-time"
}
}
]
}
}
次の手順
このチュートリアルでは、データテーブルの構造と内容に関する情報を収集しました。 さらに、Experience Platformに取り込むテーブルへのパスを取得しました。 この情報を使用して、ソース接続とデータフローを作成し、データをExperience Platformに取り込むことができます。 Flow Service API を使用してソース接続とデータフローを作成する方法に関する具体的な手順については、次のチュートリアルを参照してください。