行为端点

在Experience Data Model (XDM)中,行为定义模式描述的数据的性质。 每个XDM类都必须引用一个特定行为,使用该类的所有架构都将继承该行为。 对于Platform中的几乎所有用例,有两种可用行为:

  • 记录:提供有关主题属性的信息。 主体可以是组织,也可以是个人。
  • 时间序列:提供记录主体直接或间接执行操作时的系统快照。
NOTE
Platform中的一些用例需要使用未采用上述任一行为的架构。 对于这些情况,还有第三种“临时”行为可用。 请参阅上的教程 创建临时架构 了解更多信息。
有关数据行为如何影响架构组合的更多常规信息,请参阅 模式组合基础.

/behaviors 中的端点 Schema Registry API允许您查看 global 容器。

快速入门

本指南中使用的端点是 Schema Registry API. 在继续之前,请查看 快速入门指南 有关相关文档的链接,请参阅本文档中的示例API调用指南,以及有关成功调用任何Experience PlatformAPI所需的所需标头的重要信息。

检索行为列表 list

您可以通过对以下对象发出GET请求,检索所有可用行为的列表: /behaviors 端点。

API格式

GET /global/behaviors

请求

curl -X GET \
  https://platform.adobe.io/data/foundation/schemaregistry/global/behaviors \
  -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 'Accept: application/vnd.adobe.xed-id+json'

响应

{
    "results": [
        {
            "$id": "https://ns.adobe.com/xdm/data/record",
            "meta:altId": "_xdm.data.record",
            "version": "1.16.4",
            "title": "Record Schema"
        },
        {
            "$id": "https://ns.adobe.com/xdm/data/adhoc",
            "meta:altId": "_xdm.data.adhoc",
            "version": "1.16.4",
            "title": "Ad Hoc Schema"
        },
        {
            "$id": "https://ns.adobe.com/xdm/data/time-series",
            "meta:altId": "_xdm.data.time-series",
            "version": "1.16.4",
            "title": "Time-series Schema"
        }
    ],
    "_page": {
        "orderby": "updated",
        "next": null,
        "count": 3
    },
    "_links": {
        "next": null
    }
}

查找行为 lookup

通过在GET请求的路径中提供特定行为的ID,您可以查找特定行为 /behaviors 端点。

API格式

GET /global/behaviors/{BEHAVIOR_ID}
参数
描述
{BEHAVIOR_ID}
meta:altId 或URL编码 $id 您想要查找的行为。

请求

以下请求通过提供以下内容来检索记录行为的详细信息: meta:altId 在请求路径中。

curl -X GET \
  https://platform.adobe.io/data/foundation/schemaregistry/global/behaviors/_xdm.data.record \
  -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 'Accept: application/vnd.adobe.xed+json;version=1'

响应

成功的响应将返回行为的详细信息,包括其版本、描述以及行为提供给采用它的类的属性。

{
    "$id": "https://ns.adobe.com/xdm/data/record",
    "meta:altId": "_xdm.data.record",
    "meta:resourceType": "behaviors",
    "version": "1.16.4",
    "title": "Record Schema",
    "type": "object",
    "description": "Used to indicate the behavior of record data semantic when composed into data schemas.",
    "definitions": {
        "record": {
            "properties": {
                "_id": {
                    "title": "Identifier",
                    "type": "string",
                    "format": "uri-reference",
                    "description": "A unique identifier for the record.",
                    "meta:xdmType": "string",
                    "meta:xdmField": "@id"
                }
            }
        }
    },
    "allOf": [
        {
            "$ref": "#/definitions/record",
            "type": "object",
            "meta:xdmType": "object"
        },
        {
            "$ref": "https://ns.adobe.com/xdm/common/extensible#/definitions/@context",
            "type": "object",
            "meta:xdmType": "object"
        }
    ],
    "meta:extensible": true,
    "meta:abstract": true,
    "meta:xdmType": "object",
    "meta:status": "stable",
    "$schema": "http://json-schema.org/draft-06/schema#",
    "meta:registryMetadata": {
        "repo:createdDate": 1606266789446,
        "repo:lastModifiedDate": 1606266789446,
        "eTag": "2cc114a54949a9668fe2ad046ccece59192e1bfa28f14e5ac7c893acb7820ba2",
        "meta:globalLibVersion": "1.16.4"
    }
}

后续步骤

本指南涵盖了 /behaviors 中的端点 Schema Registry API。 要了解如何使用API将行为分配给类,请参阅 类端点指南.

recommendation-more-help
62e9ffd9-1c74-4cef-8f47-0d00af32fc07