Flow Service 用於收集及集中Adobe Experience Platform內各種不同來源的客戶資料。 此服務提供可連線所有支援來源的使用者介面和RESTful API。
本教學課程使用 Flow Service 用於探索通訊協定應用程式的API。
本指南需要您實際瞭解下列Adobe Experience Platform元件:
以下小節提供您需要瞭解的其他資訊,以便使用成功連線到通訊協定應用程式 Flow Service API。
為了探索您的通訊協定系統,使用 Platform API,您必須擁有有效的基本連線ID。 如果您尚未建立要使用的通訊協定系統的基礎連線,您可以透過下列教學課程來建立基礎連線:
本教學課程提供範例API呼叫,示範如何格式化您的請求。 這些包括路徑、必要的標頭,以及正確格式化的請求裝載。 此外,也提供API回應中傳回的範例JSON。 如需檔案中用於範例API呼叫的慣例相關資訊,請參閱以下章節: 如何讀取範例API呼叫 在 Experience Platform 疑難排解指南。
為了呼叫 Platform API,您必須先完成 驗證教學課程. 完成驗證教學課程後,會在所有標題中提供每個必要標題的值 Experience Platform API呼叫,如下所示:
{ACCESS_TOKEN}
{API_KEY}
{ORG_ID}
中的所有資源 Experience Platform,包括屬於 Flow Service,會隔離至特定的虛擬沙箱。 的所有要求 Platform API需要標頭,用於指定將在其中執行操作的沙箱名稱:
{SANDBOX_NAME}
包含裝載(POST、PUT、PATCH)的所有請求都需要額外的媒體型別標頭:
application/json
使用通訊協定應用程式的連線ID,您可以透過執行GET請求來探索資料表格。 使用以下呼叫來尋找您要檢查或擷取的表格路徑 Platform.
API格式
GET /connections/{BASE_CONNECTION_ID}/explore?objectType=root
參數 | 說明 |
---|---|
{BASE_CONNECTION_ID} |
通訊協定基礎連線的ID。 |
要求
curl -X GET \
'http://platform.adobe.io/data/foundation/flowservice/connections/a5c6b647-e784-4b58-86b6-47e784ab580b/explore?objectType=root' \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}'
回應
成功的回應會從通訊協定應用程式傳回資料表陣列。 尋找您要加入的表格 Platform 並記下其 path
屬性,因為您必須在下一個步驟中提供它以檢查其結構。
[
{
"type": "table",
"name": "Categories",
"path": "Categories",
"canPreview": true,
"canFetchSchema": true
},
{
"type": "table",
"name": "CustomerDemographics",
"path": "CustomerDemographics",
"canPreview": true,
"canFetchSchema": true
},
{
"type": "table",
"name": "Customers",
"path": "Customers",
"canPreview": true,
"canFetchSchema": true
},
{
"type": "table",
"name": "Orders",
"path": "Orders",
"canPreview": true,
"canFetchSchema": true
}
]
若要從通訊協定應用程式檢查表格的結構,請在將表格的路徑指定為查詢引數時執行GET要求。
API格式
GET /connections/{BASE_CONNECTION_ID}/explore?objectType=table&object={TABLE_PATH}
參數 | 說明 |
---|---|
{BASE_CONNECTION_ID} |
通訊協定應用程式的連線ID。 |
{TABLE_PATH} |
通訊協定應用程式中表格的路徑。 |
curl -X GET \
'http://platform.adobe.io/data/foundation/flowservice/connections/a5c6b647-e784-4b58-86b6-47e784ab580b/explore?objectType=table&object=Orders' \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}'
回應
成功的回應會傳回指定資料表的結構。 有關每個表格欄的詳細資訊位於 columns
陣列。
{
"format": "flat",
"schema": {
"columns": [
{
"name": "OrderID",
"type": "integer",
"xdm": {
"type": "integer",
"minimum": -2147483648,
"maximum": 2147483647
}
},
{
"name": "CustomerID",
"type": "string",
"xdm": {
"type": "string"
}
},
{
"name": "EmployeeID",
"type": "integer",
"xdm": {
"type": "integer",
"minimum": -2147483648,
"maximum": 2147483647
}
},
{
"name": "OrderDate",
"type": "string",
"meta:xdmType": "date-time",
"xdm": {
"type": "string",
"format": "date-time"
}
},
]
}
}
依照本教學課程,您已探索您的通訊協定應用程式,找到您要擷取的表格路徑 Platform,並取得有關其結構的資訊。 您可以在下一個教學課程中使用此資訊來 從您的通訊協定應用程式收集資料,並將其帶入Platform.