listAudiences
get
/ccadmin/v1/audiences
List Audiences. This operation is used to get the collection of audiences from Oracle Commerce Cloud.
Request
Supported Media Types
- application/json
Query Parameters
- fields
-
Type:
string
This controls which fields are returned in the response body. The default is to include the top-level response fields and the Audience id, displayName, description, and enabled fields.- limit
Type:integer
This is the field to specify the number of records to be fetched per REST call.- offset
Type:integer
This field specifies the offset/starting index from which data to be fetched.- q
Type:string
This field specifies the query used to limit Audiences.- sort
Type:string
This field specifies the sort order of the list to be fetched.- totalResults
Type:boolean
Indicates if the total results should be included in the response.Response
Supported Media Types- application/json
200 ResponseFollowing model is returned when operation succeeds.BodyRoot Schema : listAudiences_response- items
-
Type:
array
itemsAdditional Properties Allowed:The returned list of items. - limit
-
Type:
integer
Maximum number of audiences to be fetched. - offset
-
Type:
integer
The starting index of the returned audiences. - sort
-
Type:
object
sortAdditional Properties Allowed:The sort used for the returned audiences. - totalResults
-
Type:
integer
The total number of audiences that match the supplied filter.
Nested Schema : itemsNested Schema : sortType:object
The sort used for the returned audiences.- order
-
Type:
string
The sort order: either asc or desc. - property
-
Type:
string
The property sorted on.
Nested Schema : itemsType:object
- deleted
-
Type:
boolean
Indicates if this audience is deleted. - description
-
Type:
string
The audience description. - displayName
-
Type:
string
The audience display name. - enabled
-
Type:
boolean
Indicates if this audience is enabled. - id
-
Type:
string
The audience Id. - ruleSet
-
Type:
object
ruleSetAdditional Properties Allowed:The audience rule set. - usage
-
Type:
array
usageAdditional Properties Allowed:The array of audience consumers. - useInReports
-
Type:
boolean
Indicates if this audience will be used in reporting.
Nested Schema : ruleSetType:object
The audience rule set.- operator
-
Type:
string
The operator applied to all of the rules in the rule set. - rules
-
Type:
array
rulesAdditional Properties Allowed:The array of rules that are contained in the rule set.
Nested Schema : usageNested Schema : rulesNested Schema : itemsType:object
- category
-
Type:
string
The category of the property, i.e. the user profile. - operator
-
Type:
string
The operator applied to the rule property. - property
-
Type:
string
The property to be evaluated. - value
-
Type:
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.
Nested Schema : itemsType:object
- assetType
-
Type:
string
The consumer type. I.e. slots, experiments, etc. - assetTypeDisplayName
-
Type:
string
The localized user-friendly label for the consumer type. - count
-
Type:
integer
The number of consumers of this type that this audience has.
Example 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 ResponseThe 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|BodyRoot Schema : errorModelType:object
- devMessage
-
Type:
string
An optional non-localized message containing technical information for developers - errorCode
-
Type:
string
The numerical code identifying the error - errors
-
Type:
array
errorsAdditional Properties Allowed:An optional list of errors if multiple errors were encountered - message
-
Type:
string
The localized message describing the error - moreInfo
-
Type:
string
An optional non-localized message with more information - o:errorPath
-
Type:
string
An optional machine readable description of where the error occurred - status
-
Type:
string
The HTTP status code - type
-
Type:
string
The URI to the HTTP state code definition
Nested Schema : errorsNested Schema : itemsType:object
- devMessage
-
Type:
string
An optional non-localized message containing technical information for developers - errorCode
-
Type:
string
The numerical code identifying the error - message
-
Type:
string
The localized message describing the error - moreInfo
-
Type:
string
An optional non-localized message with more information - o:errorPath
-
Type:
string
An optional machine readable description of where the error occurred - status
-
Type:
string
The HTTP status code
Examples
Sample Response Payload returned by endpoint:
{ "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" } ] }