Skip to main content

API Query Syntax

Use the Appteum Query Language to search your workspace's data. The syntax is similar to the SELECT statement in the widely used SQL but is designed specifically for Appteum data.

To use the Appteum Query syntax, start with a SELECT statement followed by one or more optional clauses, such as WHERE, ORDER BY, or LIMIT. Here's an example of the basic syntax:

SELECT fieldList [...]
FROM objectType
[WHERE conditionExpression]
[ORDER BY fieldOrderByList {ASC|DESC}]
[LIMIT numberOfRowsToReturn]

<fieldList>

Specifies a list of one or more fields, separated by commas, that you want to retrieve from the specified object. The bold elements in the following examples are fieldlist values:

The fieldList specifies one or more fields, separated by commas, that you want to retrieve from the specified object. The bold elements in the following examples are fieldList values:

  • SELECT Id, Name, Email FROM User
  • SELECT Price, User__r.Name FROM Order
caution

Note that you should use valid field names and make sure to enable read-level permissions for each specified field.

Query Related Objects

If your query traverses a child-to-parent relationship, use the __r syntax after the field name, followed by the field name of the parent object. For example:

SELECT Id, User__r.first_name FROM Order

<objectType>

The objectType specifies the type of object that you want to query.

caution

Make sure to provide a valid object name and enable read-level permissions to that object.

<conditionExpression>

If you include a WHERE clause, you can filter the rows and values in the specified objectType based on your conditions.

If you don't include a WHERE clause, the query retrieves all the rows in the object that are visible to the user.

<fieldOrderByList>

The fieldOrderByList specifies one or more fields, separated by commas, that are used to order the query results. For example:

SELECT Id, Price
FROM Orders
ORDER BY Price

Limits

When you query a large object, only the first 100 records are returned for each call.

If there are more results that can be returned in a single batch, a server-side cursor and a QueryLocator are created. To retrieve all records, call the nextRecordsUrl repeatedly until all records have been processed and the done flag is true. Here's an example:

GET https://api.appteum.com/data/query?q=SELECT Id FROM Users LIMIT 1
{
"data": [
{
"Id": "0000000000003ey"
}
],
"expandable": [],
"done": false,
"cursor": {
"nextRecordsUrl": "objects/data/query/eyJxIjoiU0VMRUNUIGlkICBGUk9NIHVzZXJzIiwibyI6eyJpZCI6IjAwMDAwMDAwMDAwMDNleSJ9LCJkIjoiZiJ9"
}
}

To fetch the next or previous set of results, call the nextRecordsUrl or previousRecordsUrl respectively with a GET request.

Fetch Next Results
GET https://api.appteum.com/objects/data/query/eyJxIjoiU0VMRUNUIGlkICBGUk9NIHVzZXJzIiwibyI6eyJpZCI6IjAwMDAwMDAwMDAwMDNleSJ9LCJkIjoiZiJ9