Alright I've isolated all the calls required for your function flow.
Currently writing the functions for the app to operate, will test tonight and hopefully have a feasible script for you in the next 2 to 12 hours.. :D
Link to my account: https://genie.peakd.com/@klye