AnsweredAssumed Answered

Chained Rest Api Calls

Question asked by jorge.vinagreesri-portugal-pt-esridist Employee on Oct 4, 2013
Latest reply on Oct 7, 2013 by jorge.vinagreesri-portugal-pt-esridist
Hi  there

I need to chain several  rest calls with the api to perform a complex search in a web app.
Supose i need this:

.execute for count
.execute for object ids
.test the objecids in an mvc WebApi service
.execute the actual map query

I may have to do this from 1 to 5 five times depending on the criteria entered by the user.

Is there any way to coordinate all this?

What i had in mind was:

.execute for count(1 to five times)

wait for all counts
if there are less than 800 results

.execute for object ids(1 to five timea)...and so on

I thinks this is made using deferred´s, and promises but i dont know how to use them.
Any directions?

I´m using JS API 3.2.