This API aims to allow third-party applications to initiate one-on-one game sessions on the online gaming platform papergames.io.
In a nutshell, your server calls the API and retrieves an URL that can be embedded into an iframe to empower your application with online game sessions.
POST /api/room/embedded creates a room session and returns iframe URLs that can be used by your application to connect two remote players.
Please refer to the endpoints section for usage instructions.
Please refer to the pricing section to see our rates.
Requests represent a single call to the API. If two players are connected and play 10 rounds of Tic-Tac-Toe, you’ll be charged for one game session.
playUrl field contains an embeddable URL that can be integrated into an iframe for a user to play.
watchUrl field contains an embeddable URL that can be integrated into an iframe for a user to watch the game as a spectator.
On your application, you should display to the players an iframe containing the
playUrl field as
src attribute along with the username.
iframe is displayed on your FrontEnd, it automatically initiates a connection with papergames.io. The first player will have a message “Waiting for player”. The game session begins as soon as the
iframe is displayed to the second player. The players can play together as many rounds as they want without creating extra charges.
URL to play
username needs to be provided as
GET parameter in the
src attribute to set the payer’s name.
URL to spectate
You can use our sample codepen to test the result of this API:
Important: to emulate the second player, you must open the codepen on a private navigation window.