Flow Service 用于收集和集中Adobe Experience Platform内不同来源的客户数据。该服务提供用户界面和RESTful API,所有支持的源都可从中连接。
本教程使用Flow Service API来浏览付款应用程序。
本指南要求对Adobe Experience Platform的下列部分有工作上的理解:
以下各节提供您需要了解的其他信息,以便使用Flow Service API成功连接到付款应用程序。
本教程要求您与要从中获取数据的第三方支付应用程序建立有效连接。 有效的连接涉及应用程序的连接规范ID和连接ID。 有关创建付款连接和检索这些值的详细信息,请参阅将付款源连接到平台](…/…/api/create/payments/paypal.md)教程。[
本教程提供示例API调用,以演示如何设置请求的格式。 这包括路径、必需的标头和格式正确的请求负载。 还提供API响应中返回的示例JSON。 有关示例API调用文档中使用的约定的信息,请参见Experience Platform疑难解答指南中关于如何阅读示例API调用](…/…/…/…/landing/troubleshooting.md#how-do-i-format-an-api-request)的一节。[
要调用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/24151d58-ffa7-4960-951d-58ffa7396097/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": "PayPal.Billing_Plans",
"path": "PayPal.Billing_Plans",
"canPreview": true,
"canFetchSchema": true
},
{
"type": "table",
"name": "PayPal.Billing_Plans_Payment_Definition",
"path": "PayPal.Billing_Plans_Payment_Definition",
"canPreview": true,
"canFetchSchema": true
},
{
"type": "table",
"name": "PayPal.Billing_Plans_Payment_Definition_Charge_Models",
"path": "PayPal.Billing_Plans_Payment_Definition_Charge_Models",
"canPreview": true,
"canFetchSchema": true
},
{
"type": "table",
"name": "PayPal.Catalog_Products",
"path": "PayPal.Catalog_Products",
"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/24151d58-ffa7-4960-951d-58ffa7396097/explore?objectType=table&object=test1.Mytable' \
-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": "Product_Id",
"type": "string",
"xdm": {
"type": "string"
}
},
{
"name": "Product_Name",
"type": "string",
"xdm": {
"type": "string"
}
},
{
"name": "Description",
"type": "string",
"xdm": {
"type": "string"
}
},
{
"name": "Type",
"type": "string",
"xdm": {
"type": "string"
}
},
]
}
}
通过本教程,您探索了支付系统,找到了要收录到Platform中的表的路径,并获取了有关其结构的信息。 您可以在下一个教程中使用此信息来从支付系统收集数据并将其引入平台。