API endpoint: platform.adobe.io/data/core/activation/authoring/audience-templates
This page lists and describes all the API operations that you can perform using the /authoring/audience-templates
API endpoint. For a description of when to use this endpoint, read audience metadata management.
Before continuing, please review the getting started guide for important information that you need to know in order to successfully make calls to the API, including how to obtain the required destination authoring permission and required headers.
You can create a new audience template by making a POST request to the /authoring/audience-templates
endpoint.
API format
POST /authoring/audience-templates
Request
The following request creates a new audience metadata template, configured by the parameters provided in the payload. The payload below includes all parameters accepted by the /authoring/audience-templates
endpoint. Note that you do not have to add all parameters on the call and that the template is customizable, according to your API requirements.
curl -X POST https://platform.adobe.io/data/core/activation/authoring/audience-templates \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'Content-Type: application/json' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-sandbox-name: {SANDBOX_NAME}' \
-d '
{
"metadataTemplate":{
"name":"string",
"create":{
"url":"string",
"httpMethod":"string",
"headers":[
{
"header":"string",
"value":"string"
}
],
"requestBody":{
},
"responseFields":[
{
"name":"string",
"value":"string"
}
],
"responseErrorFields":[
{
"name":"string",
"value":"string"
}
]
},
"update":{
"url":"string",
"httpMethod":"string",
"headers":[
{
"header":"string",
"value":"string"
}
],
"requestBody":{
},
"responseFields":[
{
"name":"string",
"value":"string"
}
],
"responseErrorFields":[
{
"name":"string",
"value":"string"
}
]
},
"delete":{
"url":"string",
"httpMethod":"string",
"headers":[
{
"header":"string",
"value":"string"
}
],
"requestBody":{
},
"responseFields":[
{
"name":"string",
"value":"string"
}
],
"responseErrorFields":[
{
"name":"string",
"value":"string"
}
]
},
"validate":{
"url":"string",
"httpMethod":"string",
"headers":[
{
"header":"string",
"value":"string"
}
],
"requestBody":{
},
"responseFields":[
{
"name":"string",
"value":"string"
}
],
"responseErrorFields":[
{
"name":"string",
"value":"string"
}
]
},
"notify":{
"url":"string",
"httpMethod":"string",
"headers":[
{
"header":"string",
"value":"string"
}
],
"requestBody":{
},
"responseFields":[
{
"name":"string",
"value":"string"
}
],
"responseErrorFields":[
{
"name":"string",
"value":"string"
}
]
}
},
"validations":[
{
"field":"string",
"regex":"string"
}
]
}'
Property | Type | Description |
---|---|---|
name |
String | The name of the audience metadata template for your destination. This name will appear in any partner-specific error message in the Experience Platform user interface, followed by the error message parsed from metadataTemplate.create.errorSchemaMap . |
url |
String | The URL and endpoint of your API, which is used for creating, updating, deleting, or validating audiences/segments in your platform. Two industry examples are: https://adsapi.snapchat.com/v1/adaccounts/{{customerData.accountId}}/segments and https://api.linkedin.com/v2/dmpSegments/{{segment.alias}} . |
httpMethod |
String | The method used on your endpoint to programmatically create, update, delete, or validate the segment/audience in your destination. For example: POST , PUT , DELETE |
headers.header |
String | Specifies any HTTP headers that should be added to the call to your API. For example, "Content-Type" |
headers.value |
String | Specifies the value of HTTP headers that should be added to the call to your API. For example, "application/x-www-form-urlencoded" |
requestBody |
String | Specifies the content of the message body that should be sent to your API. The parameters that should be added to the requestBody object depend on which fields your API accepts. For an example, refer to the first template example in the Audience metadata functionality document. |
responseFields.name |
String | Specify any response fields that your API returns when called. For an example, refer to the template examples in the Audience metadata functionality document. |
responseFields.value |
String | Specify the value of any response fields that your API returns when called. |
responseErrorFields.name |
String | Specify any response fields that your API returns when called. For an example, refer to the template examples in the Audience metadata functionality document. |
responseErrorFields.value |
String | Parses any error messages returned on API call responses from your destination. These error messages will be surfaced to users in the Experience Platform user interface. |
validations.field |
String | Indicates if validations should be run for any fields before API calls are made to your destination. For example, you can use {{validations.accountId}} to validate the user’s account ID. |
validations.regex |
String | Indicates how the field should be structured in order for the validation to pass. |
Response
A successful response returns HTTP status 200 with details of your newly created audience template.
You can update an existing audience template by making a PUT request to the /authoring/audience-templates
endpoint and providing the instance ID of the audience template you want to update. In the body of the call, provide the updated template.
API format
PUT /authoring/audience-templates/{INSTANCE_ID}
Parameter | Description |
---|---|
{INSTANCE_ID} |
The ID of the audience metadata template that you want to update. |
Request
The following request updates an existing audience metadata template, configured by the parameters provided in the payload.
curl -X PUT https://platform.adobe.io/data/core/activation/authoring/audience-templates/bd4ec8f0-e98f-4b6a-8064-dd7adbfffec9 \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-sandbox-name: {SANDBOX_NAME}' \
-H 'x-sandbox-name: {SANDBOX_NAME}' \
-d '
{
"metadataTemplate":{
"create":{
"url":"https://api.moviestar.com/v1.0/{{customerData.accountId}}/customaudiences?fields=name,description,account_id&subtype=CUSTOM&name={{segment.name}}&customer_file_source={{segment.metadata.customer_file_source}}&access_token={{authData.accessToken}}",
"httpMethod":"POST",
"headers":[
{
"value":"application/x-www-form-urlencoded",
"header":"Content-Type"
}
],
"responseFields":[
{
"value":"{{response.id}}",
"name":"externalAudienceId"
}
],
"responseErrorFields":[
{
"value":"{{error.message}}",
"name":"message"
}
]
},
"update":{
"url":"https://api.moviestar.com/v1.0/{{segment.alias}}?field=name,description,account_id&access_token={{authData.accessToken}}&customerAudienceId={{segment.alias}}&&name={{segment.name}}&description={{segment.description}}&customer_file_source={{segment.metadata.customer_file_source}}",
"httpMethod":"POST",
"headers":[
{
"value":"application/x-www-form-urlencoded",
"header":"Content-Type"
}
],
"responseFields":[
{
"value":"{{response.id}}",
"name":"externalAudienceId"
}
],
"responseErrorFields":[
{
"value":"{{error.message}}",
"name":"message"
}
]
},
"delete":{
"url":"https://api.moviestar.com/v1.0/{{segment.alias}}?fields=name,description,account_id&access_token={{authData.accessToken}}&customerAudienceId={{segment.alias}}",
"httpMethod":"DELETE",
"headers":[
{
"value":"application/x-www-form-urlencoded",
"header":"Content-Type"
}
],
"responseErrorFields":[
{
"value":"{{error.message}}",
"name":"message"
}
]
},
"validate":{
"url":"https://api.moviestar.com/v1.0/permissions?access_token={{authData.accessToken}}",
"httpMethod":"GET",
"headers":[
{
"value":"application/x-www-form-urlencoded",
"header":"Content-Type"
}
],
"responseFields":[
{
"value":"{{response.data[0].permission}}",
"name":"Id"
}
],
"responseErrorFields":[
{
"value":"{{error.message}}",
"name":"message"
}
]
}
}
}
You can retrieve a list of all audience templates for your IMS Organization by making a GET request to the /authoring/audience-templates
endpoint.
API format
GET /authoring/audience-templates
Request
The following request will retrieve the list of audience templates that you have access to, based on IMS Organization and sandbox configuration.
curl -X GET https://platform.adobe.io/data/core/activation/authoring/audience-templates \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-sandbox-name: {SANDBOX_NAME}'
Response
The following response returns HTTP status 200 with a list of audience metadata templates that you have access to, based on the IMS Organization ID and sandbox name that you used. One instanceId
corresponds to the template for one destination. The response is truncated for brevity.
{
"items":[
{
"instanceId":"12a3238f-b509-4a40-b8fb-0a5006e7901d",
"createdDate":"2021-07-20T13:30:30.843054Z",
"lastModifiedDate":"2021-07-21T16:33:05.787472Z",
"metadataTemplate":{
"create":{
"url":"https://api.moviestar.com/v2/dmpSegments",
"httpMethod":"POST",
"headers":[
{
"value":"application/json",
"header":"Content-Type"
},
{
"value":"Bearer {{authData.accessToken}}",
"header":"Authorization"
}
],
"requestBody":{
"json":{
"name":"{{segment.name}}",
"type":"USER",
"account":"{{customerData.accountId}}",
"accessPolicy":"PRIVATE",
"destinations":[
{
"destination":"MOVIESTAR"
}
],
"sourcePlatform":"ADOBE"
}
},
"responseFields":[
{
"value":"{{headers.x-moviestar-id}}",
"name":"externalAudienceId"
}
],
"responseErrorFields":[
{
"value":"{{message}}",
"name":"message"
}
]
},
"update":{
"url":"https://api.moviestar.com/v2/dmpSegments/{{segment.alias}}",
"httpMethod":"POST",
"headers":[
{
"value":"application/json",
"header":"Content-Type"
},
{
"value":"Bearer {{authData.accessToken}}",
"header":"Authorization"
}
],
"requestBody":{
"json":{
"patch":{
"$set":{
"name":"{{segment.name}}"
}
}
}
},
"responseErrorFields":[
{
"value":"{{message}}",
"name":"message"
}
]
},
"delete":{
"url":"https://api.moviestar.com/v2/dmpSegments/{{segment.alias}}",
"httpMethod":"DELETE",
"headers":[
{
"value":"application/json",
"header":"Content-Type"
},
{
"value":"Bearer {{authData.accessToken}}",
"header":"Authorization"
}
],
"responseErrorFields":[
{
"value":"{{message}}",
"name":"message"
}
]
},
"name":"Moviestar audience template - Third example"
}
}
]
}
You can retrieve detailed information about a specific audience template by making a GET request to the /authoring/audience-templates
endpoint and providing the instance ID of the audience template you want to retrieve.
API format
GET /authoring/audience-templates/{INSTANCE_ID}
Parameter | Description |
---|---|
{INSTANCE_ID} |
The ID of the audience metadata template you want to retrieve. |
Request
curl -X GET https://platform.adobe.io/data/core/activation/authoring/audience-templates/bd4ec8f0-e98f-4b6a-8064-dd7adbfffec9 \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-sandbox-name: {SANDBOX_NAME}'
Response
A successful response returns HTTP status 200 with detailed information about the specified audience template.
{
"instanceId":"34ab9cc2-2536-44a5-9dc5-b2fea60b3bd6",
"createdDate":"2021-07-26T19:30:52.012490Z",
"lastModifiedDate":"2021-07-27T21:25:42.763478Z",
"metadataTemplate":{
"create":{
"url":"https://api.moviestar.com/v1/adaccounts/{{customerData.accountId}}/segments",
"httpMethod":"POST",
"headers":[
{
"value":"application/json",
"header":"Content-Type"
},
{
"value":"Bearer {{oauth2ServiceAccessToken}}",
"header":"Authorization"
}
],
"requestBody":{
"json":{
"segments":[
{
"name":"{{segment.name}}",
"description":"{{segment.description}}",
"source_type":"FIRST_PARTY",
"ad_account_id":"{{customerData.accountId}}",
"retention_in_days":180
}
]
}
},
"responseFields":[
{
"value":"{{body.segments[0].segment.id}}",
"name":"externalAudienceId"
}
],
"responseErrorFields":[
{
"value":"{{root}}",
"name":"message"
}
]
},
"update":{
"url":"https://adsapi.moviestar.com/v1/adaccounts/{{customerData.accountId}}/segments",
"httpMethod":"PUT",
"headers":[
{
"value":"application/json",
"header":"Content-Type"
},
{
"value":"Bearer {{oauth2ServiceAccessToken}}",
"header":"Authorization"
}
],
"requestBody":{
"json":{
"segments":[
{
"id":"{{segment.alias}}",
"name":"{{segment.name}}",
"description":"{{segment.description}}"
}
]
}
},
"responseFields":[
{
"value":"{{body.segments[0].segment.id}}",
"name":"externalAudienceId"
}
],
"responseErrorFields":[
{
"value":"{{root}}",
"name":"message"
}
]
},
"delete":{
"url":"https://adsapi.moviestar.com/v1/segments/{{segment.alias}}",
"httpMethod":"DELETE",
"headers":[
{
"value":"application/json",
"header":"Content-Type"
},
{
"value":"Bearer {{oauth2ServiceAccessToken}}",
"header":"Authorization"
}
],
"responseErrorFields":[
{
"value":"{{root}}",
"name":"message"
}
]
},
"name":"Moviestar destination audience template - Example 1"
}
}
You can delete the specified audience template by making a DELETE request to the /authoring/audience-templates
endpoint and providing the ID of the audience template you wish to delete in the request path.
API format
DELETE /authoring/audience-templates/{INSTANCE_ID}
Parameter | Description |
---|---|
{INSTANCE_ID} |
The id of the audience template you want to delete. |
Request
curl -X DELETE https://platform.adobe.io/data/core/activation/authoring/audience-templates/bd4ec8f0-e98f-4b6a-8064-dd7adbfffec9 \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-sandbox-name: {SANDBOX_NAME}' \
Response
A successful response returns HTTP status 200 along with an empty HTTP response.
Destination SDK API endpoints follow the general Experience Platform API error message principles. Refer to API status codes and request header errors in the Platform troubleshooting guide.
After reading this document, you now know when to use audience metadata templates and how to configure an audience metadata template using the /authoring/audience-templates
API endpoint. Read how to use Destination SDK to configure your destination to understand where this step fits into the process of configuring your destination.