Custom Async Function

#1

how to write custom async function in cloud code, for calling an api within response for other api.

#2

You mean, call one API, and once you get a response, call another API? Something like this:

const request = require('request-promise');

module.exports = async function (event) {
  let response1 = await request('https://api.number/one');
  let response2 = await request('https://api.number/two');
  // ...
}
1 Like
#3

Thanks for the reply. @heypiotr