Mixins エンドポイント (非推奨)
/mixins エンドポイントは廃止され、/fieldgroups エンドポイントに移行されました。/mixinsは引き続きレガシーエンドポイントとして維持されますが、エクスペリエンスアプリケーションのSchema Registry APIの新しい実装には/fieldgroupsを使用することを強くお勧めします。 詳しくは、 フィールドグループエンドポイントガイド を参照してください。Mixinは、個人、郵送先住所、web ブラウザー環境など、特定のコンセプトを表す1つ以上のフィールドを定義する再利用可能なコンポーネントです。 Mixinは、表すデータの動作(レコードまたは時系列)に応じて、互換性のあるクラスを実装するスキーマの一部として含まれることを意図しています。 Schema Registry APIの/mixins エンドポイントを使用すると、エクスペリエンスアプリケーション内のMixinをプログラムで管理できます。
はじめに
このガイドで使用されているエンドポイントは、Schema Registry APIの一部です。 先に進む前に、はじめる前にを参照し、関連ドキュメントへのリンク、このドキュメントのサンプル API 呼び出しを読み取るためのガイドおよび任意の Experience Platform API を正常に呼び出すために必要なヘッダーに関する重要な情報を確認してください。
Mixinのリストの取得 list
globalまたはtenant コンテナの下にあるすべてのMixinを一覧表示するには、それぞれ/global/mixinsまたは/tenant/mixinsにGET リクエストを行います。
API 形式
GET /{CONTAINER_ID}/mixins?{QUERY_PARAMS}
{CONTAINER_ID}globalまたは自社が所有するMixinのtenantからMixinを取得するコンテナ。{QUERY_PARAMS}リクエスト
次のリクエストは、orderby クエリパラメーターを使用して、tenant コンテナからMixinのリストを取得し、title属性でMixinを並べ替えます。
curl -X GET \
https://platform.adobe.io/data/foundation/schemaregistry/tenant/mixins?orderby=title \
-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}'
応答の形式は、リクエストで送信されたAccept ヘッダーによって異なります。 Mixinのリスト作成には、次のAccept ヘッダーを使用できます。
Accept ヘッダーapplication/vnd.adobe.xed-id+jsonapplication/vnd.adobe.xed+json$refとallOfが含まれている各リソースの完全なJSON Mixinを返します。 (上限:300)応答
上記のリクエストではapplication/vnd.adobe.xed-id+json Accept ヘッダーが使用されていたため、応答には、各Mixinのtitle、$id、meta:altIdおよびversion属性のみが含まれています。 他のAccept ヘッダー(application/vnd.adobe.xed+json)を使用すると、各Mixinのすべての属性が返されます。 応答に必要な情報に応じて、適切なAccept ヘッダーを選択します。
{
"results": [
{
"$id": "https://ns.adobe.com/{TENANT_ID}/mixins/6ece98e9842907c78c651f5b249d9f09",
"meta:altId": "_{TENANT_ID}.mixins.6ece98e9842907c78c651f5b249d9f09",
"version": "1.0",
"title": "CRM Data"
},
{
"$id": "https://ns.adobe.com/{TENANT_ID}/mixins/6386ee478a30914964c6e676ad55603c",
"meta:altId": "_{TENANT_ID}.mixins.6386ee478a30914964c6e676ad55603c",
"version": "1.9",
"title": "Loyalty Member Details"
},
{
"$id": "https://ns.adobe.com/{TENANT_ID}/mixins/67626b2830db3d3ea6c8f9d007aa5797",
"meta:altId": "_{TENANT_ID}.mixins.67626b2830db3d3ea6c8f9d007aa5797",
"version": "1.0",
"title": "Restaurant"
},
{
"$id": "https://ns.adobe.com/{TENANT_ID}/mixins/2583b25b613fec704da6ef70cf527688",
"meta:altId": "_{TENANT_ID}.mixins.2583b25b613fec704da6ef70cf527688",
"version": "1.1",
"title": "Retail Customer Preferences"
},
],
"_page": {
"orderby": "title",
"next": null,
"count": 3
},
"_links": {
"next": null,
"global_schemas": {
"href": "https://platform.adobe.io/data/foundation/schemaregistry/global/mixins"
}
}
}
Mixinの検索 lookup
GET リクエストのパスにmixinのIDを含めることで、特定のmixinを検索できます。
API 形式
GET /{CONTAINER_ID}/mixins/{MIXIN_ID}
{CONTAINER_ID}global、または組織が所有するMixinのtenant。{MIXIN_ID}meta:altIdまたはURL エンコードされた$idです。リクエスト
次のリクエストは、パスで指定されたmeta:altId値でmixinを取得します。
curl -X GET \
https://platform.adobe.io/data/foundation/schemaregistry/tenant/mixins/_{TENANT_ID}.mixins.8779fd45d6e4eb074300023a439862bbba359b60d451627a \
-H 'Accept: application/vnd.adobe.xed+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}'
応答の形式は、リクエストで送信されたAccept ヘッダーによって異なります。 すべてのルックアップリクエストでは、versionをAccept ヘッダーに含める必要があります。 次のAccept ヘッダーを使用できます。
Accept ヘッダーapplication/vnd.adobe.xed+json; version=1$ref および allOf で生、タイトルと説明を含むapplication/vnd.adobe.xed-full+json; version=1$ref および allOf を解決、タイトルと説明を含むapplication/vnd.adobe.xed-notext+json; version=1$ref および allOf で生、タイトルや説明なしapplication/vnd.adobe.xed-full-notext+json; version=1$ref および allOf で解決、タイトルや説明なしapplication/vnd.adobe.xed-full-desc+json; version=1$ref および allOf で解決、説明を含む応答
応答が成功すると、Mixinの詳細が返されます。 返されるフィールドは、リクエストで送信されたAccept ヘッダーによって異なります。 様々なAccept ヘッダーを試して、回答を比較し、どのヘッダーがユースケースに最適かを判断します。
{
"$id": "https://ns.adobe.com/{TENANT_ID}/mixins/8779fd45d6e4eb074300023a439862bbba359b60d451627a",
"meta:altId": "_{TENANT_ID}.mixins.8779fd45d6e4eb074300023a439862bbba359b60d451627a",
"meta:resourceType": "mixins",
"version": "1.2",
"title": "Favorite Hotel",
"type": "object",
"description": "",
"definitions": {
"customFields": {
"type": "object",
"properties": {
"_{TENANT_ID}": {
"type": "object",
"properties": {
"favoriteHotel": {
"title": "Favorite Hotel",
"description": "Reference field for hotel schema.",
"type": "string",
"isRequired": false,
"meta:xdmType": "string"
}
},
"meta:xdmType": "object"
}
},
"meta:xdmType": "object"
}
},
"allOf": [
{
"$ref": "#/definitions/customFields",
"type": "object",
"meta:xdmType": "object"
}
],
"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": 1594941263588,
"repo:lastModifiedDate": 1594941538433,
"xdm:createdClientId": "{CLIENT_ID}",
"xdm:lastModifiedClientId": "{CLIENT_ID}",
"xdm:createdUserId": "{USER_ID}",
"xdm:lastModifiedUserId": "{USER_ID}",
"eTag": "5e8a5e508eb2ed344c08cb23ed27cfb60c841bec59a2f7513deda0f7af903021",
"meta:globalLibVersion": "1.15.4"
},
"meta:containerId": "tenant",
"meta:tenantNamespace": "_{TENANT_ID}"
}
Mixin の作成 create
POST リクエストを行うことで、tenant コンテナの下にカスタム Mixinを定義できます。
API 形式
POST /tenant/mixins
リクエスト
新しい mixin を定義する場合は、meta:intendedToExtend 属性を含めて、その mixin と互換性があるクラスの $id をリストする必要があります。 この例では、mixinは、以前に定義したProperty クラスと互換性があります。 クラスやその他のMixinで提供される類似のフィールドとの競合を避けるために、カスタムフィールドを_{TENANT_ID}の下にネストする必要があります(例を参照)。
curl -X POST \
https://platform.adobe.io/data/foundation/schemaregistry/tenant/mixins \
-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":"Property Details",
"description":"Detailed information related to the properties owned and operated by the company.",
"type":"object",
"meta:intendedToExtend":["https://ns.adobe.com/{TENANT_ID}/classes/19e1d8b5098a7a76e2c10a81cbc99590"],
"definitions": {
"property": {
"properties": {
"_{TENANT_ID}": {
"type":"object",
"properties": {
"propertyName": {
"type": "string",
"title": "Property Name",
"description": "Name of the property"
},
"propertyCity": {
"title": "Property City",
"description": "City where the property is located.",
"type": "string"
},
"phoneNumber": {
"title": "Phone Number",
"description": "Primary phone number for the property.",
"type": "string"
},
"propertyType": {
"type": "string",
"title": "Property Type",
"description": "Type and primary use of property.",
"enum": [
"retail",
"yoga",
"fitness"
],
"meta:enum": {
"retail": "Retail Store",
"yoga": "Yoga Studio",
"fitness": "Fitness Center"
}
},
"propertyConstruction": {
"$ref": "https://ns.adobe.com/{TENANT_ID}/datatypes/24c643f618647344606222c494bd0102"
}
}
}
}
}
},
"allOf": [
{
"$ref": "#/definitions/property"
}
]
}'
応答
成功した応答は、HTTP ステータス 201 (Created)と、新しく作成された mixin の詳細($id、meta:altId、version など)を含むペイロードを返します。 これらの値は読み取り専用で、Schema Registryによって割り当てられます。
{
"$id": "https://ns.adobe.com/{TENANT_ID}/mixins/8779fd45d6e4eb074300023a439862bbba359b60d451627a",
"meta:altId": "_{TENANT_ID}.mixins.8779fd45d6e4eb074300023a439862bbba359b60d451627a",
"meta:resourceType": "mixins",
"version": "1.2",
"title": "Property Details",
"type": "object",
"description": "Detailed information related to the properties owned and operated by the company.",
"definitions": {
"property": {
"properties": {
"_{TENANT_ID}": {
"type":"object",
"properties": {
"propertyName": {
"type": "string",
"title": "Property Name",
"description": "Name of the property"
},
"propertyCity": {
"title": "Property City",
"description": "City where the property is located.",
"type": "string"
},
"phoneNumber": {
"title": "Phone Number",
"description": "Primary phone number for the property.",
"type": "string"
},
"propertyType": {
"type": "string",
"title": "Property Type",
"description": "Type and primary use of property.",
"enum": [
"retail",
"yoga",
"fitness"
],
"meta:enum": {
"retail": "Retail Store",
"yoga": "Yoga Studio",
"fitness": "Fitness Center"
}
},
"propertyConstruction": {
"$ref": "https://ns.adobe.com/{TENANT_ID}/datatypes/24c643f618647344606222c494bd0102"
}
}
}
}
}
},
"allOf": [
{
"$ref": "#/definitions/customFields",
"type": "object",
"meta:xdmType": "object"
}
],
"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": 1594941263588,
"repo:lastModifiedDate": 1594941538433,
"xdm:createdClientId": "{CLIENT_ID}",
"xdm:lastModifiedClientId": "{CLIENT_ID}",
"xdm:createdUserId": "{USER_ID}",
"xdm:lastModifiedUserId": "{USER_ID}",
"eTag": "5e8a5e508eb2ed344c08cb23ed27cfb60c841bec59a2f7513deda0f7af903021",
"meta:globalLibVersion": "1.15.4"
},
"meta:containerId": "tenant",
"meta:tenantNamespace": "_{TENANT_ID}"
}
テナントコンテナ内のすべてのmixin🔗を リストにGET リクエストを実行すると、プロパティの詳細mixinが含まれるようになり、URL エンコードされた$id URIを使用して検索(GET)リクエスト を実行し、新しいmixinを直接表示できるようになりました。
Mixinの更新 put
PUT操作を通じてMixin全体を置き換え、基本的にリソースを書き換えることができます。 PUT リクエストを通じてMixinを更新する場合、本文には、POST リクエストで新しいmixinを作成するときに必要なすべてのフィールドを含める必要があります。
API 形式
PUT /tenant/mixins/{MIXIN_ID}
{MIXIN_ID}meta:altIdまたはURL エンコードされた$id。リクエスト
次のリクエストは、既存のMixinを書き換え、新しいpropertyCountry フィールドを追加します。
curl -X PUT \
https://platform.adobe.io/data/foundation/schemaregistry/tenant/mixins/_{TENANT_ID}.mixins.8779fd45d6e4eb074300023a439862bbba359b60d451627a \
-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": "Property Details",
"description": "Detailed information related to the properties owned and operated by the company.",
"type": "object",
"meta:intendedToExtend": ["https://ns.adobe.com/{TENANT_ID}/classes/19e1d8b5098a7a76e2c10a81cbc99590"],
"definitions": {
"property": {
"properties": {
"_{TENANT_ID}": {
"type":"object",
"properties": {
"propertyName": {
"type": "string",
"title": "Property Name",
"description": "Name of the property"
},
"propertyCity": {
"title": "Property City",
"description": "City where the property is located.",
"type": "string"
},
"propertyCountry": {
"title": "Property Country",
"description": "Country where the property is located.",
"type": "string"
},
"phoneNumber": {
"title": "Phone Number",
"description": "Primary phone number for the property.",
"type": "string"
},
"propertyType": {
"type": "string",
"title": "Property Type",
"description": "Type and primary use of property.",
"enum": [
"retail",
"yoga",
"fitness"
],
"meta:enum": {
"retail": "Retail Store",
"yoga": "Yoga Studio",
"fitness": "Fitness Center"
}
},
"propertyConstruction": {
"$ref": "https://ns.adobe.com/{TENANT_ID}/datatypes/24c643f618647344606222c494bd0102"
}
}
}
}
}
},
"allOf": [
{
"$ref": "#/definitions/property"
}
]
}'
応答
応答が成功すると、更新されたMixinの詳細が返されます。
{
"$id": "https://ns.adobe.com/{TENANT_ID}/mixins/8779fd45d6e4eb074300023a439862bbba359b60d451627a",
"meta:altId": "_{TENANT_ID}.mixins.8779fd45d6e4eb074300023a439862bbba359b60d451627a",
"meta:resourceType": "mixins",
"version": "1.2",
"title": "Property Details",
"type": "object",
"description": "Detailed information related to the properties owned and operated by the company.",
"definitions": {
"property": {
"properties": {
"_{TENANT_ID}": {
"type":"object",
"properties": {
"propertyName": {
"type": "string",
"title": "Property Name",
"description": "Name of the property"
},
"propertyCity": {
"title": "Property City",
"description": "City where the property is located.",
"type": "string"
},
"propertyCountry": {
"title": "Property Country",
"description": "Country where the property is located.",
"type": "string"
},
"phoneNumber": {
"title": "Phone Number",
"description": "Primary phone number for the property.",
"type": "string"
},
"propertyType": {
"type": "string",
"title": "Property Type",
"description": "Type and primary use of property.",
"enum": [
"retail",
"yoga",
"fitness"
],
"meta:enum": {
"retail": "Retail Store",
"yoga": "Yoga Studio",
"fitness": "Fitness Center"
}
},
"propertyConstruction": {
"$ref": "https://ns.adobe.com/{TENANT_ID}/datatypes/24c643f618647344606222c494bd0102"
}
}
}
}
}
},
"allOf": [
{
"$ref": "#/definitions/customFields",
"type": "object",
"meta:xdmType": "object"
}
],
"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": 1594941263588,
"repo:lastModifiedDate": 1594941538433,
"xdm:createdClientId": "{CLIENT_ID}",
"xdm:lastModifiedClientId": "{CLIENT_ID}",
"xdm:createdUserId": "{USER_ID}",
"xdm:lastModifiedUserId": "{USER_ID}",
"eTag": "5e8a5e508eb2ed344c08cb23ed27cfb60c841bec59a2f7513deda0f7af903021",
"meta:globalLibVersion": "1.15.4"
},
"meta:containerId": "tenant",
"meta:tenantNamespace": "_{TENANT_ID}"
}
Mixinの一部を更新する patch
PATCH リクエストを使用して、Mixinの一部を更新できます。 Schema Registryは、add、removeおよびreplaceを含むすべての標準JSON パッチ操作をサポートしています。 JSON パッチについて詳しくは、API の基本ガイドを参照してください。
API 形式
PATCH /tenant/mixin/{MIXIN_ID}
{MIXIN_ID}$id URIまたはmeta:altId。リクエスト
以下のリクエスト例は、既存のMixinのdescriptionを更新し、新しいpropertyCity フィールドを追加します。
リクエスト本文は配列の形式を取り、各リストオブジェクトは個々のフィールドに対する特定の変更を表します。 各オブジェクトには、実行する操作(op)、操作を実行するフィールド(path)、その操作(value)に含める情報が含まれます。
curl -X PATCH \
https://platform.adobe.io/data/foundation/schemaregistry/tenant/mixins/_{TENANT_ID}.mixins.8779fd45d6e4eb074300023a439862bbba359b60d451627a \
-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 '[
{
"op": "replace",
"path": "/description",
"value": "Details relating to a property operated by the company."
},
{
"op": "add",
"path": "/definitions/property/properties/_{TENANT_ID}/properties/propertyCity",
"value": {
"title": "Property City",
"description": "City where the property is located.",
"type": "string"
}
}
]'
応答
応答には、両方の操作が正常に実行されたことが示されます。 descriptionが更新され、propertyCountryがdefinitionsの下に追加されました。
{
"$id": "https://ns.adobe.com/{TENANT_ID}/mixins/8779fd45d6e4eb074300023a439862bbba359b60d451627a",
"meta:altId": "_{TENANT_ID}.mixins.8779fd45d6e4eb074300023a439862bbba359b60d451627a",
"meta:resourceType": "mixins",
"version": "1.2",
"title": "Property Details",
"type": "object",
"description": "Details relating to a property operated by the company.",
"definitions": {
"property": {
"properties": {
"_{TENANT_ID}": {
"type":"object",
"properties": {
"propertyName": {
"type": "string",
"title": "Property Name",
"description": "Name of the property"
},
"propertyCity": {
"title": "Property City",
"description": "City where the property is located.",
"type": "string"
},
"propertyCountry": {
"title": "Property Country",
"description": "Country where the property is located.",
"type": "string"
},
"phoneNumber": {
"title": "Phone Number",
"description": "Primary phone number for the property.",
"type": "string"
},
"propertyType": {
"type": "string",
"title": "Property Type",
"description": "Type and primary use of property.",
"enum": [
"retail",
"yoga",
"fitness"
],
"meta:enum": {
"retail": "Retail Store",
"yoga": "Yoga Studio",
"fitness": "Fitness Center"
}
},
"propertyConstruction": {
"$ref": "https://ns.adobe.com/{TENANT_ID}/datatypes/24c643f618647344606222c494bd0102"
}
}
}
}
}
},
"allOf": [
{
"$ref": "#/definitions/customFields",
"type": "object",
"meta:xdmType": "object"
}
],
"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": 1594941263588,
"repo:lastModifiedDate": 1594941538433,
"xdm:createdClientId": "{CLIENT_ID}",
"xdm:lastModifiedClientId": "{CLIENT_ID}",
"xdm:createdUserId": "{USER_ID}",
"xdm:lastModifiedUserId": "{USER_ID}",
"eTag": "5e8a5e508eb2ed344c08cb23ed27cfb60c841bec59a2f7513deda0f7af903021",
"meta:globalLibVersion": "1.15.4"
},
"meta:containerId": "tenant",
"meta:tenantNamespace": "_{TENANT_ID}"
}
Mixinの削除 delete
Schema RegistryからMixinを削除する必要がある場合があります。 これは、パスで指定されたMixin IDを使用してDELETE リクエストを実行することによって実行されます。
API 形式
DELETE /tenant/mixins/{MIXIN_ID}
{MIXIN_ID}$id URIまたはmeta:altId。リクエスト
curl -X DELETE \
https://platform.adobe.io/data/foundation/schemaregistry/tenant/mixins/_{TENANT_ID}.mixins.d5cc04eb8d50190001287e4c869ebe67 \
-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}'
応答
正常な応答の場合は、空白の本文とともに HTTP ステータス 204 (コンテンツなし)が返されます。
Mixinに ルックアップ (GET) リクエスト を試みることで、削除を確認できます。 リクエストにAccept ヘッダーを含める必要がありますが、Mixinがスキーマレジストリから削除されたため、HTTP ステータス 404 (見つかりません)を受け取る必要があります。