Get a list of all bosses in instance?

Within an addon how do I get info on all bosses within a given instance? Assume this is a fresh instance with nothing saved. I’m the player walk in.

I can easily get the basic instance I do but I then want to iterate over the list based on that instance ID. Seems like I might need to use an EJ function but not sure which/how.

Any assistance.

Hmm maybe pull some info from the dungeon journal. Something like if zone is Molten Core, then link bosses (from dungeon journal) for Molten core.

Perhaps compare it to your /raidinfo lock out.

Just brainstorming would need to look up the exact api for this.

EJ_GetEncounterInfoByIndex
https://wowpedia.fandom.com/wiki/API_EJ_GetEncounterInfo
https://wow.tools/dbc/?dbc=journalinstance&build=10.0.5.47660#page=1

Loop through the index till you get an empty return.

Can test it by opening the dungeon journal, selecting a dungeon, and running /dump EJ_GetEncounterInfoByIndex(1) in the chat box.