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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

REST API Overview

Mark_B
2-Explorer

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?

ACCEPTED SOLUTION

Accepted Solutions
VladimirRosu
19-Tanzanite
(To:Mark_B)

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
VladimirRosu
19-Tanzanite
(To:Mark_B)

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
18-Opal
(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
18-Opal
(To:Rocko)

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

VladimirRosu
19-Tanzanite
(To:Mark_B)

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

Thank you for letting us know.

Announcements


Top Tags