的 /authoring/testing/template/render
端點可幫助您直觀地顯示模板化方式 客戶資料欄位 在目標配置中定義。
終結點為客戶資料欄位生成隨機值,並在響應中返回這些值。 這有助於驗證客戶資料欄位的語義結構,如儲存段名稱或資料夾路徑。
在繼續之前,請查看 入門指南 瞭解成功調用API所需的重要資訊,包括如何獲得所需的目標創作權限和所需的標題。
在使用 /template/render
端點,確保滿足以下條件:
您通過Destination SDK建立了一個現有的基於檔案的目標,您可以在 目標目錄。
要成功發出API請求,您需要與要測試的目標實例對應的目標實例ID。 在平台UI中瀏覽與目標的連接時,從URL獲取在API調用中應使用的目標實例ID。
API格式
POST /authoring/testing/template/render/destination
要說明此API終結點的行為,讓我們考慮具有以下客戶資料欄位配置的基於檔案的目標:
"fileBasedS3Destination":{
"bucket":{
"templatingStrategy":"PEBBLE_V1",
"value":"{{customerData.bucket}}"
},
"path":{
"templatingStrategy":"PEBBLE_V1",
"value":"{{customerData.path}}"
}
}
要求
以下請求調用 /authoring/testing/template/render
endpoint ,它返回具有隨機生成的上述兩個客戶資料欄位值的響應。
curl -X POST 'https://platform.adobe.io/data/core/activation/authoring/testing/template/render/destination' \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'Content-Type: application/json' \
-H 'x-gw-ims-org-id: {IMS_ORG}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-sandbox-name: {SANDBOX_NAME}' \
-d '
{
"destinationId": "{DESTINATION_CONFIGURATION_ID}",
"templates": {
"bucket": "{{customerData.bucket}}",
"path": "{{customerData.bucket}}/{{customerData.path}}"
}
}'
參數 | 說明 |
---|---|
destinationId |
的ID 目標配置 你正在測試。 |
templates |
在您的 目標伺服器配置。 |
回應
成功的響應返回 HTTP 200 OK
狀態,並且主體包含模板化欄位的隨機生成值。
此響應可以幫助您驗證客戶資料欄位的正確結構,如儲存段名稱或資料夾路徑。
{
"results": {
"bucket": "hfWpE-bucket",
"path": "hfWpE-bucket/ceC"
}
}
Destination SDKAPI端點遵循常規Experience PlatformAPI錯誤消息原則。 請參閱 API狀態代碼 和 請求標頭錯誤 中。
閱讀此文檔後,您現在知道如何驗證在您的 目標伺服器。