SR
Click to open github profile
Endpoints

customQuery

Learn how to use the customQuery API endpoint.


The customQuery endpoint allows you to query addresses, assets, entries, and users directly via URL parameters. It returns a streamlined JSON response for easy consumption.

To use it, simply send a GET request to: ${PRIMARY_SITE_URL}/v1/api/queryApi/customQuery with some query params. This could look like that /v1/api/queryApi/customQuery?elementType=entries&section=home&one=1.

GET Params

Each element type has its own set of available GET parameters. This ensures precise control over the query and enhances security. Internally, these parameters are filtered to prevent potential exploits.

Special Parameters

Below is a list of special GET parameters that are available in all element types.

ParamsDescriptionPossible Values
allFetch all elements1
elementTypeSpecify the element type to queryaddresses, assets, entries, users
fieldsQuery specific field data by handlestring or array of field handles
oneFetch a single element1
Note

The following parameters are required: elementType and either one or all.

Addresses

Below is a list of all available GET parameters for the addresses element type:

ParamsElement type
addressLine1addresses
addressLine2addresses
addressLine3addresses
fullNameaddresses
idall
limitall
localityaddresses
offsetall
orderByall
organizationaddresses
statusall

Assets

Below is a list of all available GET parameters for the assets element type:

ParamsElement type
filenameassets
idall
kindassets
limitall
offsetall
orderByall
siteassets
siteIdassets
statusall
volumeassets

Entries

Below is a list of all available GET parameters for the entries element type:

ParamsElement type
idall
limitall
offsetall
orderByall
postDateentries
sectionentries
siteentries
siteIdentries
slugentries
statusall
urientries

Users

Below is a list of all available GET parameters for the users element type:

ParamsElement type
authorOfusers
emailusers
fullNameusers
groupusers
groupIdusers
hasPhotousers
idall
limitall
offsetall
orderByall
statusall

Copyright © 2024 Samuel Reichör