I have some code that nearly does what I require - which I have uploaded.
I want to query an API and return the results within my script. The API has two types, both of which I need my script to be able to query.
"realtime" which returns the data straight away
"queue" which returns an reportID, which you then need to query with "get" to get the data
[login to view URL] use async/await not promises
2. Must be able to handle "realtime" and "queue" types of requests
3. For the "queue" type of request, if "report_not_ready" is returned, wait 1 second and try again with the same reportID
4. For queue, give up if after 3 times it fails.
I want there to be a small main function which I put on my page, which calls out to a large function which does the API call. This small function will not only define the variables which will be sent with the API query (i.e like report type), but will also get the data returned to it, so I can determine what to do with it (simple example, put in an alert box).
I've done a lot of the work in my attached file, but you will see that it doesn't meet the criteria above, so I need your help getting it to work.
The API is secret, so I am afraid you will not be able to test with it, but you will see the code is not that complicated.
16 freelancers are bidding on average £24 for this job
Hi, It seems like a pretty straight-forward work. I would love to work on this json data fetching from the api for you using asynchronous and await calls. Contact me via chat and we can start this work asap.
this sounds pretty straightforward and shouldnt take long at all. please take a look over my feedback and get in touch if you have any questions. thanks, simon