データをAdobe Experience Platformに取り込むには、データの形式と構造が既存のExperience Data Model(XDM)スキーマに準拠している必要があります。 特定のデータセットのスキーマの複雑さに応じて、取り込み時にデータセットが予測するデータの正確な形状を判断するのは困難な場合があります。
Schema Registry APIの/sampledata
エンドポイントを使用して、以前に作成したスキーマのサンプルインジェストオブジェクトを生成できます。
このガイドで使用されるエンドポイントは、Schema Registry APIの一部です。 先に進む前に、はじめにを読んで、関連ドキュメントへのリンク、このドキュメントのサンプルAPI呼び出しを読むためのガイド、Experience PlatformAPIの呼び出しを正常に行うために必要なヘッダーに関する重要な情報を確認してください。
サンプルデータエンドポイントは、Schema Registryでサポートされるリモートプロシージャコール(RPC)の一部です。 Schema Registry APIの他のエンドポイントとは異なり、RPCエンドポイントでは、Accept
やContent-Type
のような追加のヘッダーは必要ありません。また、CONTAINER_ID
を使用しません。 代わりに、以下のAPI呼び出しで示すように、/rpc
名前空間を使用する必要があります。
エンドポイントへのGET要求のパスでスキーマのIDを指定すると、スキーマライブラリ内の任意のスキーマのサンプルデータを取得できます。
API 形式
GET /rpc/sampledata/{SCHEMA_ID}
パラメーター | 説明 |
---|---|
{SCHEMA_ID} |
サンプルデータを生成するスキーマのmeta:altId またはURLエンコードされた$id です。 |
リクエスト
次のリクエストは、忠誠度メンバースキーマのサンプルデータを生成します。
curl -X GET \
https://platform.adobe.io/data/foundation/schemaregistry/rpc/sampledata/_{TENANT_ID}.schemas.533ca5da28087c44344810891b0f03d9 \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {IMS_ORG}' \
-H 'x-sandbox-name: {SANDBOX_NAME}'
応答
成功した応答は、指定したスキーマのサンプルデータオブジェクトを返します。
{
"@id": "/uri-reference",
"_{TENANT_ID}": {
"favoriteHotel": "string",
"loyalty": {
"loyaltyId": "string",
"loyaltyLevel": "string",
"loyaltyPoints": 4862,
"memberSince": "2018-11-12T20:20:39+00:00"
}
},
"repo:createDate": "2004-10-23T12:00:00-06:00",
"repo:modifyDate": "2004-10-23T12:00:00-06:00",
"xdm:createdByBatchID": "/uri-reference",
"xdm:faxPhone": {
"xdm:extension": "string",
"xdm:number": "string",
"xdm:primary": false,
"xdm:status": "active",
"xdm:statusReason": "string",
"xdm:validity": "consistent"
},
"xdm:homeAddress": {
"@id": "/uri-reference",
"repo:createDate": "2004-10-23T12:00:00-06:00",
"repo:modifyDate": "2004-10-23T12:00:00-06:00",
"schema:description": "string",
"schema:elevation": 31148.05,
"schema:latitude": 29.25,
"schema:longitude": -145.42,
"xdm:city": "string",
"xdm:country": "string",
"xdm:countryCode": "US",
"xdm:createdByBatchID": "/uri-reference",
"xdm:dmaID": 1612,
"xdm:label": "string",
"xdm:lastVerifiedDate": "2018-01-12",
"xdm:modifiedByBatchID": "/uri-reference",
"xdm:msaID": 26375,
"xdm:postOfficeBox": "string",
"xdm:postalCode": "string",
"xdm:primary": false,
"xdm:region": "string",
"xdm:repositoryCreatedBy": "string",
"xdm:repositoryLastModifiedBy": "string",
"xdm:state": "string",
"xdm:stateProvince": "US-CA",
"xdm:status": "active",
"xdm:statusReason": "string",
"xdm:street1": "string",
"xdm:street2": "string",
"xdm:street3": "string",
"xdm:street4": "string"
},
"xdm:homePhone": {
"xdm:extension": "string",
"xdm:number": "string",
"xdm:primary": false,
"xdm:status": "active",
"xdm:statusReason": "string",
"xdm:validity": "consistent"
},
"xdm:identityMap": {
"key": [
{
"xdm:authenticatedState": "ambiguous",
"xdm:id": "string",
"xdm:primary": false
}
]
},
"xdm:mobilePhone": {
"xdm:extension": "string",
"xdm:number": "string",
"xdm:primary": false,
"xdm:status": "active",
"xdm:statusReason": "string",
"xdm:validity": "consistent"
},
"xdm:modifiedByBatchID": "/uri-reference",
"xdm:person": {
"xdm:birthDate": "2018-01-12",
"xdm:birthDayAndMonth": "01-23",
"xdm:birthYear": 6427,
"xdm:gender": "not_specified",
"xdm:maritalStatus": "not_specified",
"xdm:name": {
"xdm:courtesyTitle": "string",
"xdm:firstName": "string",
"xdm:fullName": "string",
"xdm:lastName": "string",
"xdm:middleName": "string",
"xdm:suffix": "string"
},
"xdm:nationality": "US",
"xdm:taxId": "string"
},
"xdm:personalEmail": {
"xdm:address": "john.smith@abc.com",
"xdm:label": "string",
"xdm:primary": false,
"xdm:status": "active",
"xdm:statusReason": "string",
"xdm:type": "unknown"
},
"xdm:repositoryCreatedBy": "string",
"xdm:repositoryLastModifiedBy": "string"
}