Sorting and filtering

The lists of the API are sorted and filtered with query parameters. This page explains their syntax; the sorts and the filters of each list, and its default order, are given with the list in the reference.

Sorting

Send the property to sort on in sort, and the order in direction: asc (ascending) or desc (descending). Without sort, the list has its default order. Items with the same value keep a stable order from one page to the next.

Request

curl "https://api.backmyform.com/v1/forms?sort=submissionsCount&direction=desc" \
  -H "Authorization: Bearer $BACKMYFORM_API_KEY"

Filtering

A filter is a query parameter named after the property it filters, with an operator in brackets: property[operator]=value. Without an operator, the filter is an equality (eq).

Request

curl "https://api.backmyform.com/v1/forms?name[like]=contact" \
  -H "Authorization: Bearer $BACKMYFORM_API_KEY"

The operators depend on the type of the property, given with each filter in the reference:

OperatorMeaningTypes
eqEqual to the valueAll
neNot equal to the valueAll
likeContains the value, ignoring the caseText
nlikeDoesn't contain the value, ignoring the caseText
inEqual to one of the values, separated by commasEnumeration
ninEqual to none of the values, separated by commasEnumeration

Combining filters

Several filters must all match. To match any of several filters instead, prefix their names with or::

Request

curl "https://api.backmyform.com/v1/forms?or:name[like]=contact&or:name=Newsletter" \
  -H "Authorization: Bearer $BACKMYFORM_API_KEY"

This request lists the forms whose name contains "contact", or is "Newsletter". A query parameter can be sent only once: combine different operators.

When you read a list page by page with cursors, send the same sort and the same filters with every page.

The sorts and filters of the lists