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§ion=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.
Params | Description | Possible Values |
---|---|---|
all | Fetch all elements | 1 |
elementType | Specify the element type to query | addresses, assets, entries, users |
fields | Query specific field data by handle | string or array of field handles |
one | Fetch a single element | 1 |
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:
Params | Element type |
---|---|
addressLine1 | addresses |
addressLine2 | addresses |
addressLine3 | addresses |
fullName | addresses |
id | all |
limit | all |
locality | addresses |
offset | all |
orderBy | all |
organization | addresses |
status | all |
Assets
Below is a list of all available GET parameters for the assets
element type:
Params | Element type |
---|---|
filename | assets |
id | all |
kind | assets |
limit | all |
offset | all |
orderBy | all |
site | assets |
siteId | assets |
status | all |
volume | assets |
Entries
Below is a list of all available GET parameters for the entries
element type:
Params | Element type |
---|---|
id | all |
limit | all |
offset | all |
orderBy | all |
postDate | entries |
section | entries |
site | entries |
siteId | entries |
slug | entries |
status | all |
uri | entries |
Users
Below is a list of all available GET parameters for the users
element type:
Params | Element type |
---|---|
authorOf | users |
users | |
fullName | users |
group | users |
groupId | users |
hasPhoto | users |
id | all |
limit | all |
offset | all |
orderBy | all |
status | all |