Integrate game via API

Generate a URL to redirect users to a unique game instance

Make sure you generate a Bearer Token to authenticate your API requests to the Console!

Use the API to generate a unique game instance. Send users to this URL to play your game and collect data.

Generate a unique game URL

To generate a secure game instance URL for your user to play a game, use the /api/authentication/generatePlayUrl endpoint and specify the app_id, secret, game_id, the player_id, num_items, and callback_url.

Generate play URL

get

Returns a URL you can use to send a user to play a game in 2bttns.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
app_idstringRequired

ID of the app you've created in 2bttns

secretstringRequired

Secret of the app you've created in 2bttns

game_idstringRequired

ID of the game you want to play in 2bttns

player_idstringRequired

ID of the player you want to play in 2bttns. If the player doesn't already exist, it will be created.

num_itemsstringOptional
callback_urlstringOptional
expires_instringOptional
Responses
get
/authentication/generatePlayURL

Find game_id in Console

We can get the game_id from our Console by navigating to Games:

Console > Games

Example

Last updated

Was this helpful?