Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
I am attempting to use the REST v2 interface to retrieve audit information for assets. However, whenever using audit/find or audit/findByIds (the only two interfaces I have tried) I always get an Internal Server Error 500. Does the audit retrieval part of the REST interface work? If so, can you provide a code example of its use?
Thanks.
Hello, John.
So far I cannot find any articles or other documentation about this for ThingWorx. Let me ask internally and find out if this is possible.
Thanks,
-- Craig A.
Have you tried using your browser dev tools (f12 in chrome) to track the structure of your REST call? In the network activity, you can see the request call:
Also have you tried using API tools, like Postman?
Here is the information from the transaction. All other REST transactions are working fine, providing a proper JSON response.
Request:
Method: POST, RequestUri: 'https://cvrx.att.axeda.com/services/v2/rest/audit/find', Version: 1.1, Content: System.Net.Http.ObjectContent`1[[AxedaWebAPI.RestInterface+AuditCriteria, AxedaWebAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], Headers:
{
Accept: application/json
Authorization: Basic ...
Content-Type: application/json; charset=utf-8
}
{"assetId":"9010 Programmer||LENOVO_20AN0069US_PC03BR7M","usernames":null,"categories":null,"fromDate":"2016-07-28 21:15:22Z","toDate":"2017-07-28 21:15:22Z","pageSize":"100","pageNumber":"1","sortAscending":null,"sortPropertyName":null}
Response:
System.Threading.Tasks.Task`1[System.Net.Http.HttpResponseMessage]
AxedaWebAPI.AxedaRestException: HttpResponse Error 500, (Internal Server Error)