Creare uno schema utilizzando l'API Schema Registry
Schema Registry viene utilizzato per accedere a Schema Library in Adobe Experience Platform. Schema Library contiene le risorse rese disponibili da Adobe, dai partner Experience Platform e dai fornitori di cui utilizzi le applicazioni. Il Registro di sistema fornisce un’interfaccia utente e un’API RESTful da cui tutte le risorse di libreria disponibili sono accessibili.
Questa esercitazione utilizza l'API Schema Registry per illustrare i passaggi necessari per comporre uno schema utilizzando una classe standard. Se si preferisce utilizzare l'interfaccia utente in Experience Platform, l'esercitazione sull'editor di schemi fornisce istruzioni dettagliate per l'esecuzione di azioni simili nell'editor di schemi.
Introduzione
Questa guida richiede una buona conoscenza dei seguenti componenti di Adobe Experience Platform:
- Experience Data Model (XDM) System: framework standardizzato tramite il quale Experience Platform organizza i dati sull'esperienza del cliente.
- Nozioni di base sulla composizione dello schema: scopri i blocchi predefiniti di base degli schemi XDM, inclusi i principi chiave e le best practice nella composizione dello schema.
- Real-Time Customer Profile: fornisce un profilo consumer unificato e in tempo reale basato su dati aggregati provenienti da più origini.
- Sandboxes: Experience Platform fornisce sandbox virtuali che suddividono una singola istanza Platform in ambienti virtuali separati, utili per le attività di sviluppo e aggiornamento delle applicazioni di esperienza digitale.
Prima di iniziare questo tutorial, consulta la guida per gli sviluppatori per informazioni importanti che devi conoscere per effettuare correttamente le chiamate all'API Schema Registry. Ciò include {TENANT_ID}
, il concetto di "contenitori" e le intestazioni necessarie per effettuare le richieste (con particolare attenzione all'intestazione Accept
e ai suoi possibili valori).
Questo tutorial illustra i passaggi necessari per comporre uno schema Membri fedeltà che descrive i dati relativi ai membri di un programma fedeltà per la vendita al dettaglio. Prima di iniziare, è possibile visualizzare in anteprima lo schema Membri fedeltà completo nell'appendice.
Componi uno schema con una classe standard
Uno schema può essere considerato come il blueprint per i dati che desideri acquisire in Experience Platform. Ogni schema è composto da una classe e da zero o più gruppi di campi dello schema. In altre parole, non è necessario aggiungere un gruppo di campi per definire uno schema, ma nella maggior parte dei casi viene utilizzato almeno un gruppo di campi.
Assegna una classe
Il processo di composizione dello schema inizia con la selezione di una classe. La classe definisce gli aspetti comportamentali chiave dei dati (record vs serie temporali), nonché i campi minimi necessari per descrivere i dati che verranno acquisiti.
Lo schema che si sta creando in questa esercitazione utilizza la classe XDM Individual Profile. XDM Individual Profile è una classe standard fornita da Adobe per la definizione del comportamento del record. Ulteriori informazioni sul comportamento sono disponibili in nozioni di base sulla composizione dello schema.
Per assegnare una classe, viene effettuata una chiamata API per creare (POST) un nuovo schema nel contenitore tenant. Questa chiamata include la classe che lo schema implementerà. Ogni schema può implementare una sola classe.
Formato API
POST /tenant/schemas
Richiesta
La richiesta deve includere un attributo allOf
che fa riferimento a $id
di una classe. Questo attributo definisce la "classe base" che lo schema implementerà. In questo esempio, la classe base è la classe XDM Individual Profile. $id
della classe XDM Individual Profile viene utilizzato come valore del campo $ref
nell'array allOf
seguente.
curl -X POST \
https://platform.adobe.io/data/foundation/schemaregistry/tenant/schemas \
-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 '{
"type": "object",
"title": "Loyalty Members",
"description": "Information for all members of the loyalty program",
"allOf": [
{
"$ref": "https://ns.adobe.com/xdm/context/profile"
}
]
}'
Risposta
In caso di esito positivo, la richiesta restituisce lo stato di risposta HTTP 201 (creato) con un corpo di risposta contenente i dettagli dello schema appena creato, inclusi $id
, meta:altIt
e version
. Questi valori sono di sola lettura e sono assegnati da Schema Registry.
{
"$id": "https://ns.adobe.com/tenantId/schemas/ee56b80adc7e03b8214e135a28538fe83c7f85bf87f565b3",
"meta:altId": "_tenantId.schemas.ee56b80adc7e03b8214e135a28538fe83c7f85bf87f565b3",
"meta:resourceType": "schemas",
"version": "1.0",
"title": "Loyalty Members",
"type": "object",
"description": "Information for all members of the loyalty program",
"allOf": [
{
"$ref": "https://ns.adobe.com/xdm/context/profile",
"type": "object",
"meta:xdmType": "object"
}
],
"refs": [
"https://ns.adobe.com/xdm/context/profile"
],
"imsOrg": "{ORG_ID}",
"meta:extensible": false,
"meta:abstract": false,
"meta:extends": [
"https://ns.adobe.com/xdm/common/auditable",
"https://ns.adobe.com/xdm/data/record",
"https://ns.adobe.com/xdm/context/profile"
],
"meta:xdmType": "object",
"meta:registryMetadata": {
"repo:createdDate": 1673310304048,
"repo:lastModifiedDate": 1673310304048,
"xdm:createdClientId": "{CLIENT_ID}",
"xdm:lastModifiedClientId": "{CLIENT_ID}",
"xdm:createdUserId": "{USER_ID}",
"xdm:lastModifiedUserId": "{USER_ID}",
"eTag": "6d2ed8acd9c3b768a44de29e069fc6f71329d2550f708381d22fa8bf8c192366",
"meta:globalLibVersion": "1.38.2"
},
"meta:class": "https://ns.adobe.com/xdm/context/profile",
"meta:containerId": "tenant",
"meta:sandboxId": "28e74200-e3de-11e9-8f5d-7f27416c5f0d",
"meta:sandboxType": "production",
"meta:tenantNamespace": "_tenantId"
}
Cercare uno schema
Per visualizzare lo schema appena creato, eseguire una richiesta di ricerca (GET) utilizzando l'URI meta:altId
o l'URL codificato $id
per lo schema.
Formato API
GET /tenant/schemas/{SCHEMA_ID}
{SCHEMA_ID}
meta:altId
o $id
con codifica URL dello schema che si desidera cercare.Richiesta
curl -X GET \
https://platform.adobe.io/data/foundation/schemaregistry/tenant/schemas/https%3A%2F%2Fns.adobe.com%2F{TENANT_ID}%2Fschemas%2F533ca5da28087c44344810891b0f03d9\
-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'
Risposta
Il formato della risposta dipende dall'intestazione Accept
inviata con la richiesta. Prova a sperimentare con intestazioni Accept
diverse per vedere quale soddisfa meglio le tue esigenze.
{
"$id": "https://ns.adobe.com/{TENANT_ID}/schemas/ee56b80adc7e03b8214e135a28538fe83c7f85bf87f565b3",
"meta:altId": "_{TENANT_ID}.schemas.ee56b80adc7e03b8214e135a28538fe83c7f85bf87f565b3",
"meta:resourceType": "schemas",
"version": "1.0",
"title": "Loyalty Members",
"type": "object",
"description": "Information for all members of the loyalty program",
"allOf": [
{
"$ref": "https://ns.adobe.com/xdm/context/profile",
"type": "object",
"meta:xdmType": "object"
}
],
"imsOrg": "{ORG_ID}",
"meta:extensible": false,
"meta:abstract": false,
"meta:extends": [
"https://ns.adobe.com/xdm/common/auditable",
"https://ns.adobe.com/xdm/data/record",
"https://ns.adobe.com/xdm/context/profile"
],
"meta:xdmType": "object",
"meta:registryMetadata": {
"repo:createdDate": 1673310304048,
"repo:lastModifiedDate": 1673310304048,
"xdm:createdClientId": "{CLIENT_ID}",
"xdm:lastModifiedClientId": "{CLIENT_ID}",
"xdm:createdUserId": "{USER_ID}",
"xdm:lastModifiedUserId": "{USER_ID}",
"eTag": "6d2ed8acd9c3b768a44de29e069fc6f71329d2550f708381d22fa8bf8c192366",
"meta:globalLibVersion": "1.38.2"
},
"meta:class": "https://ns.adobe.com/xdm/context/profile",
"meta:containerId": "tenant",
"meta:sandboxId": "28e74200-e3de-11e9-8f5d-7f27416c5f0d",
"meta:sandboxType": "production",
"meta:tenantNamespace": "_{TENANT_ID}",
"meta:allFieldAccess": true
}
Aggiungi un gruppo di campi add-a-field-group
Dopo aver creato e confermato lo schema Membri fedeltà, è possibile aggiungere gruppi di campi.
Sono disponibili diversi gruppi di campi standard da utilizzare, a seconda della classe di schema selezionata. Ogni gruppo di campi contiene un campo intendedToExtend
che definisce le classi con cui il gruppo di campi è compatibile.
I gruppi di campi definiscono concetti, ad esempio "nome" o "indirizzo", che possono essere riutilizzati in qualsiasi schema che debba acquisire le stesse informazioni.
Formato API
PATCH /tenant/schemas/{SCHEMA_ID}
{SCHEMA_ID}
meta:altId
o $id
con codifica URL dello schema a cui si sta aggiungendo il gruppo di campi.Richiesta
Questa richiesta aggiorna lo schema Membri fedeltà per includere i campi nel gruppo di campi Dettagli demografici (profile-person-details
).
Aggiungendo il gruppo di campi profile-person-details
, lo schema Membri fedeltà ora acquisisce informazioni demografiche per i membri del programma fedeltà come il nome, il cognome e il compleanno.
curl -X PATCH \
https://platform.adobe.io/data/foundation/schemaregistry/tenant/schemas/_{TENANT_ID}.schemas.533ca5da28087c44344810891b0f03d9 \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'Content-Type: application/json' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}' \
-d '[
{ "op": "add", "path": "/allOf/-", "value": {"$ref": "https://ns.adobe.com/xdm/context/profile-person-details"}}
]'
Risposta
La risposta mostra il gruppo di campi appena aggiunto nell'array meta:extends
e contiene $ref
per il gruppo di campi nell'attributo allOf
.
{
"$id": "https://ns.adobe.com/{TENANT_ID}/schemas/ee56b80adc7e03b8214e135a28538fe83c7f85bf87f565b3",
"meta:altId": "_{TENANT_ID}.schemas.ee56b80adc7e03b8214e135a28538fe83c7f85bf87f565b3",
"meta:resourceType": "schemas",
"version": "1.1",
"title": "Loyalty Members",
"type": "object",
"description": "Information for all members of the loyalty program",
"allOf": [
{
"$ref": "https://ns.adobe.com/xdm/context/profile",
"type": "object",
"meta:xdmType": "object"
},
{
"$ref": "https://ns.adobe.com/xdm/context/profile-person-details",
"type": "object",
"meta:xdmType": "object"
}
],
"refs": [
"https://ns.adobe.com/xdm/context/profile-person-details",
"https://ns.adobe.com/xdm/context/profile"
],
"imsOrg": "{ORG_ID}",
"meta:extensible": false,
"meta:abstract": false,
"meta:extends": [
"https://ns.adobe.com/xdm/context/profile-person-details",
"https://ns.adobe.com/xdm/common/auditable",
"https://ns.adobe.com/xdm/data/record",
"https://ns.adobe.com/xdm/context/profile"
],
"meta:xdmType": "object",
"meta:registryMetadata": {
"repo:createdDate": 1673310304048,
"repo:lastModifiedDate": 1673310912096,
"xdm:createdClientId": "{CLIENT_ID}",
"xdm:lastModifiedClientId": "{CLIENT_ID}",
"xdm:createdUserId": "{USER_ID}",
"xdm:lastModifiedUserId": "{USER_ID}",
"eTag": "b480f28a35f356b237fc129e796074a3f33a7a67df273f6a8beaee1ec6465540",
"meta:globalLibVersion": "1.38.2"
},
"meta:class": "https://ns.adobe.com/xdm/context/profile",
"meta:containerId": "tenant",
"meta:sandboxId": "28e74200-e3de-11e9-8f5d-7f27416c5f0d",
"meta:sandboxType": "production",
"meta:tenantNamespace": "_{TENANT_ID}",
"meta:descriptorStatus": {
"result": []
}
}
Aggiungi altri gruppi di campi
Gli schemi Membri fedeltà richiedono altri due gruppi di campi standard, che è possibile aggiungere ripetendo i passaggi utilizzando un altro gruppo di campi.
$id
:code language-http |
---|
|
Formato API
PATCH /tenant/schemas/{SCHEMA_ID}
{SCHEMA_ID}
meta:altId
o $id
con codifica URL dello schema che si sta aggiornando.Richiesta
Questa richiesta aggiorna lo schema Membri fedeltà per includere i campi all’interno dei seguenti gruppi di campi standard:
- Dettagli contatto personale (
profile-personal-details
): aggiunge informazioni di contatto quali indirizzo dell'abitazione, indirizzo di posta elettronica e telefono dell'abitazione. - Dettagli fedeltà (
profile-loyalty-details
): aggiunge informazioni di contatto quali indirizzo dell'abitazione, indirizzo e-mail e telefono dell'abitazione.
curl -X PATCH \
https://platform.adobe.io/data/foundation/schemaregistry/tenant/schemas/_{TENANT_ID}.schemas.533ca5da28087c44344810891b0f03d9 \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'Content-Type: application/json' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}' \
-d '[
{ "op": "add", "path": "/allOf/-", "value": {"$ref": "https://ns.adobe.com/xdm/context/profile-personal-details"}},
{ "op": "add", "path": "/allOf/-", "value": {"$ref": "https://ns.adobe.com/xdm/mixins/profile/profile-loyalty-details"}}
]'
Risposta
La risposta mostra i nuovi gruppi di campi aggiunti nell'array meta:extends
e contiene $ref
per il gruppo di campi nell'attributo allOf
.
Lo schema Membri fedeltà ora deve contenere quattro valori $ref
nell'array allOf
: profile
, profile-person-details
, profile-personal-details
e profile-loyalty-details
come mostrato di seguito.
{
"$id": "https://ns.adobe.com/{TENANT_ID}/schemas/ee56b80adc7e03b8214e135a28538fe83c7f85bf87f565b3",
"meta:altId": "_{TENANT_ID}.schemas.ee56b80adc7e03b8214e135a28538fe83c7f85bf87f565b3",
"meta:resourceType": "schemas",
"version": "1.2",
"title": "Loyalty Members",
"type": "object",
"description": "Information for all members of the loyalty program",
"allOf": [
{
"$ref": "https://ns.adobe.com/xdm/context/profile",
"type": "object",
"meta:xdmType": "object"
},
{
"$ref": "https://ns.adobe.com/xdm/context/profile-person-details",
"type": "object",
"meta:xdmType": "object"
},
{
"$ref": "https://ns.adobe.com/xdm/context/profile-personal-details",
"type": "object",
"meta:xdmType": "object"
},
{
"$ref": "https://ns.adobe.com/xdm/mixins/profile/profile-loyalty-details",
"type": "object",
"meta:xdmType": "object"
}
],
"refs": [
"https://ns.adobe.com/xdm/context/profile-person-details",
"https://ns.adobe.com/xdm/mixins/profile/profile-loyalty-details",
"https://ns.adobe.com/xdm/context/profile-personal-details",
"https://ns.adobe.com/xdm/context/profile"
],
"imsOrg": "{ORG_ID}",
"meta:extensible": false,
"meta:abstract": false,
"meta:extends": [
"https://ns.adobe.com/xdm/context/profile-person-details",
"https://ns.adobe.com/xdm/mixins/profile/profile-loyalty-details",
"https://ns.adobe.com/xdm/context/profile-personal-details",
"https://ns.adobe.com/xdm/common/auditable",
"https://ns.adobe.com/xdm/data/record",
"https://ns.adobe.com/xdm/context/profile"
],
"meta:xdmType": "object",
"meta:registryMetadata": {
"repo:createdDate": 1673310304048,
"repo:lastModifiedDate": 1673311559934,
"xdm:createdClientId": "{CLIENT_ID}",
"xdm:lastModifiedClientId": "{CLIENT_ID}",
"xdm:createdUserId": "{USER_ID}",
"xdm:lastModifiedUserId": "{USER_ID}",
"eTag": "1de5ed1a07e3478719952f0a8c94d5e5390d5a9a998761adb4cf1989137fd6ea",
"meta:globalLibVersion": "1.38.2"
},
"meta:class": "https://ns.adobe.com/xdm/context/profile",
"meta:containerId": "tenant",
"meta:sandboxId": "28e74200-e3de-11e9-8f5d-7f27416c5f0d",
"meta:sandboxType": "production",
"meta:tenantNamespace": "_{TENANT_ID}",
"meta:descriptorStatus": {
"result": []
}
}
Definisci un nuovo gruppo di campi
Anche se il gruppo di campi standard Dettagli fedeltà fornisce utili campi relativi alla fedeltà allo schema, esistono campi fedeltà aggiuntivi non inclusi in alcun gruppo di campi standard.
Per aggiungere questi campi, è possibile definire gruppi di campi personalizzati nel contenitore tenant
. Questi gruppi di campi sono specifici dell’organizzazione e non sono visibili o modificabili da persone esterne all’organizzazione.
Per creare (POST) un nuovo gruppo di campi, la richiesta deve includere un campo meta:intendedToExtend
contenente $id
per le classi base con cui il gruppo di campi è compatibile, insieme alle proprietà che il gruppo di campi includerà.
Tutte le proprietà personalizzate devono essere nidificate in TENANT_ID
per evitare conflitti con altri gruppi di campi o campi.
Formato API
POST /tenant/fieldgroups
Richiesta
Questa richiesta crea un nuovo gruppo di campi con un oggetto loyaltyTier
contenente quattro campi specifici di un particolare programma fedeltà: id
, effectiveDate
, currentThreshold
e nextThreshold
.
curl -X POST\
https://platform.adobe.io/data/foundation/schemaregistry/tenant/fieldgroups\
-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 '{
"type": "object",
"title": "Loyalty Tier",
"meta:intendedToExtend": [
"https://ns.adobe.com/xdm/context/profile"
],
"description": "Captures info about the current loyalty tier of a customer.",
"definitions": {
"loyaltyTier": {
"properties": {
"_{TENANT_ID}": {
"type": "object",
"properties": {
"loyaltyTier": {
"type": "object",
"properties": {
"id": {
"title": "Loyalty Tier Identifier",
"type": "string",
"description": "Loyalty Tier Identifier."
},
"effectiveDate": {
"title": "Effective Date",
"type": "string",
"format": "date-time",
"description": "Date the member joined their current loyalty tier."
},
"currentThreshold": {
"title": "Current Point Threshold",
"type": "integer",
"description": "The minimum number of loyalty points the member must maintain to remain in the current tier."
},
"nextThreshold": {
"title": "Next Point Threshold",
"type": "integer",
"description": "The number of loyalty points the member must accrue to graduate to the next tier."
}
}
}
}
}
}
}
},
"allOf": [
{
"$ref": "#/definitions/loyaltyTier"
}
]
}'
Risposta
In caso di esito positivo, la richiesta restituisce lo stato di risposta HTTP 201 (creato) con un corpo di risposta contenente i dettagli del gruppo di campi appena creato, inclusi $id
, meta:altIt
e version
. Questi valori sono di sola lettura e sono assegnati da Schema Registry.
{
"$id": "https://ns.adobe.com/{TENANT_ID}/mixins/9068fd4ea2abf813f4fd2fc9c8b413ae453ff0efc7636691",
"meta:altId": "_{TENANT_ID}.mixins.9068fd4ea2abf813f4fd2fc9c8b413ae453ff0efc7636691",
"meta:resourceType": "mixins",
"version": "1.0",
"title": "Loyalty Tier",
"type": "object",
"description": "Captures info about the current loyalty tier of a customer.",
"definitions": {
"loyaltyTier": {
"properties": {
"_{TENANT_ID}": {
"type": "object",
"properties": {
"loyaltyTier": {
"type": "object",
"properties": {
"id": {
"title": "Loyalty Tier Identifier",
"type": "string",
"description": "Loyalty Tier Identifier.",
"meta:xdmType": "string"
},
"effectiveDate": {
"title": "Effective Date",
"type": "string",
"format": "date-time",
"description": "Date the member joined their current loyalty tier.",
"meta:xdmType": "date-time"
},
"currentThreshold": {
"title": "Current Point Threshold",
"type": "integer",
"description": "The minimum number of loyalty points the member must maintain to remain in the current tier.",
"meta:xdmType": "int"
},
"nextThreshold": {
"title": "Next Point Threshold",
"type": "integer",
"description": "The number of loyalty points the member must accrue to graduate to the next tier.",
"meta:xdmType": "int"
}
},
"meta:xdmType": "object"
}
},
"meta:xdmType": "object"
}
}
}
},
"allOf": [
{
"$ref": "#/definitions/loyaltyTier",
"type": "object",
"meta:xdmType": "object"
}
],
"refs": [],
"imsOrg": "{ORG_ID}",
"meta:extensible": true,
"meta:abstract": true,
"meta:intendedToExtend": [
"https://ns.adobe.com/xdm/context/profile"
],
"meta:xdmType": "object",
"meta:registryMetadata": {
"repo:createdDate": 1673313004645,
"repo:lastModifiedDate": 1673313004645,
"xdm:createdClientId": "{CLIENT_ID}",
"xdm:lastModifiedClientId": "{CLIENT_ID}",
"xdm:createdUserId": "{USER_ID}",
"xdm:lastModifiedUserId": "{USER_ID}",
"eTag": "98e5d48808f5a4d9655493777389568a2581cfce013351ab9e1595d82f698dd6",
"meta:globalLibVersion": "1.38.2"
},
"meta:containerId": "tenant",
"meta:sandboxId": "28e74200-e3de-11e9-8f5d-7f27416c5f0d",
"meta:sandboxType": "production",
"meta:tenantNamespace": "_{TENANT_ID}"
}
Aggiungi il gruppo di campi personalizzato allo schema
Ora puoi seguire gli stessi passaggi per aggiungere un gruppo di campi standard per aggiungere questo gruppo di campi appena creato allo schema.
Formato API
PATCH /tenant/schemas/{SCHEMA_ID}
{SCHEMA_ID}
meta:altId
o $id
con codifica URL dello schema.Richiesta
Questa richiesta aggiorna (PATCH) lo schema Membri fedeltà per includere i campi nel nuovo gruppo di campi "Livello fedeltà".
curl -X PATCH \
https://platform.adobe.io/data/foundation/schemaregistry/tenant/schemas/_{TENANT_ID}.schemas.533ca5da28087c44344810891b0f03d9 \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'Content-Type: application/json' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}' \
-d '[
{ "op": "add", "path": "/allOf/-", "value": {"$ref": "https://ns.adobe.com/{TENANT_ID}/mixins/9068fd4ea2abf813f4fd2fc9c8b413ae453ff0efc7636691"}}
]'
Risposta
È possibile vedere che il gruppo di campi è stato aggiunto correttamente perché la risposta ora mostra il gruppo di campi appena aggiunto nell'array meta:extends
e contiene $ref
al gruppo di campi nell'attributo allOf
.
{
"$id": "https://ns.adobe.com/{TENANT_ID}/schemas/ee56b80adc7e03b8214e135a28538fe83c7f85bf87f565b3",
"meta:altId": "_{TENANT_ID}.schemas.ee56b80adc7e03b8214e135a28538fe83c7f85bf87f565b3",
"meta:resourceType": "schemas",
"version": "1.3",
"title": "Loyalty Members",
"type": "object",
"description": "Information for all members of the loyalty program",
"allOf": [
{
"$ref": "https://ns.adobe.com/xdm/context/profile",
"type": "object",
"meta:xdmType": "object"
},
{
"$ref": "https://ns.adobe.com/xdm/context/profile-person-details",
"type": "object",
"meta:xdmType": "object"
},
{
"$ref": "https://ns.adobe.com/xdm/context/profile-personal-details",
"type": "object",
"meta:xdmType": "object"
},
{
"$ref": "https://ns.adobe.com/xdm/mixins/profile/profile-loyalty-details",
"type": "object",
"meta:xdmType": "object"
},
{
"$ref": "https://ns.adobe.com/{TENANT_ID}/mixins/9068fd4ea2abf813f4fd2fc9c8b413ae453ff0efc7636691",
"type": "object",
"meta:xdmType": "object"
}
],
"refs": [
"https://ns.adobe.com/xdm/context/profile-person-details",
"https://ns.adobe.com/xdm/mixins/profile/profile-loyalty-details",
"https://ns.adobe.com/xdm/context/profile-personal-details",
"https://ns.adobe.com/xdm/context/profile",
"https://ns.adobe.com/{TENANT_ID}/mixins/9068fd4ea2abf813f4fd2fc9c8b413ae453ff0efc7636691"
],
"imsOrg": "{ORG_ID}",
"meta:extensible": false,
"meta:abstract": false,
"meta:extends": [
"https://ns.adobe.com/xdm/context/profile-person-details",
"https://ns.adobe.com/xdm/mixins/profile/profile-loyalty-details",
"https://ns.adobe.com/xdm/context/profile-personal-details",
"https://ns.adobe.com/xdm/common/auditable",
"https://ns.adobe.com/xdm/data/record",
"https://ns.adobe.com/xdm/context/profile",
"https://ns.adobe.com/{TENANT_ID}/mixins/9068fd4ea2abf813f4fd2fc9c8b413ae453ff0efc7636691"
],
"meta:xdmType": "object",
"meta:registryMetadata": {
"repo:createdDate": 1673310304048,
"repo:lastModifiedDate": 1673313118938,
"xdm:createdClientId": "{CLIENT_ID}",
"xdm:lastModifiedClientId": "{CLIENT_ID}",
"xdm:createdUserId": "{USER_ID}",
"xdm:lastModifiedUserId": "{USER_ID}",
"eTag": "6559b197a04bb3fda5bc80bf383a260cfbe32539d528f0139c5750711eebfba2",
"meta:globalLibVersion": "1.38.2"
},
"meta:class": "https://ns.adobe.com/xdm/context/profile",
"meta:containerId": "tenant",
"meta:sandboxId": "28e74200-e3de-11e9-8f5d-7f27416c5f0d",
"meta:sandboxType": "production",
"meta:tenantNamespace": "_{TENANT_ID}",
"meta:descriptorStatus": {
"result": []
}
}
Visualizza lo schema corrente
Ora puoi eseguire una richiesta di GET per visualizzare lo schema corrente e vedere come i gruppi di campi aggiunti hanno contribuito alla struttura complessiva dello schema.
Formato API
GET /tenant/schemas/{SCHEMA_ID}
{SCHEMA_ID}
meta:altId
o $id
con codifica URL dello schema.Richiesta
curl -X GET \
https://platform.adobe.io/data/foundation/schemaregistry/tenant/schemas/_{TENANT_ID}.schemas.ee56b80adc7e03b8214e135a28538fe83c7f85bf87f565b3 \
-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-full+json; version=1'
Risposta
Utilizzando l'intestazione application/vnd.adobe.xed-full+json; version=1
Accept
, è possibile visualizzare lo schema completo che mostra tutte le proprietà. Queste proprietà sono i campi a cui contribuiscono la classe e i gruppi di campi utilizzati per comporre lo schema. Nell’esempio di risposta seguente, per lo spazio vengono visualizzati solo i campi aggiunti di recente. Puoi visualizzare lo schema completo, comprese tutte le proprietà e i relativi attributi, nell'appendice alla fine del documento.
In "properties"
è possibile visualizzare lo spazio dei nomi _{TENANT_ID}
creato al momento dell'aggiunta del gruppo di campi personalizzato. All'interno di tale spazio dei nomi si trovano l'oggetto loyaltyTier
e i campi definiti al momento della creazione del gruppo di campi.
{
"$id": "https://ns.adobe.com/{TENANT_ID}/mixins/9068fd4ea2abf813f4fd2fc9c8b413ae453ff0efc7636691",
"meta:altId": "_{TENANT_ID}.mixins.9068fd4ea2abf813f4fd2fc9c8b413ae453ff0efc7636691",
"meta:resourceType": "mixins",
"version": "1.0",
"title": "Loyalty Tier",
"type": "object",
"description": "Captures info about the current loyalty tier of a customer.",
"definitions": {
"loyaltyTier": {
"properties": {
"_{TENANT_ID}": {
"type": "object",
"properties": {
"loyaltyTier": {
"type": "object",
"properties": {
"id": {
"title": "Loyalty Tier Identifier",
"type": "string",
"description": "Loyalty Tier Identifier.",
"meta:xdmType": "string"
},
"effectiveDate": {
"title": "Effective Date",
"type": "string",
"format": "date-time",
"description": "Date the member joined their current loyalty tier.",
"meta:xdmType": "date-time"
},
"currentThreshold": {
"title": "Current Point Threshold",
"type": "integer",
"description": "The minimum number of loyalty points the member must maintain to remain in the current tier.",
"meta:xdmType": "int"
},
"nextThreshold": {
"title": "Next Point Threshold",
"type": "integer",
"description": "The number of loyalty points the member must accrue to graduate to the next tier.",
"meta:xdmType": "int"
}
},
"meta:xdmType": "object"
}
},
"meta:xdmType": "object"
}
}
}
},
"allOf": [
{
"$ref": "#/definitions/loyaltyTier",
"type": "object",
"meta:xdmType": "object"
}
],
"refs": [],
"imsOrg": "{ORG_ID}",
"meta:extensible": true,
"meta:abstract": true,
"meta:intendedToExtend": [
"https://ns.adobe.com/xdm/context/profile"
],
"meta:xdmType": "object",
"meta:registryMetadata": {
"repo:createdDate": 1673313004645,
"repo:lastModifiedDate": 1673313004645,
"xdm:createdClientId": "{CLIENT_ID}",
"xdm:lastModifiedClientId": "{CLIENT_ID}",
"xdm:createdUserId": "{USER_ID}",
"xdm:lastModifiedUserId": "{USER_ID}",
"eTag": "98e5d48808f5a4d9655493777389568a2581cfce013351ab9e1595d82f698dd6",
"meta:globalLibVersion": "1.38.2"
},
"meta:containerId": "tenant",
"meta:sandboxId": "28e74200-e3de-11e9-8f5d-7f27416c5f0d",
"meta:sandboxType": "production",
"meta:tenantNamespace": "_{TENANT_ID}"
}
Creare un tipo di dati
Il gruppo di campi Livello fedeltà creato contiene proprietà specifiche che potrebbero essere utili in altri schemi. Ad esempio, i dati potrebbero essere acquisiti come parte di un evento esperienza o utilizzati da uno schema che implementa una classe diversa. In questo caso, ha senso salvare la gerarchia degli oggetti come tipo di dati per facilitare il riutilizzo della definizione altrove.
I tipi di dati consentono di definire una gerarchia di oggetti una volta e di farvi riferimento in un campo in modo analogo a qualsiasi altro tipo scalare.
In altre parole, i tipi di dati consentono l’utilizzo coerente di strutture a più campi, con maggiore flessibilità rispetto ai gruppi di campi, perché possono essere inclusi ovunque in uno schema aggiungendoli come "tipo" di un campo.
Formato API
POST /tenant/datatypes
Richiesta
La definizione di un tipo di dati non richiede campi meta:extends
o meta:intendedToExtend
e non è necessario nidificare i campi nell'ID tenant per evitare conflitti.
curl -X POST \
https://platform.adobe.io/data/foundation/schemaregistry/tenant/datatypes \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'Content-Type: application/json' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}' \
-d '{
"title": "Loyalty Tier",
"type": "object",
"description": "Loyalty Tier data type",
"definitions": {
"loyaltyTier": {
"type": "object",
"properties": {
"id": {
"title": "Loyalty Tier Identifier",
"type": "string",
"description": "Loyalty Tier Identifier."
},
"effectiveDate": {
"title": "Effective Date",
"type": "string",
"format": "date-time",
"description": "Date the member joined their current loyalty tier."
},
"currentThreshold": {
"title": "Current Point Threshold",
"type": "integer",
"description": "The minimum number of loyalty points the member must maintain to remain in the current tier."
},
"nextThreshold": {
"title": "Next Point Threshold",
"type": "integer",
"description": "The number of loyalty points the member must accrue to graduate to the next tier."
}
}
}
},
"allOf": [
{
"$ref": "#/definitions/loyaltyTier"
}
]
}'
Risposta
In caso di esito positivo, la richiesta restituisce lo stato di risposta HTTP 201 (creato) con un corpo di risposta contenente i dettagli del nuovo tipo di dati creato, inclusi $id
, meta:altIt
e version
. Questi valori sono di sola lettura e sono assegnati da Schema Registry.
{
"$id": "https://ns.adobe.com/{TENANT_ID}/datatypes/c069d13ebfaaa5980d988e7694d794b37b1784fe11d754cb",
"meta:altId": "_{TENANT_ID}.datatypes.c069d13ebfaaa5980d988e7694d794b37b1784fe11d754cb",
"meta:resourceType": "datatypes",
"version": "1.0",
"title": "Loyalty Tier",
"type": "object",
"description": "Loyalty Tier data type",
"definitions": {
"loyaltyTier": {
"type": "object",
"properties": {
"id": {
"title": "Loyalty Tier Identifier",
"type": "string",
"description": "Loyalty Tier Identifier.",
"meta:xdmType": "string"
},
"effectiveDate": {
"title": "Effective Date",
"type": "string",
"format": "date-time",
"description": "Date the member joined their current loyalty tier.",
"meta:xdmType": "date-time"
},
"currentThreshold": {
"title": "Current Point Threshold",
"type": "integer",
"description": "The minimum number of loyalty points the member must maintain to remain in the current tier.",
"meta:xdmType": "int"
},
"nextThreshold": {
"title": "Next Point Threshold",
"type": "integer",
"description": "The number of loyalty points the member must accrue to graduate to the next tier.",
"meta:xdmType": "int"
}
},
"meta:xdmType": "object"
}
},
"allOf": [
{
"$ref": "#/definitions/loyaltyTier",
"type": "object",
"meta:xdmType": "object"
}
],
"refs": [],
"imsOrg": "{ORG_ID}",
"meta:extensible": true,
"meta:abstract": true,
"meta:xdmType": "object",
"meta:registryMetadata": {
"repo:createdDate": 1673378256699,
"repo:lastModifiedDate": 1673378256699,
"xdm:createdClientId": "{CLIENT_ID}",
"xdm:lastModifiedClientId": "{CLIENT_ID}",
"xdm:createdUserId": "{USER_ID}",
"xdm:lastModifiedUserId": "{USER_ID}",
"eTag": "8afba84c0c9a68126a7a1389f8523a1112bdf4405badc6dcddbbb4a0e18f5cdb",
"meta:globalLibVersion": "1.38.2"
},
"meta:containerId": "tenant",
"meta:sandboxId": "28e74200-e3de-11e9-8f5d-7f27416c5f0d",
"meta:sandboxType": "production",
"meta:tenantNamespace": "_{TENANT_ID}"
}
È possibile eseguire una richiesta di ricerca (GET) utilizzando l'URI dell'URL codificato $id
per visualizzare direttamente il nuovo tipo di dati. Assicurarsi di includere version
nell'intestazione Accept
per una richiesta di ricerca.
Usa tipo di dati nello schema
Dopo aver creato il tipo di dati Livello fedeltà, è possibile aggiornare (PATCH) il campo loyaltyTier
nel gruppo di campi creato per fare riferimento al tipo di dati anziché ai campi presenti in precedenza.
Formato API
PATCH /tenant/fieldgroups/{FIELD_GROUP_ID}
{FIELD_GROUP_ID}
meta:altId
o URL codificato $id
del gruppo di campi da aggiornare.Richiesta
curl -X PATCH \
https://platform.adobe.io/data/foundation/schemaregistry/tenant/fieldgroups/_{TENANT_ID}.mixins.9068fd4ea2abf813f4fd2fc9c8b413ae453ff0efc7636691 \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'Content-Type: application/json' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}' \
-d '[
{
"op": "replace",
"path": "/definitions/loyaltyTier/properties/_{TENANT_ID}/properties",
"value": {
"loyaltyTier": {
"title": "Loyalty Tier",
"$ref": "https://ns.adobe.com/{TENANT_ID}/datatypes/c069d13ebfaaa5980d988e7694d794b37b1784fe11d754cb",
"description": "Loyalty tier info"
}
}
}
]'
Risposta
La risposta ora include un riferimento ($ref
) al tipo di dati nell'oggetto loyaltyTier
anziché ai campi precedentemente definiti.
{
"$id": "https://ns.adobe.com/{TENANT_ID}/mixins/9068fd4ea2abf813f4fd2fc9c8b413ae453ff0efc7636691",
"meta:altId": "_{TENANT_ID}.mixins.9068fd4ea2abf813f4fd2fc9c8b413ae453ff0efc7636691",
"meta:resourceType": "mixins",
"version": "1.1",
"title": "Loyalty Tier",
"type": "object",
"description": "Captures info about the current loyalty tier of a customer.",
"definitions": {
"loyaltyTier": {
"properties": {
"_{TENANT_ID}": {
"type": "object",
"properties": {
"loyaltyTier": {
"title": "Loyalty Tier",
"$ref": "https://ns.adobe.com/{TENANT_ID}/datatypes/c069d13ebfaaa5980d988e7694d794b37b1784fe11d754cb",
"description": "Loyalty tier info",
"type": "object",
"meta:xdmType": "object"
}
},
"meta:xdmType": "object"
}
}
}
},
"allOf": [
{
"$ref": "#/definitions/loyaltyTier",
"type": "object",
"meta:xdmType": "object"
}
],
"refs": [
"https://ns.adobe.com/{TENANT_ID}/datatypes/c069d13ebfaaa5980d988e7694d794b37b1784fe11d754cb"
],
"imsOrg": "{ORG_ID}",
"meta:extensible": true,
"meta:abstract": true,
"meta:intendedToExtend": [
"https://ns.adobe.com/xdm/context/profile"
],
"meta:xdmType": "object",
"meta:registryMetadata": {
"repo:createdDate": 1673313004645,
"repo:lastModifiedDate": 1673378970276,
"xdm:createdClientId": "{CLIENT_ID}",
"xdm:lastModifiedClientId": "{CLIENT_ID}",
"xdm:createdUserId": "{USER_ID}",
"xdm:lastModifiedUserId": "{USER_ID}",
"eTag": "4df8fa56d00991590364606bb2e219e1ea8f5717a51c0e6ae57ca956830b6a27",
"meta:globalLibVersion": "1.38.2"
},
"meta:containerId": "tenant",
"meta:sandboxId": "28e74200-e3de-11e9-8f5d-7f27416c5f0d",
"meta:sandboxType": "production",
"meta:tenantNamespace": "_{TENANT_ID}",
"meta:descriptorStatus": {
"result": []
}
}
Se si esegue una richiesta di GET per cercare lo schema ora, la proprietà loyaltyTier
mostra il riferimento al tipo di dati in meta:referencedFrom
:
"_{TENANT_ID}": {
"type": "object",
"meta:xdmType": "object",
"properties": {
"loyaltyTier": {
"title": "Loyalty Tier",
"description": "Loyalty tier info",
"type": "object",
"meta:xdmType": "object",
"properties": {
"id": {
"title": "Loyalty Tier Identifier",
"type": "string",
"description": "Loyalty Tier Identifier.",
"meta:xdmType": "string"
},
"effectiveDate": {
"title": "Effective Date",
"type": "string",
"format": "date-time",
"description": "Date the member joined their current loyalty tier.",
"meta:xdmType": "date-time"
},
"currentThreshold": {
"title": "Current Point Threshold",
"type": "integer",
"description": "The minimum number of loyalty points the member must maintain to remain in the current tier.",
"meta:xdmType": "int"
},
"nextThreshold": {
"title": "Next Point Threshold",
"type": "integer",
"description": "The number of loyalty points the member must accrue to graduate to the next tier.",
"meta:xdmType": "int"
}
},
"meta:referencedFrom": "https://ns.adobe.com/{TENANT_ID}/datatypes/c069d13ebfaaa5980d988e7694d794b37b1784fe11d754cb"
}
}
}
Definire un descrittore di identità
Gli schemi vengono utilizzati per acquisire i dati in Experience Platform. Questi dati vengono infine utilizzati in più servizi per creare un’unica vista unificata di un singolo utente. Per facilitare questo processo, i campi chiave possono essere contrassegnati come "Identity" (Identità) e, al momento dell’inserimento dei dati, i dati in tali campi vengono inseriti nel "Grafo di identità" dell’individuo. È quindi possibile accedere ai dati del grafico da Real-Time Customer Profile e da altri servizi Experience Platform per fornire una visualizzazione combinata di ogni singolo cliente.
I campi comunemente contrassegnati come "Identity" includono: indirizzo e-mail, numero di telefono, Experience Cloud ID (ECID), ID CRM o altri campi ID univoci. Prendi in considerazione eventuali identificatori univoci specifici per la tua organizzazione, in quanto possono essere campi di identità validi.
I descrittori di identità segnalano che sourceProperty
di sourceSchema
è un identificatore univoco che deve essere considerato un'identità.
Per ulteriori informazioni sull'utilizzo dei descrittori, vedere la Guida per gli sviluppatori del registro degli schemi.
Formato API
POST /tenant/descriptors
Richiesta
La richiesta seguente definisce un descrittore di identità nel campo personalEmail.address
per lo schema Membri fedeltà. Questo comunica a Experience Platform di utilizzare l'indirizzo e-mail del membro fedeltà come identificatore per unire le informazioni sulla persona. Questa chiamata imposta anche questo campo come identità primaria per lo schema impostando xdm:isPrimary
su true
, che è un requisito per abilitare lo schema per l'utilizzo in Real-Time Customer Profile.
curl -X POST \
https://platform.adobe.io/data/foundation/schemaregistry/tenant/descriptors \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'Content-Type: application/json' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}' \
-d '{
"@type": "xdm:descriptorIdentity",
"xdm:sourceSchema": "https://ns.adobe.com/{TENANT_ID}/schemas/533ca5da28087c44344810891b0f03d9",
"xdm:sourceVersion": 1,
"xdm:sourceProperty": "/_{TENANT_ID}/loyalty/loyaltyId",
"xdm:namespace": "Email",
"xdm:property": "xdm:code",
"xdm:isPrimary": false
}'
Risposta
In caso di esito positivo, la risposta restituisce lo stato HTTP 201 (Creato) con un corpo di risposta contenente i dettagli del descrittore appena creato, incluso @id
. @id
è un campo di sola lettura assegnato da Schema Registry e viene utilizzato per fare riferimento al descrittore nell'API.
{
"@id": "719a4391897c097786efbaa6d4262bb928a1cd88540344c6",
"@type": "xdm:descriptorIdentity",
"xdm:sourceSchema": "https://ns.adobe.com/{TENANT_ID}/schemas/ee56b80adc7e03b8214e135a28538fe83c7f85bf87f565b3",
"xdm:sourceVersion": 1,
"xdm:sourceProperty": "/personalEmail/address",
"imsOrg": "{ORG_ID}",
"version": "1",
"xdm:namespace": "Email",
"xdm:property": "xdm:code",
"xdm:isPrimary": true,
"meta:containerId": "tenant",
"meta:sandboxId": "28e74200-e3de-11e9-8f5d-7f27416c5f0d",
"meta:sandboxType": "production"
}
Abilita schema per l'utilizzo in Real-Time Customer Profile profile
Dopo aver applicato un descrittore di identità primaria allo schema, è possibile abilitare lo schema Membri fedeltà per l'utilizzo da parte di Real-Time Customer Profile aggiungendo un tag union
all'attributo meta:immutableTags
.
Aggiungi un tag union
Per includere uno schema nella visualizzazione unione unita, è necessario aggiungere il tag union
all'attributo meta:immutableTags
dello schema. Questa operazione viene eseguita tramite una richiesta PATCH per aggiornare lo schema e aggiungere un array meta:immutableTags
con un valore di union
.
Formato API
PATCH /tenant/schemas/{SCHEMA_ID}
{SCHEMA_ID}
meta:altId
o $id
con codifica URL dello schema che si sta abilitando per il profilo.Richiesta
curl -X PATCH \
https://platform.adobe.io/data/foundation/schemaregistry/tenant/schemas/_{TENANT_ID}.schemas.533ca5da28087c44344810891b0f03d9 \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'Content-Type: application/json' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}' \
-d '[
{ "op": "add", "path": "/meta:immutableTags", "value": ["union"]}
]'
Risposta
La risposta mostra che l'operazione è stata eseguita correttamente e lo schema contiene ora un attributo di livello principale, meta:immutableTags
, che è un array contenente il valore, "union".
{
"$id": "https://ns.adobe.com/{TENANT_ID}/schemas/ee56b80adc7e03b8214e135a28538fe83c7f85bf87f565b3",
"meta:altId": "_{TENANT_ID}.schemas.ee56b80adc7e03b8214e135a28538fe83c7f85bf87f565b3",
"meta:resourceType": "schemas",
"version": "1.4",
"title": "Loyalty Members",
"type": "object",
"description": "Information for all members of the loyalty program",
"allOf": [
{
"$ref": "https://ns.adobe.com/xdm/context/profile",
"type": "object",
"meta:xdmType": "object"
},
{
"$ref": "https://ns.adobe.com/xdm/context/profile-person-details",
"type": "object",
"meta:xdmType": "object"
},
{
"$ref": "https://ns.adobe.com/xdm/context/profile-personal-details",
"type": "object",
"meta:xdmType": "object"
},
{
"$ref": "https://ns.adobe.com/xdm/mixins/profile/profile-loyalty-details",
"type": "object",
"meta:xdmType": "object"
},
{
"$ref": "https://ns.adobe.com/{TENANT_ID}/mixins/9068fd4ea2abf813f4fd2fc9c8b413ae453ff0efc7636691",
"type": "object",
"meta:xdmType": "object"
}
],
"refs": [
"https://ns.adobe.com/xdm/context/profile-person-details",
"https://ns.adobe.com/xdm/mixins/profile/profile-loyalty-details",
"https://ns.adobe.com/xdm/context/profile-personal-details",
"https://ns.adobe.com/xdm/context/profile",
"https://ns.adobe.com/{TENANT_ID}/mixins/9068fd4ea2abf813f4fd2fc9c8b413ae453ff0efc7636691"
],
"imsOrg": "{ORG_ID}",
"meta:extensible": false,
"meta:abstract": false,
"meta:extends": [
"https://ns.adobe.com/xdm/context/profile-person-details",
"https://ns.adobe.com/xdm/mixins/profile/profile-loyalty-details",
"https://ns.adobe.com/xdm/context/profile-personal-details",
"https://ns.adobe.com/xdm/common/auditable",
"https://ns.adobe.com/xdm/data/record",
"https://ns.adobe.com/xdm/context/profile",
"https://ns.adobe.com/{TENANT_ID}/mixins/9068fd4ea2abf813f4fd2fc9c8b413ae453ff0efc7636691"
],
"meta:xdmType": "object",
"meta:registryMetadata": {
"repo:createdDate": 1673310304048,
"repo:lastModifiedDate": 1673380280074,
"xdm:createdClientId": "{CLIENT_ID}",
"xdm:lastModifiedClientId": "{CLIENT_ID}",
"xdm:createdUserId": "{USER_ID}",
"xdm:lastModifiedUserId": "{USER_ID}",
"eTag": "c590ccc7a293040d85c2b7d93276480ef4b4aa9a4fcd6991f50fbb47f58bced2",
"meta:globalLibVersion": "1.38.2"
},
"meta:class": "https://ns.adobe.com/xdm/context/profile",
"meta:containerId": "tenant",
"meta:sandboxId": "28e74200-e3de-11e9-8f5d-7f27416c5f0d",
"meta:sandboxType": "production",
"meta:tenantNamespace": "_{TENANT_ID}",
"meta:immutableTags": [
"union"
],
"meta:descriptorStatus": {
"result": []
}
}
Elencare schemi in un’unione
Lo schema è stato aggiunto all'unione XDM Individual Profile. Per visualizzare un elenco di tutti gli schemi che fanno parte della stessa unione, puoi eseguire una richiesta di GET utilizzando i parametri di query per filtrare la risposta.
Utilizzando il parametro di query property
, è possibile specificare che vengano restituiti solo gli schemi contenenti un campo meta:immutableTags
con un meta:class
uguale a $id
della classe XDM Individual Profile.
Formato API
GET /tenant/schemas?property=meta:immutableTags==union&property=meta:class=={CLASS_ID}
Richiesta
La richiesta di esempio seguente restituisce tutti gli schemi che fanno parte dell'unione XDM Individual Profile.
curl -X GET \
'https://platform.adobe.io/data/foundation/schemaregistry/tenant/schemas?property=meta:immutableTags==union&property=meta:class==https://ns.adobe.com/xdm/context/profile' \
-H 'Accept: application/vnd.adobe.xed-id+json' \
-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}'
Risposta
La risposta è un elenco filtrato di schemi, contenente solo quelli che soddisfano entrambi i requisiti. Tieni presente che quando utilizzi più parametri di query, viene assunta una relazione AND. Il formato della risposta dell'elenco dipende dall'intestazione Accept
inviata nella richiesta.
{
"results": [
{
"$id": "https://ns.adobe.com/{TENANT_ID}/schemas/d29a200b5deb6cfb55d3b865ef627f33",
"meta:altId": "_{TENANT_ID}.schemas.d29a200b5deb6cfb55d3b865ef627f33",
"version": "1.2",
"title": "Profile Schema"
},
{
"$id": "https://ns.adobe.com/{TENANT_ID}/schemas/5d70026f5522fc60b3c81f6523b83c86",
"meta:altId": "_{TENANT_ID}.schemas.5d70026f5522fc60b3c81f6523b83c86",
"version": "1.3",
"title": "CRM Onboarding"
},
{
"$id": "https://ns.adobe.com/{TENANT_ID}/schemas/653e53eb04341d09453c9b6a5fb43d1b4ca9526ec274856d",
"meta:altId": "_{TENANT_ID}.schemas.653e53eb04341d09453c9b6a5fb43d1b4ca9526ec274856d",
"version": "1.1",
"title": "Profile consents"
},
{
"$id": "https://ns.adobe.com/{TENANT_ID}/schemas/ee56b80adc7e03b8214e135a28538fe83c7f85bf87f565b3",
"meta:altId": "_{TENANT_ID}.schemas.ee56b80adc7e03b8214e135a28538fe83c7f85bf87f565b3",
"version": "1.4",
"title": "Loyalty Members"
}
],
"_page": {
"orderby": "updated",
"next": null,
"count": 4
},
"_links": {
"next": null,
"global_schemas": {
"href": "https://platform.adobe.io/data/foundation/schemaregistry/global/schemas?property=meta:immutableTags==union&property=meta:class==https://ns.adobe.com/xdm/context/profile"
}
}
}
Passaggi successivi
Seguendo questa esercitazione, hai composto correttamente uno schema utilizzando sia gruppi di campi standard che un gruppo di campi definito. Ora puoi utilizzare questo schema per creare un set di dati e acquisire i dati del record in Adobe Experience Platform.
Lo schema Membri fedeltà completo, creato durante questa esercitazione, è disponibile nell’appendice che segue. Osservando lo schema, puoi vedere come i gruppi di campi contribuiscono alla struttura complessiva e quali campi sono disponibili per l’acquisizione dei dati.
Dopo aver creato più di uno schema, puoi definire le relazioni tra di essi tramite l’utilizzo di descrittori di relazione. Per ulteriori informazioni, consulta l'esercitazione per definire una relazione tra due schemi. Per esempi dettagliati su come eseguire tutte le operazioni (GET, POST, PUT, PATCH e DELETE) nel Registro di sistema, fare riferimento alla Guida per gli sviluppatori del Registro di sistema durante l'utilizzo dell'API.
Appendice appendix
Le informazioni seguenti integrano l’esercitazione sull’API.
Completa schema membri fedeltà complete-schema
In questa esercitazione, viene composto uno schema per descrivere i membri di un programma fedeltà per la vendita al dettaglio.
Lo schema implementa la classe XDM Individual Profile e combina più gruppi di campi. Acquisisce informazioni sui membri fedeltà utilizzando i gruppi di campi standard Demographic Details, Dettagli contatto personali e Dettagli fedeltà, nonché tramite un gruppo di campi Livello fedeltà personalizzato definito durante l'esercitazione.
Di seguito è riportato lo schema Membri fedeltà completato in formato JSON:
code language-json |
---|
|