queryRecords
This method returns a list of records owned by the current user. By default, you only get the records created by your application. To query the records from another application, you must filter by the license id of this application.
Parameters
Name | Type | Required | Description |
cortexToken |
| yes | A token returned by authorize. |
query |
| yes | An object to filter the records. |
orderBy |
| yes | Specify how to sort the records. |
limit |
| no | The maximum number of records that this method should return. A limit of zero means no maximum. |
offset |
| no | The number of record that this method should skip before returning the result. If the limit is zero, then Cortex will ignore this parameter. |
includeMarkers |
| no | If This parameter was added in Cortex 2.1 |
includeSyncStatusInfo |
| no | If The default value is This parameter was added in Cortex 2.6.3 |
Depending on the query, this method may return a lot of records. To avoid performance issues, you should always set an offset and a limit.
query
The query object can contain one or more of these fields:
Name | Type | Description |
licenseId |
| Set this parameter to filter the records by their license. |
applicationId |
| If you set the licenseId, then you can set this parameter to further filter the records by application. |
keyword |
| Set this parameter to filter the records by title, description, or subject name. |
startDatetime |
| An object with fields "from" and "to" to filter the records by their start date time. |
modifiedDatetime |
| An object with fields "from" and "to" to filter the records by their modification date time. |
duration |
| An object with fields "from" and "to" to filter the records by their duration. |
orderBy
The orderBy parameters is an array of objects, similar to the orderBy clause of a SQL request.
Each object must have a single attribute. The key of the attribute is the name of record's field you want to order by. The value of the attribute must be "ASC" or "DESC", to order is ascending or descending order.
For example, to order the records by their start date, in descending order, you must use the object {"startDatetime":"DESC"}
. To sort the records by title, in alphabetical order, you must use {"title":"ASC"}
.
You can order the records by these fields: title, description, startDatetime, modifiedDatetime, duration, subjectName, applicationId. The option to order by applicationId was added in Cortex 2.5.0
limit and offset
These parameters are to implement pagination. It useful if you want to display the records in a UI. You must order the results to use these parameters.
First you should call this method with an offset of zero, and a limit of X. In the response, check the value of count. If count is greater than the limit, then you should call this method again with an offset of X. And then with an offset of 2*X, 3*X... until you get all the records for your query.
Result
The result is an object that includes these fields:
Name | Type | Description |
records |
| An array of record objects. |
count |
| The total number of records that match the query. |
limit |
| The limit you specified in the parameters. |
offset |
| The offset you specified in the parameters. |
Examples
Get the 10 most recent records created by EmotivPRO.
Get some records using a keyword.
Last updated