Skip to main content
1-Visitor
May 5, 2022
Solved

REST API Overview

  • May 5, 2022
  • 3 replies
  • 2522 views

Per the post, I tried the "Downloading Log Information" example and got a result, but my impression is that parameters in the body are ignored. Whatever I define for "maxItems", "startDate" and "endDate", I get the most recent 500 (?) log entries.

This is the body in Postman (raw, JSON):

{
    "value":
    {
        "maxItems"10,
        "startDate"1651701600000,
        "endDate"1651761000000,
        "oldestFirst"true
    }
}

I also tried the syntax as in the example by using \" - but this is marked in Postman like syntax error and does not change the behavior. What is going wrong?

Best answer by VladimirRosu_116627

Hi @Mark_B ,

 

This is an easy one to answer. The body of the post message is incorrect. It seems only that example was incorrect (I'll reach out to the relevant people to modify it).

Just remove the value key, and have the body like this:

 {
 "maxItems": 10,
 "startDate": 1651701600000,
 "endDate": 1651761000000,
 "oldestFirst": true
 }

 

3 replies

19-Tanzanite
May 6, 2022

Hi @Mark_B ,

 

This is an easy one to answer. The body of the post message is incorrect. It seems only that example was incorrect (I'll reach out to the relevant people to modify it).

Just remove the value key, and have the body like this:

 {
 "maxItems": 10,
 "startDate": 1651701600000,
 "endDate": 1651761000000,
 "oldestFirst": true
 }

 

Mark_B1-VisitorAuthor
1-Visitor
May 6, 2022

I tried the example, looks good -Thanks a lot!

Rocko
19-Tanzanite
May 6, 2022

Try not wrapping it in a "value" object, just use this as body:

{
        "maxItems"10,
        "startDate"1651701600000,
        "endDate"1651761000000,
        "oldestFirst"true
}

 

You can see the parameters needed by entering this in the browser: http://<YOUR_SERVER_HERE>/Thingworx/Logs/ApplicationLog/ServiceDefinitions/QueryLogEntries

Rocko
19-Tanzanite
May 6, 2022

And this is what happens when you don't Reload 🙂 Thanks Vlad, your solution was a tad earlier.

19-Tanzanite
May 6, 2022

And the original post you linked to is also corrected (thanks to @Iuliana Nuta ).

Thank you for letting us know.