External audiences endpoint
External audiences let you upload profile data from your external sources into ÃÛ¶¹ÊÓÆµ Experience Platform. You can use the /external-audience
endpoint in the Segmentation Service API to ingest an external audience to Experience Platform, view details and update your external audiences, as well as delete your external audiences.
Getting started
/core/ais
, as opposed to /core/ups
.In order to use Experience Platform APIs, you must have completed the . Completing the authentication tutorial provides the values for each of the required headers in Experience Platform API calls, as shown below:
- Authorization:
Bearer {ACCESS_TOKEN}
- x-api-key:
{API_KEY}
- x-gw-ims-org-id:
{ORG_ID}
All resources in Experience Platform are isolated to specific virtual sandboxes. All requests to Experience Platform APIs require a header that specifies the name of the sandbox in which the operation will take place:
- x-sandbox-name:
{SANDBOX_NAME}
Create external audience create-audience
You can create an external audience by making a POST request to the /external-audience/
endpoint.
API format
POST /external-audience/
Request
code language-shell |
---|
|
table 0-row-3 1-row-3 2-row-3 3-row-3 4-row-3 5-row-3 6-row-3 7-row-3 8-row-3 9-row-3 10-row-3 11-row-3 | ||
---|---|---|
Property | Type | Description |
name |
String | The name for the external audience. |
description |
String | An optional description for the external audience. |
customAudienceId |
String | An optional identifier for your external audience. |
fields |
Array of objects |
The list of fields and their data types. When creating the list of fields, you can add the following items:
|
sourceSpec |
Object |
An object that contains the information where the external audience is located. When using this object, you must include the following information:
|
ttlInDays |
Integer | The data expiration for the external audience, in days. This value can be set from 1 to 90. By default, the data expiration is set to 30 days. |
audienceType |
String | The audience type for the external audience. Currently, only people is supported. |
originName |
String | Required The origin of the audience. This states where the audience comes from. For external audiences, you should use CUSTOM_UPLOAD . |
namespace |
String | The namespace for the audience. By default, this value is set to CustomerAudienceUpload . |
labels |
Array of strings | The access control labels that apply to the external audience. More information about the available access control labels can be found in the data usage labels glossary. |
tags |
Array of strings | The tags you want to apply to the external audience. More information about tags can be found in the managing tags guide. |
Response
A successful response returns HTTP status 202 with details of your newly created external audience.
code language-json |
---|
|
table 0-row-3 1-row-3 2-row-3 3-row-3 4-row-3 5-row-3 6-row-3 7-row-3 8-row-3 9-row-3 10-row-3 11-row-3 | ||
---|---|---|
Property | Type | Description |
operationId |
String | The ID of the operation. You can subsequently use this ID to retrieve the status of your audience’s creation. |
operationDetails |
Object | An object that contains the details of the request you submitted to create the external audience. |
name |
String | The name for the external audience. |
description |
String | The description for the external audience. |
fields |
Array of objects | The list of fields and their data types. This array determines what fields you need in your external audience. |
sourceSpec |
Object | An object that contains the information where the external audience is located. |
ttlInDays |
Integer | The data expiration for the external audience, in days. This value can be set from 1 to 90. By default, the data expiration is set to 30 days. |
audienceType |
String | The audience type for the external audience. |
originName |
String | Required The origin of the audience. This states where the audience comes from. |
namespace |
String | The namespace for the audience. |
labels |
Array of strings | The access control labels that apply to the external audience. More information about the available access control labels can be found in the data usage labels glossary. |
Retrieve audience creation status retrieve-status
You can retrieve the status of your external audience submission by making a GET request to the /external-audiences/operations
endpoint and providing the ID of the operation you received from the create external audience response.
API format
GET /external-audiences/operations/{OPERATION_ID}
{OPERATION_ID}
id
value of the operation you want to retrieve.Request
code language-shell |
---|
|
Response
A successful response returns HTTP status 200 with details of the external audience’s task status.
code language-json |
---|
|
table 0-row-3 1-row-3 2-row-3 3-row-3 4-row-3 5-row-3 6-row-3 7-row-3 8-row-3 | ||
---|---|---|
Property | Type | Description |
operationId |
String | The ID of the operation you’re retrieving. |
status |
String | The status of the operation. This can be one of the following values: SUCCESS , FAILED , PROCESSING . |
operationDetails |
Object | An object containing details of the audience. |
audienceId |
String | The ID of the external audience that is being submitted by the operation. |
createdBy |
String | The ID of the user who created the external audience. |
createdAt |
Long epoch timestamp | The timestamp, in seconds, when the request to create the external audience was submitted. |
updatedBy |
String | The ID of the user who last updated the audience. |
updatedAt |
Long epoch timestamp | The timestamp, in seconds, when the audience was last updated. |
Update an external audience update-audience
audienceId
of your external audience. You can get your audienceId
from a successful call to the GET /external-audiences/operations/{OPERATION_ID}
endpoint.You can update fields of your external audience by making a PATCH request to the /external-audience
endpoint and providing the ID Of the audience in the request path.
When using this endpoint, you can update the following fields:
- Audience description
- Field-level access control labels
- Audience-level access control labels
- The audience’s data expiration
Updating the field using this endpoint replaces the content of the field you requested.
API format
PATCH /external-audience/{AUDIENCE_ID}
Request
code language-shell |
---|
|
table 0-row-3 1-row-3 | ||
---|---|---|
Property | Type | Description |
description |
String | The updated description for the external audience. |
Additionally, you can update the following parameters:
table 0-row-3 1-row-3 2-row-3 3-row-3 | ||
---|---|---|
Property | Type | Description |
labels |
Array | An array containing the updated list of access labels for the audience. More information about the available access control labels can be found in the data usage labels glossary. |
fields |
Array of objects | An array containing the fields and their associated labels for the external audience. Only the fields that are listed in the PATCH request will be updated. More information about the available access control labels can be found in the data usage labels glossary. |
ttlInDays |
Integer | The data expiration for the external audience, in days. This value can be set from 1 to 90. |
Response
A successful response returns HTTP status 200 with details of the updated external audience.
code language-json |
---|
|
Start audience ingestion start-audience-ingestion
audienceId
of your external audience. You can get your audienceId
from a successful call to the GET /external-audiences/operations/{OPERATION_ID}
endpoint.You can start an audience ingestion by making a POST request to the following endpoint while providing the audience ID.
API format
POST /external-audience/{AUDIENCE_ID}/runs
Request
The following request triggers an ingestion run for the external audience.
code language-shell |
---|
|
table 0-row-3 1-row-3 2-row-3 | ||
---|---|---|
Property | Type | Description |
dataFilterStartTime |
Epoch timestamp | Required The range specifying the starting time which the flow will run to select which files will be processed. |
dataFilterEndTime |
Epoch timestamp | The range specifying the ending time which the flow will run to select which files will be processed. |
Response
A successful response returns HTTP status 200 with details about the ingestion run.
code language-json |
---|
|
table 0-row-3 1-row-3 2-row-3 3-row-3 4-row-3 5-row-3 6-row-3 7-row-3 8-row-3 | ||
---|---|---|
Property | Type | Description |
audienceName |
String | The name of the audience you’re starting an ingestion run for. |
audienceId |
String | The ID of the audience. |
runId |
String | The ID of the ingestion run you started. |
differentialIngestion |
Boolean | A field that determines if the ingestion is a partial ingestion based off of the difference since the last ingestion or a full audience ingestion. |
dataFilterStartTime |
Epoch timestamp | The range specifying the starting time the flow runs to select which files were processed. |
dataFilterEndTime |
Epoch timestamp | The range specifying the ending time the flow runs to select which files were processed. |
createdAt |
Long epoch timestamp | The timestamp, in seconds, when the request to create the external audience was submitted. |
createdBy |
String | The ID of the user who created the external audience. |
Retrieve specific audience ingestion status retrieve-ingestion-status
audienceId
of your external audience and the runId
of your ingestion run ID. You can get your audienceId
from a successful call to the GET /external-audiences/operations/{OPERATION_ID}
endpoint and your runId
from a previous successful call of the POST /external-audience/{AUDIENCE_ID}/runs
endpoint.You can retrieve the status of an audience ingestion by making a GET request to the following endpoint while providing both the audience and run IDs.
API format
GET /external-audience/{AUDIENCE_ID}/runs/{RUN_ID}
Request
The following request retrieves the ingestion status for the external audience.
code language-shell |
---|
|
Response
A successful response returns HTTP status 200 with details of the external audience ingestion.
code language-json |
---|
|
table 0-row-3 1-row-3 2-row-3 3-row-3 4-row-3 5-row-3 6-row-3 7-row-3 8-row-3 9-row-3 10-row-3 | ||
---|---|---|
Property | Type | Description |
audienceName |
String | The name of the audience. |
audienceId |
String | The ID of the audience. |
runId |
String | The ID of the ingestion run. |
status |
String | The status of the ingestion run. Possible statuses include SUCCESS and FAILED . |
differentialIngestion |
Boolean | A field that determines if the ingestion is a partial ingestion based off of the difference since the last ingestion or a full audience ingestion. |
dataFilterStartTime |
Epoch timestamp | The range specifying the starting time the flow runs to select which files were processed. |
dataFilterEndTime |
Epoch timestamp | The range specifying the ending time the flow runs to select which files were processed. |
createdAt |
Long epoch timestamp | The timestamp, in seconds, when the request to create the external audience was submitted. |
createdBy |
String | The ID of the user who created the external audience. |
details |
Array of objects |
An object containing the details of the ingestion run.
|
List audience ingestion runs list-ingestion-runs
audienceId
of your external audience. You can get your audienceId
from a successful call to the GET /external-audiences/operations/{OPERATION_ID}
endpoint.You can retrieve all the ingestion runs for the selected external audience by making a GET request to the following endpoint while providing the audience ID. Multiple parameters can be included, separated by ampersands (&
).
API format
GET /external-audience/{AUDIENCE_ID}/runs
Request
The following request retrieves all the ingestion runs for the external audience.
code language-shell |
---|
|
Response
A successful response returns HTTP status 200 with a list of ingestion runs for the specified external audience.
code language-json |
---|
|
table 0-row-3 1-row-3 | ||
---|---|---|
Property | Type | Description |
runs |
Object | An object that contains the list of ingestion runs that belongs to the audience. More information about this object can be found in the retrieve ingestion status section. |
Delete an external audience delete-audience
audienceId
of your external audience. You can get your audienceId
from a successful call to the GET /external-audiences/operations/{OPERATION_ID}
endpoint.You can delete an external audience by making a DELETE request to the following endpoint while providing the audience ID.
API format
DELETE /external-audience/{AUDIENCE_ID}
Request
The following request deletes the specified external audience.
code language-shell |
---|
|
Response
A successful response returns HTTP status 204 with an empty response body.
Next steps next-steps
After reading this guide, you now have a better understanding of how to create, manage, and delete your external audiences using the Experience Platform APIs. To learn how to use external audiences with the Experience Platform UI, please read the Audience Portal documentation.
Appendix appendix
The following section lists the available error codes when using the external audiences API.
BAD_REQUEST
BAD_REQUEST
UNAUTHORIZED
UNAUTHORIZED
imsOrgId
is provided.UNAUTHORIZED
NOT_FOUND
DUPLICATE_RESOURCE
UNPROCESSABLE_ENTITY
INTERNAL_SERVER_ERROR
BAD_GATEWAY