audienceSizes

post

/ccadmin/v1/audienceSizes

Audience Sizes. Given an ordered list of Audience Rules, retrieve an ordered list of registered shopper counts as if those rules were executed in combination with all previous rules in the order given (i.e. rule 1 count, rule 1 & 2 count, etc...). Note that the ruleSet operator will determine whether the counts increase or decrease: "any" will make the counts increase as more rules are considered and "all" will make the counts decrease. The endpoint also returns the total estimated number of registered shoppers in the system.

Request

Supported Media Types
Body ()
Root Schema : audienceSizes_request
Type: object
Show Source
Example:
{
    "visitorType":"REGISTERED",
    "ruleSet":{
        "rules":[
            {
                "property":"gender",
                "category":"profile",
                "value":"male",
                "operator":"eq"
            },
            {
                "property":"registrationDate",
                "category":"profile",
                "value":{
                    "unit":"months",
                    "start":"now",
                    "interval":-3
                },
                "operator":"lt"
            },
            {
                "property":"age",
                "category":"profile",
                "value":[
                    18,
                    25
                ],
                "operator":"isBetween"
            }
        ],
        "operator":"all"
    },
    "id":"youngMenWhoRegisteredRecently"
}
Nested Schema : ruleSet
Type: object
The rule set for the Audience.
Show Source
Nested Schema : rules
Type: array
The array of rules that make up the rule set.
Show Source
Nested Schema : items
Type: object
Show Source
  • The category of the property, i.e. profile, internalAudience, etc.
  • The operator applied to the rule property.
  • The property to be evaluated.
  • The value used to compare against the property value to determine the rule result. When mapping this field in Integration Cloud Service(ICS), the operators which expect string values alone can be used.
Back to Top

Response

Supported Media Types

200 Response

Following model is returned when operation succeeds.
Body ()
Root Schema : audienceSizes_response
Type: object
Show Source
Nested Schema : ruleShopperCounts
Type: array
An ordered list of registered shopper counts as if given rules were executed in combination with all previous rules in the order given (i.e. rule 1 count, rule 1 & 2 count, etc...). Note that the ruleSet operator will determine whether the counts increase or decrease: "any" will make the counts increase as more rules are considered and "all" will make the counts decrease.
Show Source
Nested Schema : items
Type: object
Show Source
  • An optional developer message about this rule.
  • The error code for this rule, if it was ignored. If this is present, then the message is an error message. If this is not present, then the message is an informational message.
  • Whether or not this rule was ignored.
  • An optional message about this rule. Must be present if the rule was ignored. If there is an error code, then this message is an error message. Otherwise it is just an informational message.
  • A human readable string indicating the ordered list of rules executed. For example, "1" indicates that this would be the count if the first rule was executed, "1,2" indicates that this would be the count if the first two rules were executed, etc.
  • The estimated number of shoppers the Audience would contain after executing the rules specified in the "rules" string.
Example Response (application/json)
{
    "registeredShoppers":1234,
    "ruleShopperCounts":[
        {
            "rules":"1",
            "shoppers":100
        },
        {
            "rules":"1,2",
            "shoppers":75
        },
        {
            "rules":"1,2,3",
            "shoppers":40
        }
    ]
}

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.| |54004|There was an error determining audience sizes.| |54004|An error occurred while querying for the shopper size of rule {0}.| |54004|Validator found a profile property in the rule set, but the validator properties list is null.| |54012|The JSON description of the rule set {0} is invalid.| |54013|The audience rule set is missing a top level operator.| |54014|The top level operator {0} must be either any or all.| |54015|The audience rule set rules array is missing or invalid.| |54016|Audience rule at index {0} is invalid.| |54016|An error occurred while building the shopper size query for rule {0}.| |54018|The rule operator {0} is not supported. Rule operators must be one of the following: eq, ne, isOneOf, isNotOneOf, contains, containsIgnoreCase, startsWith, startsWithIgnoreCase, endsWith, endsWithIgnoreCase, includesAny, includesAll, notIncludesAny.| |54019|The operator {0} for an internalAudience rule must be either includesAny, notIncludesAny or includesAll.| |54020|The value of an enumList rule must be an array.| |54030|The audience rule set is missing or empty.| |54034|The audience rule property service was not initialized.| |54035|The RuleNode at rule {0} must be a RuleTree.| |54035|The rule set has an error.| |54036|Rule {0} has an invalid rule tag. The rule tag must be a json object containing a valid category.| |54036 Rule {0} has an invalid rule tag. ??The rule tag must be a json object containing a valid category.| |54039|The operator for rule {0} cannot be used with the given value for the rule.| |54039|Rule {0} has an invalid value for audience {1}.| |54039|Rule {0} has an invalid audience operator for audience {1}.| |54039|The operator for rule {0} cannot be used with the given value for the rule.| |54042|Rule {0} has an invalid operator. ??The operator for an internalAudience rule must be either includesAny, notIncludesAny or includesAll.| |54042|Rule {0} is not a valid audience rule.| |54042|Rule {0} has an invalid audience: {1}| |54043|Rule {0} has an invalid audience: {1}| |54048|Rule {0} is invalid because it results in a circular audience reference for audience {1}.|
Body ()
Root Schema : errorModel
Type: object
Show Source
Nested Schema : errors
Type: array
An optional list of errors if multiple errors were encountered
Show Source
Nested Schema : items
Type: object
Show Source
Back to Top