Skip to main content
17-Peridot
February 10, 2022
Question

How to get one user's changes in thingworx composer

  • February 10, 2022
  • 2 replies
  • 1450 views

How to get one user's changes in thingworx composer. Any restapi is available? or

Writing a custom service by passing username, startdate as inputs to query datas in Application logs file will help? 

2 replies

1-Visitor
February 10, 2022

If you want to see any configuration changes done by a specific user then you can use http://twxurl:8080/Thingworx/Logs/ConfigurationLog/Services/QueryLogEntries API (either as REST or a JS service in ThingWorx). This API has a default input with name user, just pass this in body and you can get desired rows for that particular user only. I believe similarly you can query other log entries as well (ApplicaitonLog).

17-Peridot
February 19, 2022

It is showing Invalid Request when i used this link with my server url and portnumber. I think this Logs entity is not present in 9.2 version. Can u pls check once and let me know.  If it gives infotable as output, then what is its datashape?

I tried this code in service. But the result is not appropriate to my query.

js code:

 

var queryUser = {
"filters":
{
"type": "AND",
"filters": [{
"type": "EQ",
fieldName: "level",
value: "INFO"
},
{
type: "EQ",
fieldName: "user",
value:"Abinaya"
}]
}
};
var allUserRecords = Logs["ApplicationLog"].QueryLogEntries({
query: queryUser
});
var result = allUserRecords[0];

 

Output json is :

{
"instance": "",
"level": "TRACE",
"session": "",
"origin": "c.t.w.c.ThreadLocalContext",
"thread": "http-nio-8080-exec-12",
"platformId": "",
"user": "Abinaya",
"content": "----> CURRENT security context [user: Abinaya, depth: 1]",
"timestamp": 1645256452073
}

 

1-Visitor
February 22, 2022

I am testing this on Thingworx 9.2.3 only. Here is my call snapshot from Postman including the result.

 

Mukul_0-1645552684530.png

 

Community Manager
February 22, 2022

Hi @AP_9587236.

 

I think the url referenced in Mukul's post should have been:  http://<domain_name>:<port>/Thingworx/Logs/ConfigurationLog/ServiceDefinitions/QueryLogEntries

 

Note, you can access all ThingWorx entities by running http://<domain_name>:<port>/Thingworx/Server and drilling down to find the desired one.

 

Regards.

 

--Sharon