Most list API requests include several query string parameters that can be used to request certain subsets of data.
Lists of data support pagination via page and size query string parameters. The page query string parameter is the page number that is desired. The size query string parameter is the number of rows to include on the page. The maximum size allowed is 1000 rows. For example, to get page 3 of a customer list where the page size is 50 format the url like this:
/customers?page=3&size=50&sort=CustomerName%2CLastName%2CFirstName
Filters are expressions that resolve to either true or false for any give resource object and can used to select which resources will be included in a list.
| Description | Operator | Comments |
|---|---|---|
| Equal To | == | |
| Not Equal To | != | |
| Less Than | < | |
| Less Than or Equal To | <= | |
| Greater Than | > | |
| Greater Than or Equal To | >= | |
| String Starts With | .StartsWith() | For example, customer names that start with John would be: CustomerName.StartsWith("John") |
| String Doesn't Start With | .NotStartsWith() | For example, customer names that don't start with John would be: CustomerName.NotStartsWith("John") |
| String Ends With | .EndsWith() | For example, customer names that end with Smith would be: CustomerName.EndsWith("Smith") |
| String Doesn't End With | .NotEndsWith() | For example, customer names that don't end with Smith would be: CustomerName.NotEndsWith("Smith") |
| String Contains | .Contains() | For example, customer names that contain Fred would be: CustomerName.Contains("Fred") |
| String Doesn't Contain | .NotContains() | For example, customer names that don't contain Fred would be: CustomerName.NotContains("Fred") |
Strings are enclosed in quotation marks when used as part of a filter. For example, to get a list of customers with a first name of John use a url escaped filter of FirstName == "John" like this:
/customers?page=1&size=1000&sort=CustomerName%2CLastName%2CFirstName&filter=FirstName%20%3D%3D%20%22John%22
When filtering date values format the date and time as DateTime(year,month,day,hour,minute,second). For example, to get a list of payment transactions for August 1, 2015 use a url escaped filter of RequestDateTime >= DateTime(2015,8,1,0,0,0) && RequestDateTime <= DateTime(2015,8,1,23,59,59) like this:
/payment-transactions?page=1&size=25&sort=RequestDateTime&filter=RequestDateTime%20%3E%3D%20DateTime(2015%2C8%2C1%2C0%2C0%2C0)%20%26%26%20RequestDateTime%20%3C%3D%20DateTime(2015%2C8%2C1%2C23%2C59%2C59)
Multiple filter clauses can be combined using && for AND, || for OR, and (parenthesis) for grouping of logic. For example, to filter all payment transactions for August 1, 2015 for Contact Id 475 that are either VISA or MasterCard use a url escaped filter of ContactId == 476 && ( PaymentMethodCardTypeId == "VISA" || PaymentMethodCardTypeId == "MasterCard" ) && RequestDateTime >= DateTime(2015,8,1,0,0,0) && RequestDateTime <= DateTime(2015,8,1,23,59,59) like this:
/payment-transactions?page=1&size=25&sort=RequestDateTime&filter=ContactId%20%3D%3D%20476%20%26%26%20(%20PaymentMethodCardTypeId%20%3D%3D%20%22VISA%22%20%7C%7C%20PaymentMethodCardTypeId%20%3D%3D%20%22MasterCard%22%20)%20%26%26%20RequestDateTime%20%3E%3D%20DateTime(2015%2C8%2C1%2C0%2C0%2C0)%20%26%26%20RequestDateTime%20%3C%3D%20DateTime(2015%2C8%2C1%2C23%2C59%2C59)
The list expand query string parameter is an optional comma delimited list of instructions on any data expansion that is requested. Typical values may include: