Guest API (deprecated)
This is an API that allows the game to show a modal that asks a guest user to sign in or sign up and to retrieve the user's actions inside the modal.
1. Object Fields
Guest
Parameter | Description | Type | Remarks |
---|---|---|---|
redirectUrl | Url to display to the user, which contains the signup request modal | string |
2. Constants
None
3. Request
3-1. Endpoint URL
/guest/play/sign-up/
3-2. HTTP Method
Method | Feature | 3-legged | 2-legged |
---|---|---|---|
GET | Generate/Retrieve a guest object | Yes | Yes |
Other than GET | - | - |
3-3. Template Parameters
None.
3-4. Query Parameter
version (optional)
Parameter value | Description | Remarks |
---|---|---|
1 or 2 | API version to be used | Default: 1. Using anything other than 1 or 2 will result in an error or undesired result. More details below |
callbackUrl (Required)
Parameter value | Description | Remarks |
---|---|---|
Any string | URL-encoded URL that is used in the callback processing from the signup modal | more notes below |
4. Response
Response
HTTP Method | Response Code | Description |
---|---|---|
GET | 200 | Successful completion of retrieving data |
GET | 400 | Invalid request |
GET | 401 | OAuth failure |
GET | 403 | Not supporting Guest Play |
Other than GET | 405 | Unpermitted method |
GET | 500 | Nutaku Game Platform error |
5. Notes
Versions of the API
The difference between versions 1 and 2 is that version 2 also has sign-up functionality, not just login.
Version 2 requires the game to have SSL Enabled (from the developer portal), otherwise you will receive an error.
On Sandbox environment, version 2 behaves like version 1.
Games that do not have Guest-Play feature enabled
Do not use this API if your game does not support Guest-Play. The modal from this API uses /guest-play/ path appended to the url of your game, so even if this API would not error out, if you use it in a game without Guest-Play enabled, the user would just see a 404 page inside the modal.
callbackUrl usage
The callbackUrl specified by you in the request is stored in memcached by the API, and it is retrieved from cache when the redirectUrl is used to show the modal.
Depending on the user's action inside the modal, a status string (from the table below) is appended to your callbackUrl before being called, so you should be able to handle the {callbackUrl}+{status} paths on your server (the status value is appended directly as a string, not a query parameter).
status value | Description |
---|---|
CONTINUE | The guest user selected to continue playing as guest |
CANCEL | The guest user cancelled the signup request |
SIGNUP | Guest user succeeds to sign up |
6. Sample
// Request to display a signup request modal // Request GET /guest/play/sign-up/?version=1&callbackUrl=https%3A%2F%2Fwww.example.com%2Fmodal-callback // Response 200 OK { "entry": [ { " redirectUrl ":" https://www.example.com/game-title-id/guest-play/sign-up?version=1" } ] }