Export endpoint
All resources within the Schema Library are contained in a specific sandbox within ÃÛ¶¹ÊÓƵ Experience Platform. In some cases, you may want to share Experience Data Model (XDM) resources between sandboxes and organizations. The /rpc/export
endpoint in the Schema Registry API allows you generate an export payload for any schema, schema field group, or data type in the Schema Library, and then use that payload to import that resource (and all dependent resources) into a target sandbox and organization through the /rpc/import
endpoint.
Getting started
The /rpc/export
endpoint is part of the . Before continuing, please review the getting started guide for links to related documentation, a guide to reading the sample API calls in this document, and important information regarding required headers that are needed to successfully make calls to any Experience Platform API.
The /rpc/export
endpoint is part of the remote procedure calls (RPCs) that are supported by the Schema Registry. Unlike other endpoints in the Schema Registry API, RPC endpoints do not require additional headers like Accept
or Content-Type
, and do not use a CONTAINER_ID
. Instead, they must use the /rpc
namespace, as demonstrated in the API calls below.
Generate an export payload for a resource export
For any existing schema, field group, or data type in the Schema Library, you can generate an export payload by making a GET request to the /export
endpoint, providing the ID of the resource in the path.
API format
GET /rpc/export/{RESOURCE_ID}
{RESOURCE_ID}
meta:altId
or URL-encoded $id
of the XDM resource you want to export.Request
The following request retrieves an export payload for a Restaurant
field group.
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'
Response
A successful response returns an array of objects, which represent the target XDM resource and all of its dependent resources. In this example, the first object in the array is a tenant-created Property
data type that the Restaurant
field group employs, while the second object is the Restaurant
field group itself. This payload can then be used to import the resource into a different sandbox or organization.
Note that all instances of the resource’s tenant ID are replaced with <XDM_TENANTID_PLACEHOLDER>
. This allows the Schema Registry to automatically apply the correct tenant ID to the resources depending on where they are sent in the subsequent import call.
[
{
"$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"
}
]
Import the resource import
After generating the export payload from the CSV file, you can send that payload to the /rpc/import
endpoint to generate the schema.
See the import endpoint guide for details on how to generate schemas from export payloads.