Skip to main content
May 5, 2022 5:18 PM UTC
Solved

REST API Overview

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?

May 6, 2022 1:39 PM UTC

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
 }

 

5 replies

May 6, 2022 1:39 PM UTC

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_BAuthor
May 6, 2022 1:52 PM UTC

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

May 6, 2022 1:52 PM UTC

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

May 6, 2022 2:26 PM UTC

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

May 6, 2022 2:13 PM UTC

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

Thank you for letting us know.