API端點: https://platform.adobe.io/data/core/activation/authoring/testing/template/sample
此頁面列出並描述您可以使用執行的所有API作業。 /authoring/testing/template/sample
API端點,以產生 訊息轉換範本 以取得您的目的地。 如需此端點支援的功能的說明,請閱讀 建立範本.
在繼續之前,請檢閱 快速入門手冊 如需成功呼叫API所需的重要資訊,包括如何取得必要的目的地撰寫許可權和必要的標頭。
您可以透過向以下網站發出GET請求來取得範例範本: authoring/testing/template/sample/
端點,並提供您建立範本時依據之目的地設定的目的地ID。
instanceId
對應至目的地組態,建立目的地組態時,使用 /destinations
端點。 請參閱 擷取目的地設定 以取得更多詳細資料。API格式
GET authoring/testing/template/sample/{DESTINATION_ID}
參數 | 說明 |
---|---|
{DESTINATION_ID} |
您要為其產生訊息轉換範本的目的地設定ID。 |
要求
以下請求會產生新的範例範本,由承載中提供的引數設定。
curl --location --request GET 'https://platform.adobe.io/data/core/activation/authoring/testing/template/sample/5114d758-ce71-43ba-b53e-e2a91d67b67f' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'x-api-key: {API_KEY}' \
--header 'Authorization: Bearer {ACCESS_TOKEN}' \
--header 'x-gw-ims-org-id: {ORG_ID}' \
--header 'x-sandbox-name: {SANDBOX_NAME}' \
回應
成功的回應會傳回HTTP狀態200和範本,您可編輯範本以符合預期的資料格式。
如果您提供的目的地ID對應至具有的目的地設定 最大努力彙總 和 maxUsersPerRequest=1
在彙總原則中,要求會傳回類似以下的範例範本:
{#- THIS is an example template for a single profile -#}
{#- A '-' at the beginning or end of a tag removes all whitespace on that side of the tag. -#}
{
"identities": [
{%- for idMapEntry in input.profile.identityMap -%}
{%- set namespace = idMapEntry.key -%}
{%- for identity in idMapEntry.value %}
{
"type": "{{ namespace }}",
"id": "{{ identity.id }}"
}{%- if not loop.last -%},{%- endif -%}
{%- endfor -%}{%- if not loop.last -%},{%- endif -%}
{% endfor %}
],
"AdobeExperiencePlatformSegments": {
"add": [
{%- for segment in input.profile.segmentMembership.ups | added %}
"{{ segment.key }}"{%- if not loop.last -%},{%- endif -%}
{% endfor %}
],
"remove": [
{#- Alternative syntax for filtering audiences by status: -#}
{% for segment in removedSegments(input.profile.segmentMembership.ups) %}
"{{ segment.key }}"{%- if not loop.last -%},{%- endif -%}
{% endfor %}
]
}
}
如果您提供的目的地ID對應至目的地伺服器範本,並附有 可設定的彙總 或 最大努力彙總 替換為 maxUsersPerRequest
大於一個時,請求會傳回類似以下的範例範本:
{#- THIS is an example template for multiple profiles -#}
{#- A '-' at the beginning or end of a tag removes all whitespace on that side of the tag. -#}
{
"profiles": [
{%- for profile in input.profiles %}
{
"identities": [
{%- for idMapEntry in profile.identityMap -%}
{%- set namespace = idMapEntry.key -%}
{%- for identity in idMapEntry.value %}
{
"type": "{{ namespace }}",
"id": "{{ identity.id }}"
}{%- if not loop.last -%},{%- endif -%}
{%- endfor -%}{%- if not loop.last -%},{%- endif -%}
{% endfor %}
],
"AdobeExperiencePlatformSegments": {
"add": [
{%- for segment in profile.segmentMembership.ups | added %}
"{{ segment.key }}"{%- if not loop.last -%},{%- endif -%}
{% endfor %}
],
"remove": [
{#- Alternative syntax for filtering audiences by status: -#}
{% for segment in removedSegments(profile.segmentMembership.ups) %}
"{{ segment.key }}"{%- if not loop.last -%},{%- endif -%}
{% endfor %}
]
}
}{%- if not loop.last -%},{%- endif -%}
{% endfor %}
]
}
Destination SDKAPI端點遵循一般Experience PlatformAPI錯誤訊息原則。 請參閱 API狀態代碼 和 請求標頭錯誤 (在平台疑難排解指南中)。
閱讀本檔案後,您現在知道如何使用 /authoring/testing/template/sample
api端點。 接下來,您可以使用 轉譯器範本API端點 根據範本產生匯出的設定檔,並與目的地的預期資料格式進行比較。