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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

How to pass a Query into the URL

tcoufal
12-Amethyst

How to pass a Query into the URL

Hi Guys,

since alert processing subsystem is not working correctly (case has been opend and bug reported), We are trying to workaround that a bit.

I have pretty standard REST call to my TW that looks like that:

http://localhost/Thingworx/Resources/AlertFunctions/Services/QueryAlertSummary?method=post&Accept=text/xml

Here goes my question.

How can I append a query?

For an example


var query = {
filters: {
type: "And",
filters: [
{
type: "GT",
fieldName: "Duration",
value: "0"
}
]
}
};


Is there any special formatting? How can simply put into the URL?

Thanks a lot

Tomas

2 REPLIES 2
PaiChung
22-Sapphire I
(To:tcoufal)

I notice you have the command line switch enabled, please remember that doing so, does put you at risk of CSRF

to pass the query, you should be able to pass it in with &query=yourqueryasJSONhere

tcoufal
12-Amethyst
(To:PaiChung)

Yep I have, but I am passing the appKey in URL as well and I am using the REST calls only on LAN. Which should be secure against any kind of interception. I will try that JSON format.

Thanks though.

Top Tags