Using the QueryAuditHistoryWithQueryCriteria Service
The QueryAuditHistoryWithQueryCriteria service has the following format:

QueryAuditHistoryWithQueryCriteria(maxItems [INTEGER], startDate [DATETIME], endDate [DATETIME],
auditCategory[STRING],query[QUERY], locale[STRING])
The following table describes the parameters for this service:
Parameters for the QueryAuditHistoryWithQueryCriteria Service
Parameter
Description
Default Value
maxItems
The maximum number of results to return from the query. (INTEGER)
* 
If the query contains pageSize in the query, this parameter is ignored.
500 items
locale
The abbreviation of the language name in which to return the results. (STRING). For example, fr for French or zh_CN for Chinese (China). The following locales are supported by ThingWorx.
The locale of the logged-in user submitting the query
startDate
A date and time. The query begins looking up audit messages, starting from the date and time you specify here. (DATETIME)
Unspecified
endDate
A date and time. The query stops looking up audit messages when the date/time of the messages reaches the date and time you specify here. (DATETIME)
Unspecified
query
A query string (in JSON format). An example of a JSON query that you can use follows this table.
This parameter is used in several ThingWorx services. For complete details, refer to Query Basics.
N/A
By default, a query returns 500 rows. To change the number of rows returned by the query, you can set the maxItems parameter to the desired number of rows. There is an upper limit to the number of rows that you can specify for the maxItems parameter. By default that limit is 5000 rows. A system administrator can change this limit when configuring the Audit Subsystem. System administrators should refer to the topic, Configuration of Audit Subsystem.
However, if you expect a significantly large number of results, use a QUERY.
The following JSON-formatted query shows how you might construct the filters, sorting, and pagination to be used with the QueryAuditHistoryWithQueryCriteria service (Direct Persistence implementation):

{
"filters": {
"type": "EQ",
"fieldName": "user",
"value": "Administrator",
"isCaseSensitive": false
},
"sorts": [
{
"fieldName": "timestamp",
"isAscending": true,
"isCaseSensitive": true
}
],
"pagination":{
"pageSize":50,
"pageNumber":2
}
}
Supported Locales
The following figure shows the locales supported by ThingWorx:
Was this helpful?