Template specs for destinations created with Destination SDK
Use the template spec part of the destination server configuration to configure how to format the HTTP requests sent to your destination.
In a template spec you can define how to transform profile attribute fields between the XDM schema and the format that your platform supports.
Template specs are part of the destination server configuration for real-time (streaming) destinations.
To understand where this component fits into an integration created with Destination SDK, see the diagram in the configuration options documentation or see the guide on how to use Destination SDK to configure a streaming destination.
You can configure the template specs for your destination via the /authoring/destination-servers
endpoint. See the following API reference pages for detailed API call examples where you can configure the components shown in this page.
Supported integration types supported-integration-types
Refer to the table below for details on which types of integrations support the functionality described on this page.
Configure a template spec configure-template-spec
Adobe uses a templating language similar to Jinja to transform the fields from the XDM schema into a format supported by your destination.
For more information about the transformation, visit the links below:
See below an example of an HTTP request template, together with descriptions of each individual parameter.
{
"httpTemplate":{
"httpMethod":"POST",
"requestBody":{
"templatingStrategy":"PEBBLE_V1",
"value":"{ \"attributes\": [ {% for ns in [\"external_id\", \"yourdestination_id\"] %} {% if input.profile.identityMap[ns] is not empty and first_namespace_encountered %} , {% endif %} {% set first_namespace_encountered = true %} {% for identity in input.profile.identityMap[ns]%} { \"{{ ns }}\": \"{{ identity.id }}\" {% if input.profile.segmentMembership.ups is not empty %} , \"AEPSegments\": { \"add\": [ {% for segment in input.profile.segmentMembership.ups %} {% if segment.value.status == \"realized\" or segment.value.status == \"existing\" %} {% if added_segment_found %} , {% endif %} {% set added_segment_found = true %} \"{{ destination.segmentAliases[segment.key] }}\" {% endif %} {% endfor %} ], \"remove\": [ {% for segment in input.profile.segmentMembership.ups %} {% if segment.value.status == \"exited\" %} {% if removed_segment_found %} , {% endif %} {% set removed_segment_found = true %} \"{{ destination.segmentAliases[segment.key] }}\" {% endif %} {% endfor %} ] } {% set removed_segment_found = false %} {% set added_segment_found = false %} {% endif %} {% if input.profile.attributes is not empty %} , {% endif %} {% for attribute in input.profile.attributes %} \"{{ attribute.key }}\": {% if attribute.value is empty %} null {% else %} \"{{ attribute.value.value }}\" {% endif %} {% if not loop.last%} , {% endif %} {% endfor %} } {% if not loop.last %} , {% endif %} {% endfor %} {% endfor %} ] }"
},
"contentType":"application/json"
}
}
httpMethod
GET
, PUT
, POST
, DELETE
, PATCH
.templatingStrategy
PEBBLE_V1
.value
For information on how to write the template, read the section on using templating.
For more information about character escaping, refer to the RFC JSON standard, section seven.
For an example of a simple transformation, refer to the profile attributes transformation.
contentType
application/json
.Next steps next-steps
After reading this article, you should have a better understanding of what a template spec is, and how you can configure it.
To learn more about the other destination server components, see the following articles: