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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Multiple API calls on Thingworx and handling the response

IS_10098292
4-Participant

Multiple API calls on Thingworx and handling the response

Hello Team,

I have one requirement in which I have to select multiple rows in grid. I have to make API calls by passing id in post call. I have used the for loop to make API calls one by one for 1000 rows. Is there any optimize way in which I can make API calls for almost 1000 rows. I have called  async service inside wrapper service but its difficult to handle response in async service for 1000 API calls. Please suggest the optimize way possible.

1 REPLY 1
PaiChung
22-Sapphire I
(To:IS_10098292)

The only way to optimize this would be that the API you are calling accepts a multirow payload.

I don't see any other way to improve this.

What you can possibly do, is to have the async calls set a property which you can trigger off to check if the full call finished or not.

Still very difficult with an async setup since you don't know the order the calls will finish in.

But perhaps you can set a counter and a target count and each asynch service increases the counter by one and when it has reached target count, you know you are done.

Announcements


Top Tags