Play By iDev

API DOCS v1.1

Documentation for the API of iDev Games HTML5 Game Platform

Retrieving Data


Introduction

As your database is in a read only state. You are able to retrieve any data from your Game DB. Personal information needed for the user system is not accessible at all. As mentioned earlier in the getting started section. You MUST NOT ever save users personal information as this would not be safe. Only ever save data needed for your game. (lvl's, money, experiance etc)

If you've just run through the last section, you may have just deleted your only saved information. Go back and add some more data so you have something to bring back below.

The below end point is a one end point for all your needs. You can do a lot with it. I recommend playing with this but to keep things simple I have only added one example for now.


Retrieving Your Data

fetch/get

This endpoint will allow you to retrieve data in many ways.

Parameters

Parameters to pass with your request.

You will need to specify which table you would like to retrieve data from with optional conditions. Including pagination

Specify the table name that you would like to retrieve the data to. The column for a where clause. Split by | for "and" where clause, I.E "where=id|column1". The compare for a where clause I.E ">", "=", "!=" or "LIKE". Split by | for "and" clause like above. The value for a where clause. Split by | for "and" clause like I.E "where=column1|column2", "compare=like|!=" and "value=%test%|test". Number of results to bring back per "page". Page of results to bring back, check JSON for "total" for how many pages exist. Bring back specific value of first column in result as plain text by specifying column name. Bring back results as JSON with only specified column by specifying column name. Turn "and" clause into an "or" clause. Specifiy true or false. Specify the column name to sort the results by. Specify "DESC" or "ASC" for the sort by.

Responses

These are the responses you can expect to receive depending on the outcome. A JSON object Plain text result No Results Found Unauthorized No table specified No table found

Example

See how in this javascript example.

In the below example, we are going to return the "exampleTable" results as a JSON object.




Back to top