Filters and Pagination
Using Benchling's Listing Endpoints
Filters
Operators
Some query params support operators, which allow for more complex filtering logic. Operators should be separated from values by a space (+
in URL encoding). Operators are considered keywords, and any values that match an operator must be escaped with double quotes.
The following operators are supported:
>
, greater than. Precedes a value.>=
, greater than or equal to. Precedes a value.<
, less than. Precedes a value.<=
, less than or equal to. Precedes a value.
Schema Field Filters
Some listing endpoints support the schemaFields
filter. This will filter on the custom schema fields set in the appropriate Benchling schema. This restricts results to only the Benchling objects of the appropriate schema that have these fields in the filter and satisfy the assertion. The supported operators are determined by field type:
For the following field types, the filter does an exact match on the provided value, ignoring case:
- String
- Long Text
For the following field types, value should be specified as the ID of the linked item or dropdown option:
- Entity Link
- Part Link
- Translation Link
- Dropdown
The following field types support <=
and =>
operators:
- Integer
- Float
- Date
Pagination
Endpoints that support pagination use page tokens to paginate. An endpoint that supports pagination will respond with nextToken
:
GET /assay-results
{
"results": [...],
"nextToken": "W3sidmFsdWUiOiAiMjAxNy0wNC0xOFQwMjo1OTowMy41MzMxNzAiLCAiX19iZW5jaGxpbmdUeXBlIjogImRhdGV0aW1lIn0sICIwMTIyNTNiMi1lM2U3LTQ2NzAtYmM0OC1jZTU5NmQ1ZmMwMWEiXQ=="
}
nextToken
will be ""
if there is no next page, and a non-empty string otherwise. Pass this as nextToken
in your next request to pick up where you left off. You can also include pageSize
to control how many results are returned:
GET /assay-results?pageSize=2&nextToken=W3sidmFsdWUiOiAiMjAxNy0wNC0xOFQwMjo1OTowMy41MzMxNzAiLCAiX19iZW5jaGxpbmdUeXBlIjogImRhdGV0aW1lIn0sICIwMTIyNTNiMi1lM2U3LTQ2NzAtYmM0OC1jZTU5NmQ1ZmMwMWEiXQ==
{
"results": [...],
"nextToken": ""
}
Updated over 3 years ago