[Beta 版]{class="badge informative"}

使用API从您的Stripe帐户摄取付款数据以Experience Platform

NOTE
Stripe源为测试版。 有关使用测试版标记源的更多信息,请阅读源概述中的条款和条件

阅读以下教程,了解如何使用Flow Service API将付款数据从Stripe摄取到Adobe Experience Platform。

快速入门

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

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

身份验证

有关如何检索身份验证凭据的信息,请阅读Stripe 概述

使用平台API

有关如何成功调用平台API的信息,请参阅平台API快速入门指南。

将Stripe连接到Experience Platform

按照以下指南了解如何验证您的Stripe源、创建源连接和创建数据流以将您的付款数据带入Experience Platform。

创建基本连接 base-connection

基本连接会保留源和Experience Platform之间的信息,包括源的身份验证凭据、连接的当前状态以及唯一的基本连接ID。 您可以使用基本连接ID浏览和导航源中的文件。 此外,您还可以标识要摄取的特定项目,包括有关这些项目的数据类型和格式的详细信息。

要创建基本连接ID,请在将Stripe身份验证凭据作为请求正文的一部分提供时,向/connections端点发出POST请求。

API格式

POST /connections

请求

以下请求为Stripe创建基本连接:

curl -X POST \
  'https://platform.adobe.io/data/foundation/flowservice/connections' \
  -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}' \
  -H 'Content-Type: application/json' \
  -d '{
      "name": "Stripe base connection",
      "description": "Authenticated base connection for Stripe",
      "connectionSpec": {
          "id": "cc2c31d6-7b8c-4581-b49f-5c8698aa3ab3",
          "version": "1.0"
      },
      "auth": {
          "specName": "OAuth2 Refresh Code",
          "params": {
            "accessToken": "{ACCESS_TOKEN}",
          }
      }
  }'
属性
描述
name
基础连接的名称。 确保基本连接的名称是描述性的,因为您可以使用此名称查找有关基本连接的信息。
description
可包含的可选值,用于提供有关基本连接的更多信息。
connectionSpec.id
源的连接规范ID。 Stripe的连接规范ID为cc2c31d6-7b8c-4581-b49f-5c8698aa3ab3,此ID已修复。
auth.specName
用于向Experience Platform验证源的身份验证类型。
auth.params.accessToken
Stripe帐户的访问令牌。 有关如何检索访问令牌的步骤,请阅读Stripe 身份验证指南

响应

成功的响应返回新创建的基本连接,包括其唯一连接标识符(id)。 在下一步中浏览源的文件结构和内容时,需要此ID。

{
  "id": "a9950001-a386-4642-a0cd-5eaac6db5556",
  "etag": "\"dc01244d-0000-0200-0000-65ea4e500000\""
}

浏览您的源 explore

获得基本连接ID后,您现在可以通过对/connections端点执行GET请求来探索源数据的内容和结构,同时将基本连接ID作为查询参数提供。

API格式

GET /connections/{BASE_CONNECTION_ID}/explore?objectType=rest&object={OBJECT}&fileType={FILE_TYPE}&preview={PREVIEW}&sourceParams={SOURCE_PARAMS}

请求

执行GET请求以浏览源的文件结构和内容时,必须包括下表列出的查询参数:

参数
描述
{BASE_CONNECTION_ID}
上一步中生成的基本连接ID。
objectType=rest
您希望浏览的对象类型。 此值始终设置为rest
{OBJECT}
只有在查看特定目录时才需要此参数。 其值表示您希望浏览的目录的路径。 对于此源,该值将为json
fileType=json
您要带到Platform的文件类型。 当前,json是唯一支持的文件类型。
{PREVIEW}
一个布尔值,定义连接的内容是否支持预览。
{SOURCE_PARAMS}

指向要浏览的资源路径的Base64-编码字符串。 您的资源路径需要以Base64编码,才能获得{SOURCE_PARAMS}的批准格式。 例如,{"resourcePath":"charges"}编码为eyJyZXNvdXJjZVBhdGgiOiJjaGFyZ2VzIn0%3D。 可用资源路径的列表包括:

  • charges
  • subscriptions
  • refunds
  • balance_transactions
  • customers
  • prices
curl -X GET \
  'https://platform.adobe.io/data/foundation/flowservice/connections/a9950001-a386-4642-a0cd-5eaac6db5556/explore?objectType=rest&object=json&fileType=json&preview=false&sourceParams=eyJyZXNvdXJjZVBhdGgiOiJjaGFyZ2VzIn0%3D' \
  -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}'

响应

成功的响应会返回类似于以下内容的JSON结构:

选择以查看JSON有效负载
code language-json
{
  "format": "hierarchical",
  "schema": {
    "type": "object",
    "properties": {
      "data": {
        "type": "object",
        "properties": {
          "balance_transaction": {},
          "billing_details": {
            "type": "object",
            "properties": {
              "address": {
                "type": "object",
                "properties": {
                  "country": {},
                  "city": {},
                  "state": {},
                  "postal_code": {},
                  "line2": {},
                  "line1": {}
                }
              },
              "phone": {},
              "name": {},
              "email": {}
            }
          },
          "metadata": {
            "type": "object",
            "properties": {}
          },
          "livemode": {
            "type": "boolean"
          },
          "radar_options": {
            "type": "object",
            "properties": {}
          },
          "destination": {},
          "description": {
            "type": "string"
          },
          "failure_message": {},
          "fraud_details": {
            "type": "object",
            "properties": {}
          },
          "source": {},
          "amount_refunded": {
            "type": "integer",
            "minimum": -9007199254740992,
            "maximum": 9007199254740991
          },
          "statement_descriptor": {
            "type": "string"
          },
          "transfer_data": {},
          "receipt_url": {
            "type": "string"
          },
          "shipping": {},
          "review": {},
          "captured": {
            "type": "boolean"
          },
          "calculated_statement_descriptor": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "refunded": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "outcome": {
            "type": "object",
            "properties": {
              "reason": {},
              "risk_level": {
                "type": "string"
              },
              "risk_score": {
                "type": "integer",
                "minimum": -9007199254740992,
                "maximum": 9007199254740991
              },
              "seller_message": {
                "type": "string"
              },
              "network_status": {
                "type": "string"
              },
              "type": {
                "type": "string"
              }
            }
          },
          "payment_method": {
            "type": "string"
          },
          "order": {},
          "dispute": {},
          "amount": {
            "type": "integer",
            "minimum": -9007199254740992,
            "maximum": 9007199254740991
          },
          "disputed": {
            "type": "boolean"
          },
          "failure_code": {},
          "transfer_group": {},
          "on_behalf_of": {},
          "created": {
            "type": "integer",
            "minimum": -9007199254740992,
            "maximum": 9007199254740991
          },
          "payment_method_details": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string"
              },
              "card": {
                "type": "object",
                "properties": {
                  "country": {
                    "type": "string"
                  },
                  "last4": {
                    "type": "string"
                  },
                  "funding": {
                    "type": "string"
                  },
                  "mandate": {},
                  "wallet": {},
                  "exp_month": {
                    "type": "integer",
                    "minimum": -9007199254740992,
                    "maximum": 9007199254740991
                  },
                  "exp_year": {
                    "type": "integer",
                    "minimum": -9007199254740992,
                    "maximum": 9007199254740991
                  },
                  "overcapture": {
                    "type": "object",
                    "properties": {
                      "maximum_amount_capturable": {
                        "type": "integer",
                        "minimum": -9007199254740992,
                        "maximum": 9007199254740991
                      },
                      "status": {
                        "type": "string"
                      }
                    }
                  },
                  "amount_authorized": {
                    "type": "integer",
                    "minimum": -9007199254740992,
                    "maximum": 9007199254740991
                  },
                  "network": {
                    "type": "string"
                  },
                  "network_token": {
                    "type": "object",
                    "properties": {
                      "used": {
                        "type": "boolean"
                      }
                    }
                  },
                  "incremental_authorization": {
                    "type": "object",
                    "properties": {
                      "status": {
                        "type": "string"
                      }
                    }
                  },
                  "checks": {
                    "type": "object",
                    "properties": {
                      "cvc_check": {
                        "type": "string"
                      },
                      "address_line1_check": {},
                      "address_postal_code_check": {}
                    }
                  },
                  "extended_authorization": {
                    "type": "object",
                    "properties": {
                      "status": {
                        "type": "string"
                      }
                    }
                  },
                  "installments": {},
                  "capture_before": {
                    "type": "integer",
                    "minimum": -9007199254740992,
                    "maximum": 9007199254740991
                  },
                  "fingerprint": {
                    "type": "string"
                  },
                  "three_d_secure": {},
                  "brand": {
                    "type": "string"
                  },
                  "multicapture": {
                    "type": "object",
                    "properties": {
                      "status": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "amount_captured": {
            "type": "integer",
            "minimum": -9007199254740992,
            "maximum": 9007199254740991
          },
          "source_transfer": {},
          "failure_balance_transaction": {},
          "receipt_number": {},
          "application": {},
          "receipt_email": {},
          "paid": {
            "type": "boolean"
          },
          "application_fee": {},
          "payment_intent": {
            "type": "string"
          },
          "invoice": {},
          "statement_descriptor_suffix": {},
          "application_fee_amount": {},
          "object": {
            "type": "string"
          },
          "customer": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        }
      }
    }
  }
}

创建源连接 source-connection

您可以通过向Flow Service API的/sourceConnections端点发出POST请求来创建源连接。 源连接由连接ID、源数据文件的路径以及连接规范ID组成。

API格式

POST /sourceConnections

请求

以下请求为Stripe创建源连接。

curl -X POST \
  'https://platform.adobe.io/data/foundation/flowservice/sourceConnections' \
  -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}' \
  -H 'Content-Type: application/json' \
  -d '{
      "name": "Stripe Source Connection For Charges Data",
      "description": "Stripe source connection for charges data",
      "baseConnectionId": "a9950001-a386-4642-a0cd-5eaac6db5556",
      "connectionSpec": {
        "id": "cc2c31d6-7b8c-4581-b49f-5c8698aa3ab3",
        "version": "1.0"
      },
      "data": {
        "format": "json"
      },
      "params": {
        "resourcePath": "charges"
      },
  }'
属性
描述
name
源连接的名称。 请确保源连接的名称是描述性的,因为您可以使用此名称查找有关源连接的信息。
description
可包含的可选值,用于提供有关源连接的更多信息。
baseConnectionId
Stripe的基本连接ID。 此ID是在前面的步骤中生成的。
connectionSpec.id
与源对应的连接规范ID。
data.format
要摄取的Stripe数据的格式。 当前,唯一支持的数据格式为json

成功的响应返回新创建的源连接的唯一标识符(id)。 此ID是稍后步骤创建数据流所必需的。

{
  "id": "abbfac4e-202c-4e04-902d-6f73e9041068",
  "etag": "\"0a033818-0000-0200-0000-65ea5a770000\""
}

创建目标XDM架构 target-schema

为了在Experience Platform中使用源数据,必须创建目标架构以根据需要构建源数据。 然后,使用目标架构创建包含源数据的Platform数据集。

通过向架构注册表API执行POST请求,可以创建目标XDM架构。

有关如何创建目标XDM架构的详细步骤,请参阅有关使用API 创建架构的教程

创建目标数据集 target-dataset

可以通过向目录服务API执行POST请求,在有效负载中提供目标架构的ID来创建目标数据集。

有关如何创建目标数据集的详细步骤,请参阅有关使用API创建数据集的教程

创建目标连接 target-connection

目标连接表示与要存储所摄取数据的目标的连接。 要创建目标连接,您必须提供对应于数据湖的固定连接规范ID。 此ID为: c604ff05-7f1a-43c0-8e18-33bf874cb11c

现在,您拥有目标架构、目标数据集以及到数据湖的连接规范ID。 使用这些标识符,您可以使用Flow Service API创建目标连接,以指定将包含入站源数据的数据集。

API格式

POST /targetConnections

请求

以下请求为Stripe创建目标连接:

curl -X POST \
  'https://platform.adobe.io/data/foundation/flowservice/targetConnections' \
  -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}' \
  -H 'Content-Type: application/json' \
  -d '{
      "name": "Stripe Target Connection For Charges Data",
      "description": "Stripe target connection for charges data",
      "connectionSpec": {
          "id": "c604ff05-7f1a-43c0-8e18-33bf874cb11c",
          "version": "1.0"
      },
      "data": {
          "format": "parquet_xdm",
          "schema": {
              "id": "https://ns.adobe.com/{ORG_ID}/schemas/5f76be8c4e4b847fdac13ca42aa6b596a89a5b91dea48b16",
              "version": "application/vnd.adobe.xed-full+json;version=1.3"
          }
      },
      "params": {
          "dataSetId": "65e622315f78042c9e8166e8"
      }
  }'
属性
描述
name
目标连接的名称。 确保目标连接的名称是描述性的,因为您可以使用此名称查找有关目标连接的信息。
description
可包含的可选值,用于提供有关目标连接的更多信息。
connectionSpec.id
对应于数据湖的连接规范ID。 此固定ID为: c604ff05-7f1a-43c0-8e18-33bf874cb11c
data.format
要摄取的Stripe数据的格式。
params.dataSetId
目标数据集的ID。 此ID由创建目标数据集生成。

响应

成功的响应返回新目标连接的唯一标识符(id)。 此ID在后续步骤中是必需的。

{
  "id": "69879751-ba43-48df-8cd0-39d2bb76a5b8",
  "etag": "\"4b02ef5b-0000-0200-0000-65ea5f730000\""
}

创建映射 mapping

要将源数据摄取到目标数据集中,必须首先将其映射到目标数据集所遵循的目标架构。 这是通过向Data Prep API执行POST请求来实现的,该请求具有在请求有效负载中定义的数据映射。

API格式

POST /conversion/mappingSets

以下请求为Stripe创建映射。

选择以查看请求示例
code language-shell
curl -X POST \
  'https://platform.adobe.io/data/foundation/conversion/mappingSets' \
  -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}' \
  -H 'Content-Type: application/json' \
  -d '{
      "version": 0,
      "xdmSchema": "https://ns.adobe.com/exchangesandboxcharlie/schemas/5f76be8c4e4b847fdac13ca42aa6b596a89a5b91dea48b16",
      "xdmVersion": "1.0",
      },
      "mappings":[
        {
            "destinationXdmPath":"_{ORG_ID}.charges_data.id",
            "sourceAttribute":"data.id",
            "identity":false,
            "version":0
        },
        {
            "destinationXdmPath":"_{ORG_ID}.charges_data.refunded",
            "sourceAttribute":"data.refunded",
            "identity":false,
            "version":0
        },
        {
            "destinationXdmPath":"_{ORG_ID}.charges_data.disputed",
            "sourceAttribute":"data.disputed",
            "identity":false,
            "version":0
        },
        {
            "destinationXdmPath":"_{ORG_ID}.charges_data.payment_method_details.card.last4",
            "sourceAttribute":"data.payment_method_details.card.last4",
            "identity":false,
            "version":0
        },
        {
            "destinationXdmPath":"_{ORG_ID}.charges_data.livemode",
            "sourceAttribute":"data.livemode",
            "identity":false,
            "version":0
        },
        {
            "destinationXdmPath":"_{ORG_ID}.charges_data.status",
            "sourceAttribute":"data.status",
            "identity":false,
            "version":0
        },
        {
            "destinationXdmPath":"_{ORG_ID}.charges_data.payment_method_details.card.overcapture.maximum_amount_capturable",
            "sourceAttribute":"data.payment_method_details.card.overcapture.maximum_amount_capturable",
            "identity":false,
            "version":0
        },
        {
            "destinationXdmPath":"_{ORG_ID}.charges_data.receipt_url",
            "sourceAttribute":"data.receipt_url",
            "identity":false,
            "version":0
        },
        {
            "destinationXdmPath":"_{ORG_ID}.charges_data.payment_method_details.card.fingerprint",
            "sourceAttribute":"data.payment_method_details.card.fingerprint",
            "identity":false,
            "version":0
        },
        {
            "destinationXdmPath":"_{ORG_ID}.charges_data.payment_intent",
            "sourceAttribute":"data.payment_intent",
            "identity":false,
            "version":0
        },
        {
            "destinationXdmPath":"_{ORG_ID}.charges_data.payment_method_details.card.overcapture.status",
            "sourceAttribute":"data.payment_method_details.card.overcapture.status",
            "identity":false,
            "version":0
        },
        {
            "destinationXdmPath":"_{ORG_ID}.charges_data.payment_method_details.card.network_token.used",
            "sourceAttribute":"data.payment_method_details.card.network_token.used",
            "identity":false,
            "version":0
        },
        {
            "destinationXdmPath":"_{ORG_ID}.charges_data.payment_method_details.card.funding",
            "sourceAttribute":"data.payment_method_details.card.funding",
            "identity":false,
            "version":0
        },
        {
            "destinationXdmPath":"_{ORG_ID}.charges_data.amount",
            "sourceAttribute":"data.amount",
            "identity":false,
            "version":0
        },
        {
            "destinationXdmPath":"_{ORG_ID}.charges_data.customer",
            "sourceAttribute":"data.customer",
            "identity":false,
            "version":0
        },
        {
            "destinationXdmPath":"_{ORG_ID}.charges_data.payment_method_details.card.incremental_authorization.status",
            "sourceAttribute":"data.payment_method_details.card.incremental_authorization.status",
            "identity":false,
            "version":0
        },
        {
            "destinationXdmPath":"_{ORG_ID}.charges_data.payment_method_details.card.multicapture.status",
            "sourceAttribute":"data.payment_method_details.card.multicapture.status",
            "identity":false,
            "version":0
        },
        {
            "destinationXdmPath":"_{ORG_ID}.charges_data.amount_captured",
            "sourceAttribute":"data.amount_captured",
            "identity":false,
            "version":0
        },
        {
            "destinationXdmPath":"_{ORG_ID}.charges_data.payment_method",
            "sourceAttribute":"data.payment_method",
            "identity":false,
            "version":0
        },
        {
            "destinationXdmPath":"_{ORG_ID}.charges_data.object",
            "sourceAttribute":"data.object",
            "identity":false,
            "version":0
        },
        {
            "destinationXdmPath":"_{ORG_ID}.charges_data.captured",
            "sourceAttribute":"data.captured",
            "identity":false,
            "version":0
        },
        {
            "destinationXdmPath":"_{ORG_ID}.charges_data.created",
            "sourceAttribute":"data.created",
            "identity":false,
            "version":0
        },
        {
            "destinationXdmPath":"_{ORG_ID}.charges_data.paid",
            "sourceAttribute":"data.paid",
            "identity":false,
            "version":0
        },
        {
            "destinationXdmPath":"_{ORG_ID}.charges_data.amount_refunded",
            "sourceAttribute":"data.amount_refunded",
            "identity":false,
            "version":0
        },
        {
            "destinationXdmPath":"_{ORG_ID}.charges_data.currency",
            "sourceAttribute":"data.currency",
            "identity":false,
            "version":0
        },
        {
            "destinationXdmPath":"_{ORG_ID}.charges_data.payment_method_details.card.country",
            "sourceAttribute":"data.payment_method_details.card.country",
            "identity":false,
            "version":0
        },
        {
            "destinationXdmPath":"_{ORG_ID}.charges_data.payment_method_details.card.exp_year",
            "sourceAttribute":"data.payment_method_details.card.exp_year",
            "identity":false,
            "version":0
        },
        {
            "destinationXdmPath":"_{ORG_ID}.charges_data.payment_method_details.card.amount_authorized",
            "sourceAttribute":"data.payment_method_details.card.amount_authorized",
            "identity":false,
            "version":0
        },
        {
            "destinationXdmPath":"_{ORG_ID}.charges_data.payment_method_details.card.network",
            "sourceAttribute":"data.payment_method_details.card.network",
            "identity":false,
            "version":0
        },
        {
            "destinationXdmPath":"_{ORG_ID}.charges_data.payment_method_details",
            "sourceAttribute":"data.payment_method_details",
            "identity":false,
            "version":0
        },
        {
            "destinationXdmPath":"_{ORG_ID}.charges_data.payment_method_details.card.exp_month",
            "sourceAttribute":"data.payment_method_details.card.exp_month",
            "identity":false,
            "version":0
        },
        {
            "destinationXdmPath":"_{ORG_ID}.charges_data.calculated_statement_descriptor",
            "sourceAttribute":"data.calculated_statement_descriptor",
            "identity":false,
            "version":0
        },
        {
            "destinationXdmPath":"_{ORG_ID}.charges_data.payment_method_details.card.brand",
            "sourceAttribute":"data.payment_method_details.card.brand",
            "identity":false,
            "version":0
        },
        {
            "destinationXdmPath":"_{ORG_ID}.charges_data.balance_transaction",
            "sourceAttribute":"data.balance_transaction",
            "identity":false,
            "version":0
        },
        {
            "destinationXdmPath":"_{ORG_ID}.charges_data.payment_method_details.card.extended_authorization.status",
            "sourceAttribute":"data.payment_method_details.card.extended_authorization.status",
            "identity":false,
            "version":0
        },
        {
            "destinationXdmPath":"_{ORG_ID}.charges_data.outcome",
            "sourceAttribute":"data.outcome",
            "identity":false,
            "version":0
        }
      ]
}
table 0-row-2 1-row-2 2-row-2 3-row-2 4-row-2 5-row-2
属性 描述
xdmSchema 目标XDM架构的ID。 此ID通过创建目标XDM架构生成。
destinationXdmPath 源属性将映射到的XDM字段。
sourceAttribute 正在映射的源数据字段。
identity 一个布尔值,用于定义字段是否将保留在标识服务中。
version 您正在使用的映射版本。

响应

成功的响应返回新创建的映射的详细信息,包括其唯一标识符(id)。 在后续步骤中需要使用此值来创建数据流。

{
  "id": "f4aad280fdec4770b7e33066945919d8",
  "version": 0,
  "createdDate": 1709860257007,
  "modifiedDate": 1709860257007,
  "createdBy": "{CREATED_BY}",
  "modifiedBy": "{MODIFIED_BY}"
}

创建流 flow

将数据从Stripe引入到Platform的最后一步是创建数据流。 现在,您已准备以下必需值:

数据流负责从源中计划和收集数据。 您可以通过在有效负载中提供上述值时执行POST请求来创建数据流。

API格式

POST /flows

请求

curl -X POST \
  'https://platform.adobe.io/data/foundation/flowservice/flows' \
  -H 'x-api-key: {API_KEY}' \
  -H 'x-gw-ims-org-id: {ORG_ID}' \
  -H 'x-sandbox-name: {SANDBOX_NAME}' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Stripe Connector Flow Generic Rest",
    "description": "Stripe Connector Description Flow Generic Rest",
    "flowSpec": {
        "id": "6499120c-0b15-42dc-936e-847ea3c24d72",
        "version": "1.0"
    },
    "sourceConnectionIds": [
        "abbfac4e-202c-4e04-902d-6f73e9041068"
    ],
    "targetConnectionIds": [
        "69879751-ba43-48df-8cd0-39d2bb76a5b8"
    ],
    "transformations": [
        {
            "name": "Mapping",
            "params": {
                "mappingId": "f4aad280fdec4770b7e33066945919d8",
                "mappingVersion": 0
            }
        }
    ],
    "scheduleParams": {
        "startTime": "1710267858",
        "frequency": "minute",
        "interval": {{interval}}
    }
}'
属性
描述
name
您的数据流的名称。 确保数据流的名称是描述性的,因为您可以使用此名称查找数据流上的信息。
description
可包含的可选值,用于提供有关数据流的更多信息。
flowSpec.id
创建数据流所需的流规范ID。 此固定ID为: 6499120c-0b15-42dc-936e-847ea3c24d72
flowSpec.version
流规范ID的相应版本。 此值默认为1.0
sourceConnectionIds
在之前的步骤中生成的源连接ID
targetConnectionIds
在之前的步骤中生成的目标连接ID
transformations
此属性包含需要应用于数据的各种转换。 将不符合XDM的数据引入Experience Platform时需要此属性。
transformations.name
分配给转换的名称。
transformations.params.mappingId
在之前的步骤中生成的映射ID
transformations.params.mappingVersion
映射ID的相应版本。 此值默认为0
scheduleParams.startTime
您的数据流将开始的时间。 必须以Unix时间戳的格式提供开始时间值。
scheduleParams.frequency

数据流收集数据的频率。 您可以将摄取频率配置为:

  • 一次:将频率设置为once以创建一次性引入。 创建一次性摄取数据流时,间隔和回填配置不可用。 默认情况下,调度频率设置为一次。
  • 分钟:将频率设置为minute,以计划数据流以每分钟摄取数据。
  • 小时:将频率设置为hour,以计划数据流每小时摄取数据。
  • :将频率设置为day,以计划数据流每天摄取数据。
  • :将频率设置为week,以计划数据流每周摄取数据。
scheduleParams.interval
间隔指定两次连续流运行之间的周期。 例如,如果将频率设置为天并将间隔配置为15,则数据流将每15天运行一次。 间隔值应为非零整数。

响应

成功的响应返回新创建的数据流的ID (id)。 您可以使用此ID监视、更新或删除数据流。

{
     "id": "84c64142-1741-4b0b-95a9-65644eba0cf6",
     "etag": "\"3901770b-0000-0200-0000-655708970000\""
}

附录

以下部分提供了有关监视、更新和删除数据流可以采取的步骤的信息。

监测数据流

创建数据流后,您可以监视通过它摄取的数据,以查看有关流运行、完成状态和错误的信息。 有关完整的API示例,请阅读有关使用API监视源数据流的指南。

更新您的数据流

在提供数据流ID的同时,通过向Flow Service API的/flows端点发出PATCH请求,更新数据流的详细信息,例如其名称和描述,以及其运行计划和关联的映射集。 发出PATCH请求时,必须在If-Match标头中提供数据流唯一的etag。 有关完整的API示例,请阅读有关使用API更新源数据流的指南。

更新您的帐户

在提供您的基本连接ID作为查询参数的同时,通过执行对Flow Service API的PATCH请求来更新源帐户的名称、描述和凭据。 发出PATCH请求时,必须在If-Match标头中提供源帐户的唯一etag。 有关完整的API示例,请阅读有关使用API更新源帐户的指南。

删除您的数据流

在查询参数中提供要删除的数据流的ID时,通过向Flow Service API执行DELETE请求来删除数据流。 有关完整的API示例,请阅读有关使用API删除数据流的指南。

删除您的帐户

在提供要删除的帐户的基本连接ID时,通过向Flow Service API执行DELETE请求来删除您的帐户。 有关完整的API示例,请阅读有关使用API🔗删除源帐户的指南。

recommendation-more-help
337b99bb-92fb-42ae-b6b7-c7042161d089