Play By iDev

API DOCS v1.1

Documentation for the API of iDev Games HTML5 Game Platform

Users


User System

The user system is critical for making requests within your Game DB tables from your game using the API. You can only save data from a users account to a table that is marked as user edited. Through the API you are able to register an account, login as a user and request a forgot password email.


User Creation

user/create

This endpoint will allow you to create a new user login.

Parameters

Parameters to pass with your request. Pass across the username parameter from a text field. Pass across the email parameter from a email field. Pass across the password parameter from a password field.

Responses

These are the responses you can expect to receive depending on the outcome. You will receive a success message if the user has been created. If the username or email has been used already then the error "User already exists." error will be returned. Success Missing fields. User already exists. Unauthorized

Example

See how in this javascript example.



User Login

user/auth

This endpoint will allow you to authenticate a user login. Logging in a user successfully will

Parameters

Parameters to pass with your request. Pass across the email parameter from a email field. Pass across the password parameter from a password field.

Responses

These are the responses you can expect to receive depending on the outcome. You will receive an access token if the user successfully logs in. This token needs to be saved to a variable. You will have to pass this variable on as a header named "access_token" in your requests to user authenticated endpoints. The access token Error Unauthorized

Example

See how in this javascript example.



User Password Reset

user/reset

This endpoint will allow you to send a request for a password reset for an account. This will send an email for the user if the email is correct to then reset the password.

Parameters

Parameters to pass with your request. Pass across the email parameter from a email field.

Responses

These are the responses you can expect to receive depending on the outcome. Once a successfull request is made an email is sent to the email address initiating a password reset. There is a cool down period until the next email will be able to be sent. Success countdown until another attempt can be made after a successfull request is made. User doesn't exist. Missing email field. Unauthorized

Example

See how in this javascript example.



Retrieve Username

fetch/username

This endpoint will retrieve the username of the logged in user.

Responses

These are the responses you can expect to receive depending on the outcome. Will bring back the username of the logged in user. Users username is returned.

Example

See how in this javascript example.



SAVING DATA >

Back to top