improved-initiative icon indicating copy to clipboard operation
improved-initiative copied to clipboard

HTTP API Documentation

Open Daomephsta opened this issue 2 years ago • 5 comments

I'm currently attempting to launch Improved Initiative from an adhoc local HTML site I use for DM notes. I've found mention of API endpoints (cynicaloptimist/improved-initiative#46, cynicaloptimist/improved-initiative#231), but no documentation. Are these endpoints meant for general usage at all?

Daomephsta avatar Jul 16 '22 14:07 Daomephsta

Did you get any details on this one?

JaiSpicer avatar Mar 31 '23 04:03 JaiSpicer

@JaiSpicer No, I ended up deciding to build my own adhoc initiative tracker. It's less feature rich than Improved Initiative, but in some ways it suits my purposes better.

Daomephsta avatar Mar 31 '23 07:03 Daomephsta

There's no dedicated documentation for this, but there is an example of a minimal POST request that can launch an encounter similar to what Kobold Fight Club does: https://github.com/cynicaloptimist/improved-initiative/blob/development/test-post.html As long as the payload conforms to the StatBlock type, it should work as expected; you can include any supported parts of the StatBlock: https://github.com/cynicaloptimist/improved-initiative/blob/development/common/StatBlock.ts

cynicaloptimist avatar Dec 11 '23 18:12 cynicaloptimist

Thanks @cynicaloptimist ! Any thoughts about supporting pulling in data from it (e.g. lists of encounters, characters, etc)? I could probably achieve this with a Chrome plugin. Or, perhaps I could open a PR that allowed for some kind of extension system for II. It could allow for adding an extension from another site which it loads in a protected iframe and then provide an api object to the iframe to allow it to pull in the user's info.

Nothing pressing, just brainstorming ideas.

dprothero avatar Dec 20 '23 18:12 dprothero

I likely won't make the time to work on this API any time soon. Thanks for the suggestions though!

cynicaloptimist avatar Dec 21 '23 06:12 cynicaloptimist