Execute SMQL Query
Method
GET
URL
/v2/query
Parameters
Q
Response Content Type
application/json
Response
The response is a JSON representation of a record or list of records, depending on the query. It has the same format as the endpoints you use to retrieve single records or a list of records. For more information, see Read Records of Specified Object or Read Object Records by UUID.
Parameter
Description
Data Type
Example
q
The SMQL query to execute, which must contain valid SMQL syntax. All features currently supported by SMQL queries are supported, including:
Selective fields
Eager loading
Filtering
Filtering on eager-loaded fields
Sorting
Limit
Offset
String
Retrieve all Showcase records:
/v2/query?q=select+*+from+io_showcase
Error Response Messages
HTTP Status Code
Error Type
Error Message
400
missing_parameter_error
Missing or invalid required parameter
400
smql_query_error
SMQL query error
400
serialization_error
Serialization error
500
server_error
Server error
Access Control
This REST API endpoint respects access control and permissions for each record. Data that users lack permissions to read is not returned. All authenticated users (for example, with the Standard User role) can execute this REST endpoint.
Examples
Retrieve all Showcase records:
GET https://<server>/v2/query?q=select+*+from+io_showcase
Retrieve all Showcase records, load their fields, and eager-load all the fields of the associated record owner:
GET https://<server>/v2/query?q=select+*,io_owner.*+from+io_showcase
Retrieve all Showcase records, load their fields, eager-load all the fields of the associated record owner, and order by creation date in descending order:
GET https://<server>/v2/query?q=select+*,io_owner.*+from+io_showcase+order+by+io_created_on+desc
Retrieve all Showcase records created by the system user:
GET https://<server>/v2/query?q=select+*+from+io_showcase+where+io_created_by.io_username='system'
Count the number of Showcase records:
GET https://<server>/v2/query?q=select+count(*)+from+io_showcase
For more SMQL examples and references, see SMQL Statement Syntax.
For more information:
Was this helpful?