API エンドポイント:https://platform.adobe.io/data/core/activation/authoring/testing/template/sample
このページでは、 /authoring/testing/template/sample
API エンドポイント(を生成するため) メッセージ変換テンプレート を設定します。 このエンドポイントでサポートされる機能についての説明は、テンプレートを作成をお読みください。
続ける前に「はじめる前に」を参照し、必要な宛先オーサリング権限および必要なヘッダーの取得方法など、API の呼び出しを正常に行うために必要となる重要な情報を確認してください。
サンプルテンプレートを取得するには、 authoring/testing/template/sample/
エンドポイントを作成し、テンプレートを作成する場所に基づいて宛先設定の宛先 ID を指定します。
instanceId
で、/destinations
エンドポイントを使用して作成された、宛先の設定に対応します。詳しくは、 宛先設定 API リファレンス.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 segments by status: -#}
{% for segment in removedSegments(input.profile.segmentMembership.ups) %}
"{{ segment.key }}"{%- if not loop.last -%},{%- endif -%}
{% endfor %}
]
}
}
指定した宛先 ID が、 設定可能な集計 または ベストエフォート集計 と maxUsersPerRequest
1 より大きい場合、リクエストは次のようなサンプルテンプレートを返します。
{#- 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 segments by status: -#}
{% for segment in removedSegments(profile.segmentMembership.ups) %}
"{{ segment.key }}"{%- if not loop.last -%},{%- endif -%}
{% endfor %}
]
}
}{%- if not loop.last -%},{%- endif -%}
{% endfor %}
]
}
Destination SDK API エンドポイントは、一般的な Experience Platform API エラーメッセージの原則に従います。Platform トラブルシューティングガイドの API ステータスコードおよびリクエストヘッダーエラーを参照してください。
このドキュメントを読んだ後、 /authoring/testing/template/sample
API エンドポイント。 次に、 レンダリングテンプレート API エンドポイント を使用して、テンプレートに基づいて書き出されたプロファイルを生成し、宛先の期待されるデータ形式と比較します。