使用 Flow Service API

Flow Service 用于收集和集中Adobe Experience Platform内不同来源的客户数据。 该服务提供了用户界面和RESTful API,所有受支持的源都可从中连接。

本教程使用 Flow Service 用于探索营销自动化系统的API。

快速入门

本指南要求您对Adobe Experience Platform的以下组件有一定的了解:

  • : Experience Platform 允许从各种源摄取数据,同时让您能够使用来构建、标记和增强传入数据 Platform 服务。
  • 沙箱: Experience Platform 提供分区单个沙箱的虚拟沙箱 Platform 实例迁移到单独的虚拟环境中,以帮助开发和改进数字体验应用程序。

以下部分提供了您需要了解的其他信息,以便使用 Flow Service API。

收集所需的凭据

本教程要求您与要从中摄取数据的第三方营销自动化应用程序建立有效连接。 有效的连接涉及您的应用程序的连接规范ID和连接ID。 有关创建营销自动化连接和检索这些值的详细信息,请参阅 将营销自动化源连接到平台 教程。

读取示例API调用

本教程提供了用于演示如何设置请求格式的示例API调用。 这包括路径、所需标头以及格式正确的请求负载。 还提供了API响应中返回的示例JSON。 有关示例API调用文档中使用的约定的信息,请参阅 如何阅读示例API调用 在 Experience Platform 疑难解答指南。

收集所需标题的值

为了调用 Platform API,您必须先完成 身份验证教程. 完成身份验证教程将为所有中每个所需标头提供值 Experience Platform API调用,如下所示:

  • 授权:持有者 {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

浏览数据表

使用营销自动化系统的基本连接,您可以通过执行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/2fce94c1-9a93-4971-8e94-c19a93097129/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": "Hubspot.All_Deals",
        "path": "Hubspot.All_Deals",
        "canPreview": true,
        "canFetchSchema": true
    },
    {
        "type": "table",
        "name": "Hubspot.Blog_Authors",
        "path": "Hubspot.Blog_Authors",
        "canPreview": true,
        "canFetchSchema": true
    },
    {
        "type": "table",
        "name": "Hubspot.Blog_Comments",
        "path": "Hubspot.Blog_Comments",
        "canPreview": true,
        "canFetchSchema": true
    },
    {
        "type": "table",
        "name": "Hubspot.Contacts",
        "path": "Hubspot.Contacts",
        "canPreview": true,
        "canFetchSchema": true
    },
]

Inspect表的结构

要从营销自动化系统中检查表的结构,请在将表的路径指定为查询参数时执行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/2fce94c1-9a93-4971-8e94-c19a93097129/explore?objectType=table&object=Hubspot.Contacts' \
    -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": "Properties_Firstname_Value",
                "type": "string",
                "xdm": {
                    "type": "string"
                }
            },
            {
                "name": "Properties_Lastname_Value",
                "type": "string",
                "xdm": {
                    "type": "string"
                }
            },
            {
                "name": "Added_At",
                "type": "string",
                "meta:xdmType": "date-time",
                "xdm": {
                    "type": "string",
                    "format": "date-time"
                }
            },
            {
                "name": "Portal_Id",
                "type": "string",
                "xdm": {
                    "type": "string"
                }
            },
        ]
    }
}

后续步骤

通过阅读本教程,您探索了营销自动化系统,找到了要引入的表的路径 Platform,并获取了有关其结构的信息。 在下一个教程中,您可以在 从营销自动化系统中收集数据并将其导入平台.

在此页面上