listAudiences
get
/ccadmin/v1/audiences
List Audiences. This operation is used to get the collection of Audiences. By default only the displayName, description, id, and enabled properties will be returned for each Audience in the list. The fields parameter can be used to specify other properties to return. For example, to include the ID and Rule Set for each Audience in the list, you can send a GET request to /ccadminui/v1/audiences?fields=items.id,items.ruleSet.
Request
Supported Media Types
- application/json
Query Parameters
-
fields(optional): string
This controls which fields are returned in the response body. For example, to include the ID and Rule Set for each Audience in the list, you can send fields=items.id,items.ruleSet.
-
limit(optional): integer
This is the field to specify the number of records to be fetched per REST call.
-
offset(optional): integer
This field specifies the offset/starting index from which data to be fetched.
-
q(optional): string
This field specifies the query used to limit Audiences.
-
sort(optional): string
This field specifies the sort order of the list to be fetched.
-
totalResults(optional): boolean
Indicates if the total results should be included in the response.
Header Parameters
-
Accept-Language: string
The locale.
Response
Supported Media Types
- application/json
200 Response
Following model is returned when operation succeeds.
Root Schema : listAudiences_response
Type:
Show Source
object
-
items(optional):
array items
The returned list of items.
-
limit(optional):
integer
Maximum number of audiences to be fetched.
-
offset(optional):
integer
The starting index of the returned audiences.
-
sort(optional):
array sort
The sort used for the returned audiences.
-
totalResults(optional):
integer
The total number of audiences that match the supplied filter.
Nested Schema : items
Type:
Show Source
object
-
deleted(optional):
boolean
Indicates if this audience is deleted.
-
description(optional):
string
The audience description.
-
displayName(optional):
string
The audience display name.
-
enabled(optional):
boolean
Indicates if this audience is enabled.
-
id(optional):
string
The audience Id.
-
ruleSet(optional):
object ruleSet
The audience rule set.
-
usage(optional):
array usage
The array of audience consumers.
-
useInReports(optional):
boolean
Indicates if this audience will be used in reporting.
-
visitorType(optional):
string
Indicates the type of visitors the audience allows. visitorType must be one of the following: "ANONYMOUS" (users that have not been authenticated or soft logged in), "RECOGNIZED" (users that logged in before but, have not been authenticated in the current session), "AUTHENTICATED" (logged in users), "ANONYMOUS_OR_RECOGNIZED", "ANONYMOUS_OR_AUTHENTICATED", "REGISTERED", or "ALL". These correspond to various combinations of the options that appear in the UI (ANONYMOUS, RECOGNIZED, and AUTHENTICATED) where "REGISTERED" means the user selected RECOGNIZED and AUTHENTICATED and "ALL" means the user selected all three options.
Nested Schema : ruleSet
Type:
object
The audience rule set.
Show Source
-
operator(optional):
string
The operator applied to all of the rules in the rule set.
-
rules(optional):
array rules
The array of rules that are contained in the rule set.
Nested Schema : rules
Type:
array
The array of rules that are contained in the rule set.
Show Source
Nested Schema : items
Type:
Show Source
object
-
category(optional):
string
The category of the property, i.e. the user profile.
-
operator(optional):
string
The operator applied to the rule property.
-
property(optional):
string
The property to be evaluated.
-
value(optional):
string
The value used to compare against the property value to determine the rule result. Values can be strings, integers, doubles, floats, JSON objects or JSON arrays depending on the operator and how the property was described in the audienceRuleProperty endpoint. When mapping this field in Integration Cloud Service(ICS), the operators which expect string values alone can be used.
Nested Schema : items
Type:
Show Source
object
-
assetType(optional):
string
The consumer type. I.e. slots, experiments, etc.
-
assetTypeDisplayName(optional):
string
The localized user-friendly label for the consumer type.
-
count(optional):
integer
The number of consumers of this type that this audience has.
Nested Schema : items
Type:
Show Source
object
-
order(optional):
string
The sort order: either asc or desc.
-
property(optional):
string
The property sorted on.
Example Response (application/json)
{
"q":"displayName co \"aud\" or description co \"aud\"",
"totalResults":2,
"offset":0,
"limit":40,
"sort":[
{
"property":"displayName",
"order":"asc"
}
],
"items":[
{
"displayName":"Audience 1",
"usage":[
{
"assetTypeDisplayName":"Audiences",
"count":2,
"assetType":"audiences"
},
{
"assetTypeDisplayName":"Experiments",
"count":1,
"assetType":"experiments"
},
{
"assetTypeDisplayName":"Slots",
"count":3,
"assetType":"slots"
}
],
"ruleSet":{
"rules":[
{
"property":"gender",
"category":"profile",
"value":"male",
"operator":"eq"
}
],
"operator":"all"
},
"description":"blah blah blah",
"id":"audience1"
},
{
"displayName":"Audience 2",
"usage":[
{
"assetTypeDisplayName":"Audiences",
"count":2,
"assetType":"audiences"
},
{
"assetTypeDisplayName":"Promotions",
"count":1,
"assetType":"promotions"
},
{
"assetTypeDisplayName":"Slots",
"count":3,
"assetType":"slots"
}
],
"ruleSet":{
"rules":[
{
"property":"shippingAddress.city",
"category":"profile",
"value":"San Francisco",
"operator":"eq"
}
],
"operator":"all"
},
"description":"blah blah blah",
"id":"audience2"
}
]
}
Default Response
The error response.
The following are the internal error codes thrown by this API when the request processing fails in Oracle Commerce Cloud:
|Error Code|Description|
|------------------|------------------|
|54004|An error occurred accessing audiences with query {0}.|
|85003|Invalid attribute in query: {}|
|85000|q query param is not valid SCIM filter format|
Root Schema : errorModel
Type:
Show Source
object
-
devMessage(optional):
string
An optional non-localized message containing technical information for developers
-
errorCode(optional):
string
The numerical code identifying the error
-
errors(optional):
array errors
An optional list of errors if multiple errors were encountered
-
message(optional):
string
The localized message describing the error
-
moreInfo(optional):
string
An optional non-localized message with more information
-
o:errorPath(optional):
string
An optional machine readable description of where the error occurred
-
status(optional):
string
The HTTP status code
-
type(optional):
string
The URI to the HTTP state code definition
Nested Schema : errors
Type:
array
An optional list of errors if multiple errors were encountered
Show Source
Nested Schema : items
Type:
Show Source
object
-
devMessage(optional):
string
An optional non-localized message containing technical information for developers
-
errorCode(optional):
string
The numerical code identifying the error
-
message(optional):
string
The localized message describing the error
-
moreInfo(optional):
string
An optional non-localized message with more information
-
o:errorPath(optional):
string
An optional machine readable description of where the error occurred
-
status(optional):
string
The HTTP status code