Using the QueryAuditHistory Service
The QueryAuditHistory service for a Thing works in a similar manner to the QueryAuditHistory and QueryAuditHistoryWithQueryCriteria services on the audit subsystem, but with additional restrictions. The general behavior and all parameters of this service are the same as the services of the audit subsystem. The following are the restrictions of this service:
1. Checks if the user invoking the service is a member of the Auditors group. If not, the results are filtered by that user's permissions.
2. When the QueryAuditHistory service is invoked from a particular Thing, the search uses the entity identifiers instead of names.
The following table describes the parameters for the QueryAuditHistory service on a Thing:
Parameter Name
Description
maxItems
The maximum number of items to return. The base type of this parameter is NUMBER.
startDate
The earliest audit date to query. The base type of this parameter is DATETIME.
endDate
The latest audit date to query. The base type of this parameter is DATETIME.
query
The query definition. The base type of this parameter is QUERY. Format the query as JSON object.
locale
The localizationTable locale that is used to localize the results. The base type of this parameter is STRING.
To support Thing context-constrained queries for the Audit Subsystem, a user group was added, called Auditors. This group allows non-administrative users to see complete results from the QueryAuditHistory service when calling it from Things to which they have visibility.
For example, an Administrator create a Thing called ExampleThing and gave access to this Thing to User_A, who is a member of the Auditors group. The Administrator also gave access to this Thing to User_B, who is not in any special user groups. If each user runs the QueryAuditHistory service from ExampleThing, the expected results are as follows:
User
Group Membership
Expected Result
Administrator
Administrators
Returned InfoTable contains all audit entries related to ExampleThing.
User_A
Auditors
Returned InfoTable contains all audit entries related to ExampleThing.
User_B
No special groups
Returned InfoTable contains audit entries associated withUser_B only.
Supported Locales
The following figure shows the locales supported by ThingWorx:
Was this helpful?