FredHutch / loquiAPI

Web API for Generating Automated Videos
https://loquiapi.fredhutch.org/__docs__/
Other
0 stars 0 forks source link

Steps toward API refactoring #7

Open cansavvy opened 5 months ago

cansavvy commented 5 months ago

Strategy and overall workflow for a user we are building here:

  1. Post request return an ID
  2. Request status on that ID
  3. Download the video associated with that ID

plumber.R work

  1. Make the generate_from_gs endpoint return an id ONLY.
    • does the id need to be returned as a list? return(list(id = id))
  2. IN the result endpoint, figure our where plumber::as_attachment(readBin(tmp_video, "raw", n = file.info(tmp_video)$size), "video.mp4") }), envir = promise_env) should go. Does it go in the result endpoint? This would make more sense to me.

plumber_functions.R work

  1. Find out how to make sure that POST returns the generated id after generate_from_gs is run. Right now its got a httr::write_disk()
  2. request_status figureout the httr handling and make sure id status is returned.
  3. In download_video make sure video is downloaded
howardbaek commented 5 months ago

FYI @dtenenba