Removing databases with remote api?

I have the creation of databases with remote api working but scratching my head on how to get the info to delete them. The parameter required is $database_id, but how can I find that info?

The app I trying to work with creates/deletes db's and the only info I have for deletion is the web_domain id, dbname, and dbuser to work with.

Looking thru the available remote api examples I don't see anyway to do it without resorting to writing php code connecting to the master ispconfigdb table and querying by dbname in the web_database table to get the $database_id