Some obvious programs that could be derived from this last script would be:
to read a JSON file or CSV file that contains a list of question banks that one wants to create along with the course_id to create them in
a program to simply output the JSON for the existing question banks in a course
Of course, the real solution is to add a Question bank API. Meanwhile, quite a lot can be done despite the lack of such an API.