Flow Service 用於收集和集中Adobe Experience Platform內不同來源的客戶資料。 該服務提供了用戶介面和REST風格的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並獲取了有關其結構的資訊。 您可以在下一教程中使用此資訊 從您的協定應用程式收集資料並將其引入平台。