The Kanka API allows you to interact with your campaign using a programming language of your choice. You can find the documentation by following this link.
Why would I need the API?
There are several reasons why you would want to use the Kanka API. The following are the most common among our community.
- Importing campaign data from another program or source. For example, if you have all of your worldbuilding somewhere else and want to transfer to Kanka, you can write a script that will automate this process.
- Building external tools. Wrote a custom tool to help with running your game, or a random generator? The Kanka API is perfect for this use case, where your tool interacts with the data in your campaign.
- Custom Exports. Want to export your campaign to another tool, or to a custom format.
Setting yourself up
authorization: bearer <kanka-user-token>
To generate a new
kanka-user-token, go to your profile API settings.
Set up Postman with the following configuration to get a list of your campaigns.
Clicking on “Send” should get a list of your campaigns in a JSON format. It should look something like this in Postman.
If you get another result, check out the troubleshooting page in the api docs.
While you can interact with most features of the Kanka API using Postman, one limitation is uploading images. For this you will need a programming language like Python.
Now that you’ve set up some example API requests using Postman, you can export them to your code. To do so, click on the “Code” button on the topish right of your request, as highlighted in the following screenshot.
This allows you to export your request to various programming languages.
If you need any help, drop by the Discord and ask in the