Cloud Object

Introduction

Work with Cloud Storage, Databases, Live Configurations and other tools using this API Object. Learn more about working with Cloud module using Ocugine Dashboard here.

Cloud Object Available Methods

Content Storage

Databases

Live Configurations

Cloud Saves

  • GetPlayerSaves - Get all player saves (up to 100 saves per project);
  • GetSaveData - Get save data using access token and save UID;
  • SetSaveData - Create / Update save data using access token and save UID;
  • RemoveSaveData - Remove save data by access token and save UID;

Content Storage

GetContentList

This method requires Project ID and Client Key

API Url:

https://cp.ocugine.pro/api/cloud/get_content_list/

Request POST Params:

Parameter Type Description
app_id (required) double Project ID
app_key (required) string Project Client Key
search string Search Request
page double Pagination Index

Response Example:

{
    "complete": true,
    "message": "",
    "data": {
        "list": [
            {
                "uid": "54",
                "project_id": "59",
                "content_slug": "L-7yoYLLi54.jpg",
                "content_url": "https://cp.ocugine.pro/storage/6249146/704733.jpg",
                "content_size": "79739",
                "category": "0",
                "time": "1568940092",
                "visible": "1"
            }
        ]
     }
}

GetContentData

This method requires Project ID and Client Key

API Url:

https://cp.ocugine.pro/api/cloud/get_content/

Request POST Params:

Parameter Type Description
app_id (required) double Project ID
app_key (required) string Project Client Key
cid (required) double Content UID

Response Example:

{
    "complete": true,
    "message": "",
    "data": {
        "info": {
            "uid": "54",
            "project_id": "59",
            "content_slug": "L-7yoYLLi54.jpg",
            "content_url": "https://cp.ocugine.pro/storage/6249146/704733.jpg",
            "content_size": "79739",
            "category": "0",
            "time": "1568940092",
            "visible": "1"
        }
    }
}

Cloud Databases

GetDBTables

This method requires Project ID and Client Key

API Url:

https://cp.ocugine.pro/api/cloud/get_db_tables/

Request POST Params:

Parameter Type Description
app_id (required) double Project ID
app_key (required) string Project Client Key
search string Search Request
page double Pagination Index

Response Example:

{
    "complete": true,
    "message": "",
    "data": {
        "list": [
            {
                "uid": "6",
                "name": "My Table",
                "api_name": "my_table",
                "project_id": "59",
                "desc": "This is an example of my table",
                "read": "1",
                "write": "1",
                "remove": "1",
                "time": "1569174674",
                "fields": 3,
                "rows": 1
            }
        ]
    }
}

GetDBFields

This method requires Project ID and Client Key

API Url:

https://cp.ocugine.pro/api/cloud/get_db_fields/

Request POST Params:

Parameter Type Description
app_id (required) double Project ID
app_key (required) string Project Client Key
table_id (required) double Database Table UID
search string Search Request
page double Pagination Index

Response Example:

{
    "complete": true,
    "message": "",
    "data": {
        "list": [
            {
                "uid": "4",
                "table_id": "6",
                "project_id": "59",
                "name": "Name",
                "api_name": "name",
                "desc": "This is a name example",
                "type": "1",
                "default_value": "",
                "time": "1569174774",
                "unique": "0",
                "required": "0"
            },
            {
                "uid": "5",
                "table_id": "6",
                "project_id": "59",
                "name": "Desc",
                "api_name": "desc",
                "desc": "This is my description",
                "type": "1",
                "default_value": "",
                "time": "1569174778",
                "unique": "0",
                "required": "0"
            },
            {
                "uid": "6",
                "table_id": "6",
                "project_id": "59",
                "name": "Number",
                "api_name": "number",
                "desc": "Number for table",
                "type": "0",
                "default_value": "0",
                "time": "1569174769",
                "unique": "0",
                "required": "0"
            }
        ]
    }
}

GetDBRows

This method requires Project ID and Client Key

API Url:

https://cp.ocugine.pro/api/cloud/get_rows/

Request POST Params:

Parameter Type Description
app_id (required) double Project ID
app_key (required) string Project Client Key
table_id (required) double Database Table UID

Response Example:

{
    "complete": true,
    "message": "",
    "data": {
        "list": [
            {
                "uid": 15,
                "name": "hello",
                "desc": "hello world",
                "number": "0"
            }
        ]
    }
}

GetDBRow

This method requires Project ID and Client Key

API Url:

https://cp.ocugine.pro/api/cloud/get_row/

Request POST Params:

Parameter Type Description
app_id (required) double Project ID
app_key (required) string Project Client Key
row_id (required) double Database Row UID

Response Example:

{
    "complete": true,
    "message": "",
    "data": {
        "row_id": 15,
        "table_id": "6",
        "list": [
            {
                "value": "0",
                "field_name": "number"
            },
            {
                "value": "hello world",
                "field_name": "desc"
            },
            {
                "value": "hello",
                "field_name": "name"
            }
        ]
    }
}

GetDBRowsNum

This method requires Project ID and Client Key

API Url:

https://cp.ocugine.pro/api/cloud/db_count/

Request POST Params:

Parameter Type Description
app_id (required) double Project ID
app_key (required) string Project Client Key
table_id (required) double Database Table UID

Response Example:

{
    "complete": true,
    "message": "",
    "data": {
        "count": 1
    }
}

SaveDBRow

This method requires Project ID and Client Key

API Url:

https://cp.ocugine.pro/api/cloud/save_row/

Request POST Params:

Parameter Type Description
app_id (required) double Project ID
app_key (required) string Project Client Key
table_id (required) double Database Table UID
row_id (required) double Database Row UID. Use "-1" value to create new row.
YOUR_FIELDS_API_NAME (required) YOUR_FIELD_TYPE You need to send all datas in the post request, where index = api_name of your table field

POST Request Params Example:

{
  "app_id": YOUR_APP_ID,
  "app_key": "YOUR_APP_KEY",
  "table_id": 6,
  "row_id": -1,
  "number": 5,
  "desc": "Some another text",
  "name": "Some Text"
}

Response Example:

{
   "complete": true,
   "message": "",
   "data": []
}

RemoveDBRow

This method requires Project ID and Client Key

API Url:

https://cp.ocugine.pro/api/cloud/db_remove/

Request POST Params:

Parameter Type Description
app_id (required) double Project ID
app_key (required) string Project Client Key
row_id (required) double Database Row UID

Response Example:

{
   "complete": true,
   "message": "",
   "data": []
}

Live Configs

GetAllConfigs

This method requires Project ID and Client Key

API Url:

https://cp.ocugine.pro/api/cloud/get_all_configs/

Request POST Params:

Parameter Type Description
app_id (required) double Project ID
app_key (required) string Project Client Key

Response Example:

{
    "complete": true,
    "message": "",
    "data": {
        "list": [
            {
                "uid": "4",
                "project_id": "59",
                "name": "JSON Test",
                "value": "{\n \"app_name\": \"test_app\",\n \"app_desc\": \"This is a test app config\",\n \"json_arr\": [\n    \"name\", \"val\"\n  ]\n}",
                "type": "2",
                "time": "1568762188"
            }
        ]
    }
}

GetConfig

This method requires Project ID and Client Key

API Url:

https://cp.ocugine.pro/api/cloud/get_config/

Request POST Params:

Parameter Type Description
app_id (required) double Project ID
app_key (required) string Project Client Key
uid (required) double Live Config UID

Response Example:

{
    "complete": true,
    "message": "",
    "data": {
        "uid": "4",
        "project_id": "59",
        "name": "JSON Test",
        "value": "{\n \"app_name\": \"test_app\",\n \"app_desc\": \"This is a test app config\",\n \"json_arr\": [\n    \"name\", \"val\"\n  ]\n}",
        "type": "2",
        "time": "1568762188"
    }
}

Cloud Saves

With cloud saves you can store any players data for your application. Every player can store up to 100 slots in the cloud.

GetPlayerSaves

This method requires Access Token, Project ID and Client Key

API Url:

https://cp.ocugine.pro/api/cloud/get_player_saves/

Request POST Params:

Parameter Type Description
app_id (required) double Project ID
app_key (required) string Project Client Key
access_token (required) string Player Access token with "cloud_data" grants

Response Example:

{
    "complete": true,
    "message": "",
    "data": {
        "list": [
            {
                "uid": "1",
                "project_id": "59",
                "profile_uid": "17",
                "data": "{\"player_level\": 17, \"player_exp\": 800, \"money\": 900, \"coins\": 2000, \"data\": { \"var1\": \"Test\", \"var2\": 123 }}",
                "time": "1570912912"
            }
        ]
    }
}

GetSaveData

This method requires Access Token, Project ID and Client Key

API Url:

https://cp.ocugine.pro/api/cloud/get_save_data/

Request POST Params:

Parameter Type Description
app_id (required) double Project ID
app_key (required) string Project Client Key
access_token (required) string Player Access token with "cloud_data" grants
uid (required) double Cloud Save UID

Response Example:

{
    "complete": true,
    "message": "",
    "data": {
        "uid": "1",
        "project_id": "59",
        "profile_uid": "17",
        "data": "{\"player_level\": 17, \"player_exp\": 800, \"money\": 900, \"coins\": 2000, \"data\": { \"var1\": \"Test\", \"var2\": 123 }}",
        "time": "1570912912"
    }
}

SetSaveData

This method requires Access Token, Project ID and Client Key

API Url:

https://cp.ocugine.pro/api/cloud/set_save_data/

Request POST Params:

Parameter Type Description
app_id (required) double Project ID
app_key (required) string Project Client Key
access_token (required) string Player Access token with "cloud_data" grants
data (required) string Data to save in the cloud
uid double Set Save UID to update slot. If you want to create a new save, you can send "-1"

Response Example:

{
   "complete": true,
   "message": "",
   "data": []
}

RemoveSaveData

This method requires Access Token, Project ID and Client Key

API Url:

https://cp.ocugine.pro/api/cloud/remove_save_data/

Request POST Params:

Parameter Type Description
app_id (required) double Project ID
app_key (required) string Project Client Key
access_token (required) string Player Access token with "cloud_data" grants
uid (required) double Set Save UID to remove data

Response Example:

{
   "complete": true,
   "message": "",
   "data": []
}