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