Create or update an Audience within an Ad Order with advanced targeting and exclusion expressions. Note that the Ad Order ID is a required parameter on the URL.
The /audience/save endpoint will create or update an Audience. If there is no ID for the Audience record, then the operation will create a new record; if the ID is included, then the operation will update the record.
Create
Request
curl -u <user>:<password> -X POST -H "Content-Type: application/json" -d '{"name": "test", "target": "publisher:[\"37\"]","exclude": null}' https://sandbox-api.viant.com/v1/audience/save?adorder_id=15812
Response
{
"messages": [],
"entity": {
"id": 626007,
"name": "test",
"target": "grapeshot.custom:[\"2497\",\"887\"] AND publisher:[\"37\"] ",
"exclude": "dmp.bluekai:[\"24744\",\"34061\"] AND publisher:[\"107\",\"8\"] OR viant.taxonomy:[\"51256\",\"51271\",\"52056\"] ",
"status": "enabled",
"frequencyCap": "null",
"lifetimeFrequencyCap": "0",
"externalAudienceId": null
}
}
Update
Request
curl -u <user>:<password> -X POST -H "Content-Type: application/json" -d '{"id":626007,"name": "test_update", "target": "publisher:[\"37\"]","exclude": null}' https://sandbox-api.viant.com/v1/audience/save?adorder_id=15812
Response
{
"messages": [],
"entity": {
"id": 626007,
"name": "test_update",
"target": "grapeshot.custom:[\"2497\",\"887\"] AND publisher:[\"37\"] ",
"exclude": "dmp.bluekai:[\"24744\",\"34061\"] AND publisher:[\"107\",\"8\"] OR viant.taxonomy:[\"51256\",\"51271\",\"52056\"] ",
"status": "enabled",
"frequencyCap": "null",
"lifetimeFrequencyCap": "0",
"externalAudienceId": null
}
}