要将数据摄取到Adobe Experience Platform中,数据的格式和结构必须符合现有的体验数据模型(XDM)架构。 根据特定数据集架构的复杂性,可能很难确定数据集在摄取时所需数据的确切形状。
使用 /sampledata
的端点 Schema Registry API中,您可以为之前创建的任何架构生成一个摄取对象示例。
本指南中使用的端点是 Schema Registry API. 在继续之前,请查看 入门指南 有关相关文档的链接,请参阅本文档中的API调用示例指南,以及有关成功调用任何Experience PlatformAPI所需标头的重要信息。
示例数据端点是远程过程调用(RPC)的一部分,该调用受 Schema Registry. 与 Schema Registry API、RPC端点不需要其他标头,例如 Accept
或 Content-Type
、和不使用 CONTAINER_ID
. 相反,他们必须使用 /rpc
命名空间,如下面API调用中所示。
您可以通过在到端点的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: {ORG_ID}' \
-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"
}