本教學課程涵蓋啟用資料集以用於Real-time Customer Profile和Identity Service的程式,分為下列步驟:
本教學課程需要對管理Profile啟用資料集時涉及的各種Adobe Experience Platform服務有充份的瞭解。 在開始本教學課程之前,請先閱讀相關Platform服務的說明檔案:
以下章節提供您必須知道的其他資訊,才能成功呼叫平台API。
本教學課程提供範例API呼叫,以示範如何設定請求的格式。 這些包括路徑、必要標題和正確格式化的請求負載。 也提供API回應中傳回的範例JSON。 如需範例API呼叫檔案中所用慣例的詳細資訊,請參閱Experience Platform疑難排解指南中如何讀取範例API呼叫一節。
若要呼叫Platform API,您必須先完成驗證教學課程。 完成驗證教學課程後,所有Experience Platform API呼叫中每個所需標題的值都會顯示在下面:
{ACCESS_TOKEN}
{API_KEY}
{IMS_ORG}
所有包含裝載(POST、PUT、PATCH)的請求都需要額外的標題:
Experience Platform中的所有資源都隔離到特定的虛擬沙盒。 對Platform API的所有請求都需要一個標題,該標題指定要進行操作的沙盒的名稱。 如需Platform中沙盒的詳細資訊,請參閱沙盒概述檔案。
{SANDBOX_NAME}
您可以在建立時或在建立資料集後的任何點立即啟用Real-time Customer Profile和Identity Service的資料集。 如果要啟用已建立的資料集,請遵循配置本文檔稍後找到的現有資料集的步驟。 若要建立新資料集,您必須知道啟用即時客戶個人檔案的現有XDM架構的ID。 有關如何查找或建立啟用概要檔案的架構的資訊,請參見有關使用架構註冊表API](…/…/xdm/tutorials/create-schema-api.md)建立架構的[教程。 以下對Catalog API的調用為Profile和Identity Service啟用資料集。
API格式
POST /dataSets
請求
借由在請求主體中的tags
下方加入unifiedProfile
和unifiedIdentity
,資料集將會立即分別啟用Profile和Identity Service。 這些標籤的值必須是包含字串"enabled:true"
的陣列。
curl -X POST \
https://platform.adobe.io/data/foundation/catalog/dataSets \
-H 'Content-Type: application/json' \
-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}' \
-d '{
"fileDescription" : {
"persisted": true,
"containerFormat": "parquet",
"format": "parquet"
},
"fields":[],
"schemaRef" : {
"id": "https://ns.adobe.com/{TENANT_ID}/schemas/31670881463308a46f7d2cb09762715",
"contentType": "application/vnd.adobe.xed-full-notext+json; version=1"
},
"tags" : {
"unifiedProfile": ["enabled:true"],
"unifiedIdentity": ["enabled:true"]
}
}'
屬性 | 說明 |
---|---|
schemaRef.id |
資料集所依據之Profile啟用架構的ID。 |
{TENANT_ID} |
Schema Registry中包含屬於您IMS組織之資源的命名空間。 如需詳細資訊,請參閱Schema Registry開發人員指南的TENANT_ID一節。 |
回應
成功的響應顯示一個包含新建立資料集ID的陣列,其形式為"@/dataSets/{DATASET_ID}"
。 成功建立並啟用資料集後,請繼續上傳資料的步驟。
[
"@/dataSets/5b020a27e7040801dedbf46e"
]
以下步驟介紹如何為Real-time Customer Profile和Identity Service啟用先前建立的資料集。 如果您已建立啟用設定檔的資料集,請繼續擷取資料的步驟。
使用Catalog API,您可以檢查現有資料集,以判斷它是否已啟用以用於Real-time Customer Profile和Identity Service。 下列呼叫會依ID擷取資料集的詳細資料。
API格式
GET /dataSets/{DATASET_ID}
參數 | 說明 |
---|---|
{DATASET_ID} |
您要檢查的資料集ID。 |
請求
curl -X GET \
'https://platform.adobe.io/data/foundation/catalog/dataSets/5b020a27e7040801dedbf46e' \
-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}'
回應
{
"5b020a27e7040801dedbf46e": {
"name": "Commission Program Events DataSet",
"imsOrg": "{IMS_ORG}",
"tags": {
"adobe/pqs/table": [
"unifiedprofileingestiontesteventsdataset"
],
"unifiedProfile": [
"enabled:true"
],
"unifiedIdentity": [
"enabled:true"
]
},
"lastBatchId": "6dcd9128a1c84e6aa5177641165e18e4",
"lastBatchStatus": "success",
"dule": {},
"statsCache": {
"startDate": null,
"endDate": null
},
"namespace": "ACP",
"state": "DRAFT",
"version": "1.0.1",
"created": 1536536917382,
"updated": 1539793978215,
"createdClient": "{CLIENT_CREATED}",
"createdUser": "{CREATED_BY}",
"updatedUser": "{CREATED_BY}",
"viewId": "5b020a27e7040801dedbf46f",
"status": "enabled",
"fileDescription": {
"persisted": true,
"containerFormat": "parquet",
"format": "parquet"
},
"transforms": "@/dataSets/5b020a27e7040801dedbf46e/views/5b020a27e7040801dedbf46f/transforms",
"files": "@/dataSets/5b020a27e7040801dedbf46e/views/5b020a27e7040801dedbf46f/files",
"schema": "@/xdms/context/experienceevent",
"schemaMetadata": {
"primaryKey": [],
"delta": [],
"dule": [],
"gdpr": []
},
"schemaRef": {
"id": "https://ns.adobe.com/xdm/context/experienceevent",
"contentType": "application/vnd.adobe.xed+json"
}
}
}
在tags
屬性下,您可以看到unifiedProfile
和unifiedIdentity
都與值enabled:true
一起存在。 因此,Real-time Customer Profile和Identity Service分別啟用此資料集。
如果Profile或Identity Service未啟用現有資料集,則可以使用資料集ID發出PATCH請求來啟用它。
API格式
PATCH /dataSets/{DATASET_ID}
參數 | 說明 |
---|---|
{DATASET_ID} |
您要更新的資料集ID。 |
請求
curl -X PATCH \
https://platform.adobe.io/data/foundation/catalog/dataSets/5b020a27e7040801dedbf46e \
-H 'Content-Type: application/json' \
-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}' \
-d '{
"tags" : {
"unifiedProfile": ["enabled:true"],
"unifiedIdentity": ["enabled:true"]
}
}'
請求主體包含tags
屬性,其中包含兩個子屬性:"unifiedProfile"
和"unifiedIdentity"
。 這些子屬性的值是包含字串"enabled:true"
的陣列。
響
應成功的PATCH請求返回HTTP狀態200(OK)和包含更新資料集ID的陣列。此ID應與PATCH請求中發送的ID匹配。 "unifiedProfile"
和"unifiedIdentity"
標籤現在已新增,且資料集已啟用供Profile和Identity Services使用。
[
"@/dataSets/5b020a27e7040801dedbf46e"
]
Real-time Customer Profile和Identity Service在將XDM資料收錄到資料集時都會使用XDM資料。 有關如何將資料上傳至資料集的說明,請參閱使用API建立資料集的教學課程。 在規劃要傳送哪些資料至啟用Profile的資料集時,請考慮下列最佳實務:
第一次上傳資料至新資料集,或是作為新ETL或資料來源相關程式的一部分,建議您仔細檢查資料,以確保資料已如預期上傳。 使用Real-time Customer Profile存取API,您可以在批次資料載入資料集時擷取其中的資料。 如果您無法擷取任何預期的實體,您的資料集可能無法啟用Real-time Customer Profile。 確認資料集已啟用後,請確定您的來源資料格式和識別碼支援您的期望。 有關如何使用Real-time Customer Profile API存取Profile資料的詳細說明,請遵循實體端點指南,亦稱為"Profile Access API"。
包含多個身分的每個已收錄資料片段會在您的私人身分圖表中建立連結。 有關身份圖和訪問身份資料的詳細資訊,請從閱讀Identity Service概述開始。