Flow Service 用於收集和集中Adobe Experience Platform內不同來源的客戶資料。該服務提供用戶介面和REST風格的API,所有支援的源都可從中連接。
本教學課程使用Flow Service API來探索通訊協定應用程式。
本指南需要有效瞭解Adobe Experience Platform的下列元件:
以下各節提供您需要瞭解的其他資訊,以便使用Flow Service API成功連線至通訊協定應用程式。
若要使用Platform API來探索您的通訊協定系統,您必須擁有有效的基本連線ID。 如果您尚沒有要使用的協定系統的基本連接,則可以通過以下教程建立一個協定系統:
本教學課程提供範例API呼叫,以示範如何設定請求的格式。 這些包括路徑、必要標題和正確格式化的請求負載。 也提供API回應中傳回的範例JSON。 如需範例API呼叫檔案中所用慣例的詳細資訊,請參閱Experience Platform疑難排解指南中如何讀取範例API呼叫一節。
若要呼叫Platform API,您必須先完成驗證教學課程。 完成驗證教學課程後,所有Experience Platform API呼叫中每個所需標題的值都會顯示在下面:
{ACCESS_TOKEN}
{API_KEY}
{IMS_ORG}
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: {IMS_ORG}' \
-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: {IMS_ORG}' \
-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](…/collect/protocols.md)。[