Wait until API call to 3-rd party is completed

Hello,
I have a functions which make API call to 3-rd party and I would like to use result received and pass it to second function.
How could I ensure that second function is called only when 1-st has received a result from 3-rd party (which takes say 1-2 sec) ?
I would appreciate any help as I have no idea here …
Regards,
Vasil