POST /contacts/v1/addresses/count

Retrieve the number of contacts who meet a set of search criteria.

The JSON request body contains this property.

NameTypeDescription
queryFilterObjectRequired. An object that defines the criteria to search for.

The queryFilter object has the properties described in this table.

NameTypeDescription
hasCriteriaBooleanRequired. Indicates whether the filter specifies search criteria. If the value is false, the response contains a count of all contacts in the account.
rootExpressionSetObjectAn object that contains the filter expressions.

The rootExpressionSet object has the properties described in this table.

NameTypeDescription
expressionsArrayAn array of objects that define the search criteria. This resource supports only one expression.

The object in the expressions array has the properties described in this table.

NameTypeDescription
customerDataDefinitionIDShortAn integer that represents the attribute type to use in the filter. Possible values:
  • 101: ContactKey
  • 102: LastModfiedDate
  • 103: Source
  • 104: Channel
  • 105: Status
  • 106: AudienceID
operatorStringThe condition operator to use in the filter. The only possible value is Equal.
valuesArrayAn array of strings that define the values to filter results by. If the value of CustomerDataDefinitionID is 104, these values are supported
  • MOBILE
  • PUSH
  • LINE
  • EMAIL

A successful request returns a 200 OK result. The response contains the properties in this table.

NameTypeDescription
requestServiceMessageIDStringA unique ID for the request.
responseDateTimeDatetimeThe date and time when the API generated the response.
resultMessagesArrayAn array of objects that contains messages generated while processing the request. The array is typically empty in a successful request.
serviceMessageIDStringA unique ID for the response.
totalCountIntegerThe number of contacts that meet the search criteria.

If an error occurs while processing the request, the response contains an additional property, hasErrors, with a value of true. In this situation, the objects in the resultMessages have the properties listed in this table.

NameTypeDescription
resultClassStringA description of the result. If an error occurs, the value is Error.
resultCodeStringAn error code.
messageStringA message that explains the error that occurred.
resultTypeStringA description of the type of result.

You can use this resource to obtain a count of contacts with or without providing a filter.

To retrieve the number of contacts without specifying a filter, set the value of queryFilter.hasCriteria to false. You can also omit the rootExpressionSet object from the request.

The response contains the total number of contacts in the account.

This request returns the number of contacts who have a Channel attribute of Push. The value of customerDataDefinitionID (104) indicates that the results are filtered by the Channel attribute.

The response indicates the number of contacts that meet the filter criteria.