cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can change your system assigned username to something more personal in your community settings. X

REST API Overview

Mark_B
2-Guest

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?

1 ACCEPTED SOLUTION

Accepted Solutions

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
    }

 

View solution in original post

5 REPLIES 5

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
    }

 

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

Rocko
17-Peridot
(To:Mark_B)

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
17-Peridot
(To:Rocko)

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

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

Thank you for letting us know.

Top Tags