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

We are troubleshooting an issue impacting community login, and it may be intermittently unavailable. Sorry for any inconvenience.

How to get response in json

VS_10112707
11-Garnet

How to get response in json

Thingworx/Groups/ getting html response 

 

how can i get json response by using this api in thingworx

ACCEPTED SOLUTION

Accepted Solutions
nmutter
14-Alexandrite
(To:VS_10112707)

You need to add header

Acceptapplication/json

Then the response will be in json format. Not sure if this was the question.

What also works (but is not so nice) is to add "<host>/Thingworx/Groups?Accept=application/json" to the url. You can also add maxItems=<number> as by default only 500 items will be returned.

View solution in original post

6 REPLIES 6

 Hi,

 

See page 54 in the attached manual - "Configuration API Service — Content Retrieval (JSON Response Structure)".

How to get Json result from Infotable in thingworx while using any rest api of thingworx

nmutter
14-Alexandrite
(To:VS_10112707)

You need to add header

Acceptapplication/json

Then the response will be in json format. Not sure if this was the question.

What also works (but is not so nice) is to add "<host>/Thingworx/Groups?Accept=application/json" to the url. You can also add maxItems=<number> as by default only 500 items will be returned.

Thanks working 

 

 

KP_9595031
4-Participant
(To:nmutter)

Where exactly "maxItems=<number>" has to be added ? Is ii in header or in url, please give some example ..

nmutter
14-Alexandrite
(To:KP_9595031)

Hey @KP_9595031,

I just know of the URL parameter maxItems. Example:

- "<host>/Thingworx/Things?Accept=application/json&maxItems=99999" 

If you use more than one parameter in the url you need to add the additionals ones with '&'. If you only want to use maxItems in url and Accept as a header it would be like this

- "<host>/Thingworx/Things?maxItems=99999" (+Accept header)

 

Hope that helps!

Announcements


Top Tags