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呼叫,如下所示:
Authorization: Bearer {ACCESS_TOKEN}
x-api-key: {API_KEY}
x-gw-ims-org-id: {ORG_ID}
中的所有資源 Experience Platform,包括 Flow Service,會與特定虛擬沙箱隔離。 所有請求 Platform API需要標頭,以指定要在中執行操作的沙箱名稱:
x-sandbox-name: {SANDBOX_NAME}
所有包含裝載(POST、PUT、PATCH)的請求都需要其他媒體類型標題:
Content-Type: application/json
使用 電子商務 連線ID,您可以透過執行GET要求來探索資料表。 使用以下調用查找要檢查或將其嵌入的表的路徑 Platform.
API格式
GET /connections/{CONNECTION_ID}/explore?objectType=root
參數 | 說明 |
---|---|
{CONNECTION_ID} |
您的 電子商務 連線ID。 |
要求
curl -X GET \
'http://platform.adobe.io/data/foundation/flowservice/connections/582f4f8d-71e9-4a5c-a164-9d2056318d6c/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": "Shopify.Abandoned_Checkout_Discount_Codes",
"path": "Shopify.Abandoned_Checkout_Discount_Codes",
"canPreview": true,
"canFetchSchema": true
},
{
"type": "table",
"name": "Shopify.Abandoned_Checkout_Line_Items",
"path": "Shopify.Abandoned_Checkout_Line_Items",
"canPreview": true,
"canFetchSchema": true
},
{
"type": "table",
"name": "Shopify.Blogs",
"path": "Shopify.Blogs",
"canPreview": true,
"canFetchSchema": true
},
{
"type": "table",
"name": "Shopify.Orders",
"path": "Shopify.Orders",
"canPreview": true,
"canFetchSchema": true
}
]
從 電子商務 連接時,請執行GET請求,同時指定 object
查詢參數。
API格式
GET /connections/{CONNECTION_ID}/explore?objectType=table&object={TABLE_PATH}
參數 | 說明 |
---|---|
{CONNECTION_ID} |
您的 電子商務 連線。 |
{TABLE_PATH} |
表在您 電子商務 連線。 |
要求
curl -X GET \
'http://platform.adobe.io/data/foundation/flowservice/connections/582f4f8d-71e9-4a5c-a164-9d2056318d6c/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": "Blog_Id",
"type": "double",
"xdm": {
"type": "number"
}
},
{
"name": "Title",
"type": "string",
"xdm": {
"type": "string"
}
},
{
"name": "Created_At",
"type": "string",
"meta:xdmType": "date-time",
"xdm": {
"type": "string",
"format": "date-time"
}
},
{
"name": "Tags",
"type": "string",
"xdm": {
"type": "string"
}
}
]
},
"data": [
{
"Updated_At": "2020-11-05T10:54:36",
"Title": "News",
"Commentable": "no",
"Blog_Id": 5.5458332804E10,
"Handle": "news",
"Created_At": "2020-02-14T09:11:15"
}
]
}
依照本教學課程,您已探索 電子商務 連接,找到要嵌入到的表的路徑 Platform,並取得其結構的相關資訊。 您可以在下一個教學課程中使用此資訊,以 收集電子商務資料並匯入Platform.