 A common solution to this problem, is to make a 0 stage process, where step 0 is a request of "should I download?", where there are 0 possible replies: "no, check again in N time" and "yes, here is a token". Step 0 is then presenting the token to the api point for download, and getting the file.  