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

Infotable Query via RestAPI

Pi_Baettgen
12-Amethyst

Infotable Query via RestAPI

Hello

 

I am currently looking for a way to dynamically filter an info table via a service using a query via RestAPI.

Ideally, the full functionality of the query function should be retained. Has anyone had any experience with this?

In SAP IoT, the whole thing is more or less solved as a complete parameter in the URL. But in Thingworx, this doesn't seem to be possible, or am I missing something?

 

Thanks in advance

ACCEPTED SOLUTION

Accepted Solutions

Try to pass it as a parameter first and see if it works (use a simpler service with a number first to see if this approach works).

For as long as I remember, the service input parameters have been passed in the body, but tbh I never tried on my end to pass them as URL params - hence the recommendation.

View solution in original post

7 REPLIES 7

Can you give an example of your code?

Pi_Baettgen
12-Amethyst
(To:Rocko)

Unfortunately, I am not allowed to share internal code and would have to create a general snippet first.

 

But I don't really understand why you need one:

The question is very general how I can best use an info table query/filter via RestCall by passing it in the URL or as a parameter in the header

It's just unclear to me what you mean by "Infotable query filter"

While I'm not sure I understand 100% the situation, the Query snippet allows you to query an Infotable:

let params = {
	t: undefined /* INFOTABLE */,
	query: undefined /* QUERY */
};

// result: INFOTABLE
let result = Resources["InfoTableFunctions"].Query(params);

 This is user-callable via POST REST, just like any other ThingWorx API (except the Websocket endpoints).

The parameters should be sent in the body of the request - I don't remember if you can pass them as URL parameters.

Hey Vladimir,

 

Yeah thats actualy what i was trying to do via URL oder as a Parameter. in Postman. So its only possible in the body?

Best regards.

Try to pass it as a parameter first and see if it works (use a simpler service with a number first to see if this approach works).

For as long as I remember, the service input parameters have been passed in the body, but tbh I never tried on my end to pass them as URL params - hence the recommendation.

Hello Vladimir,

 

Individual parameters are not a problem but I think it seems difficult or even impossible to send the filter information for the query in the header or via the URL. We are now solving this with a direct SQL command to the underlying database.

 

Thanks for the help

 

Announcements


Top Tags