Use the API
Now with your Console running, we can make fetch requests for everything.
Generate a Bearer token to authenticate your fetch requests between your app and your Console.

2bttns will use your app_id and secret to your Console to generate a JWT. Navigate to your Console, click Settings, and make sure you're on the Apps tab.
Returns a JSON Web Token (JWT) you can use to authenticate API calls to 2bttns.
You can get the app_id and secret from your 2bttns admin console, under Settings/Apps.
Successful response
Error response
Here's an example fetch request:
Generate URL to your Game: Now that you've generated your bearer token, you can use the full RESTful API within the Console. Here's an example where we generate a game URL using node-fetch:
Returns a URL you can use to send a user to play a game in 2bttns.
ID of the app you've created in 2bttns
Secret of the app you've created in 2bttns
ID of the game you want to play in 2bttns
ID of the player you want to play in 2bttns. If the player doesn't already exist, it will be created.
Successful response
Error response
You can use the API to generate games, manage data, and much more.
Next Steps
Last updated
Was this helpful?