中的所有资源 Schema Library 包含在Adobe Experience Platform内的特定沙箱中。 在某些情况下,您可能希望在沙箱和组织之间共享体验数据模型(XDM)资源。 的 /rpc/export
的端点 Schema Registry API允许您在 Schema Library,然后使用该有效负载将该资源(和所有相关资源)通过导入目标沙盒和组织 /rpc/import
端点.
的 /rpc/export
端点是的一部分 Schema Registry API. 在继续之前,请查看 入门指南 有关相关文档的链接,请参阅本文档中的API调用示例指南,以及有关成功调用任何Experience PlatformAPI所需标头的重要信息。
的 /rpc/export
端点是远程过程调用(RPC)的一部分,该调用受 Schema Registry. 与 Schema Registry API、RPC端点不需要其他标头,例如 Accept
或 Content-Type
、和不使用 CONTAINER_ID
. 相反,他们必须使用 /rpc
命名空间,如下面的API调用中所示。
对于 Schema Library,则可以通过向发出GET请求来生成导出有效负载 /export
端点,提供路径中资源的ID。
API格式
GET /rpc/export/{RESOURCE_ID}
参数 | 描述 |
---|---|
{RESOURCE_ID} |
的 meta:altId 或URL编码 $id 要导出的XDM资源。 |
请求
以下请求可检索 Restaurant
字段组。
curl -X GET \
https://platform.adobe.io/data/foundation/schemaregistry/rpc/export/_{TENANT_ID}.mixins.922a56b58c6b4e4aeb49e577ec82752106ffe8971b23b4d9 \
-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.xdm-link+json'
响应
成功的响应会返回一个对象数组,它表示目标XDM资源及其所有相关资源。 在此示例中,数组中的第一个对象是租户创建的 Property
数据类型 Restaurant
字段组采用,而第二个对象是 Restaurant
字段组本身。 然后,可以使用此有效负载 导入资源 移入其他沙箱或IMS组织。
请注意,资源租户ID的所有实例都将替换为 <XDM_TENANTID_PLACEHOLDER>
. 这样,架构注册表就可以根据在后续导入调用中发送资源的位置,自动将正确的租户ID应用到资源。
[
{
"$id": "https://ns.adobe.com/<XDM_TENANTID_PLACEHOLDER>/datatypes/fc07162ee7ca8d18e074a3bb50c3938c76160bf6040e8495",
"meta:altId": "_<XDM_TENANTID_PLACEHOLDER>.datatypes.fc07162ee7ca8d18e074a3bb50c3938c76160bf6040e8495",
"meta:resourceType": "datatypes",
"version": "1.0",
"title": "Property",
"type": "object",
"description": "",
"definitions": {
"customFields": {
"properties": {
"propertyId": {
"title": "Property ID",
"description": "ID for a company-owned property.",
"type": "string",
"isRequired": false,
"meta:ui": {
"ref": [
"schema://5fbc29ec292534000055dd55",
"#/definitions/customFields"
],
"path": "{}._<XDM_TENANTID_PLACEHOLDER>{}.property{}.propertyId",
"editable": true,
"generateDate": 1606168175975
},
"meta:xdmType": "string"
},
"jurisdiction": {
"title": "Jurisdiction",
"description": "",
"type": "string",
"isRequired": false,
"enum": [
"NA",
"UK",
"EU"
],
"meta:enum": {
"NA": "North America",
"UK": "United Kingdom",
"EU": "European Union"
},
"meta:ui": {
"ref": [
"schema://5fbc29ec292534000055dd55",
"#/definitions/customFields"
],
"path": "{}._<XDM_TENANTID_PLACEHOLDER>{}.property{}.jurisdiction",
"editable": true,
"generateDate": 1606168175975
},
"meta:xdmType": "string"
}
}
}
},
"allOf": [
{
"$ref": "#/definitions/customFields",
"type": "object",
"meta:xdmType": "object"
}
],
"meta:extensible": true,
"meta:abstract": true,
"meta:xdmType": "object",
"meta:sandboxId": "ff0f6870-c46d-11e9-8ca3-036939a64204",
"meta:sandboxType": "production"
},
{
"$id": "https://ns.adobe.com/<XDM_TENANTID_PLACEHOLDER>/mixins/922a56b58c6b4e4aeb49e577ec82752106ffe8971b23b4d9",
"meta:altId": "_<XDM_TENANTID_PLACEHOLDER>.mixins.922a56b58c6b4e4aeb49e577ec82752106ffe8971b23b4d9",
"meta:resourceType": "mixins",
"version": "1.0",
"title": "Restaurant",
"type": "object",
"description": "",
"definitions": {
"customFields": {
"type": "object",
"properties": {
"_<XDM_TENANTID_PLACEHOLDER>": {
"type": "object",
"properties": {
"capacity": {
"title": "Capacity",
"description": "Restaurant capacity",
"type": "string",
"isRequired": false,
"meta:xdmType": "string"
},
"kitchen": {
"title": "Kitchen Style",
"description": "Style of kitchen",
"type": "string",
"isRequired": false,
"meta:xdmType": "string"
},
"rating": {
"title": "Rating",
"description": "",
"type": "integer",
"isRequired": false,
"meta:xdmType": "int"
},
"property": {
"title": "Property",
"description": "",
"$ref": "https://ns.adobe.com/<XDM_TENANTID_PLACEHOLDER>/datatypes/fc07162ee7ca8d18e074a3bb50c3938c76160bf6040e8495",
"type": "object",
"meta:xdmType": "object"
}
},
"meta:xdmType": "object"
}
},
"meta:xdmType": "object"
}
},
"allOf": [
{
"$ref": "#/definitions/customFields",
"type": "object",
"meta:xdmType": "object"
}
],
"meta:extensible": true,
"meta:abstract": true,
"meta:intendedToExtend": [],
"meta:xdmType": "object",
"meta:sandboxId": "ff0f6870-c46d-11e9-8ca3-036939a64204",
"meta:sandboxType": "production"
}
]
从CSV文件生成导出有效负载后,您可以将该有效负载发送到 /rpc/import
端点来生成架构。
请参阅 导入端点指南 有关如何从导出负载生成架构的详细信息。