Query

Query

Returns information on one or more customers by searching via a SQL query. Results can be paged.

Request

Method
URL
POST

Headers

Name
Required
Type
Description
APIKey
Guid
A valid API key with a scope of Customers | Read

Body

Property
Required
Type
Description
Where
Text
The SQL Boolean expression used to filter the records being queried. If no query is supplied, then nothing will be returned.
Page
Number
The page number of the results to return, as dictated by the number of records per page (PageSize). The default page number is 1.
PageSize
Number
The maximum number of records to return per page. The default value is 50.
{
"Where": "LeadSource = 'Radio' AND UPPER(BillingState) IN ('VA', 'NC', 'SC')",
"Page": 2,
"PageSize": 25
}

Remarks

The “where” property of the object must be an SQL expression and should not actually contain the keyword “WHERE”. The expressions forbid the following:
  • Anything that is not a syntactically correct SQL expression which results in a Boolean.
  • Nested SELECTs.
  • References to tables.
  • References to columns not explicitly allowed by the API method.
  • References to named parameters.
  • Aggregate functions.
  • Scalar functions not explicitly allowed by the API.

Response

Headers

None

Status Code

Code
Description
200 OK
One of more customers were returned.
400 Bad Request
Customers could not be queried. The reason why will be returned.
401 Unauthorized
The API key is missing, invalid, disabled, or does not have the correct scope.

Body

The return body will be an array of Customers objects, like those of the Read endpoint.