Gaming Object

Introduction

This object allows you to work with dozens of gaming objects. You can work with achievements, teams, multiplayer, leaderboards, missions, etc. If you have some additional questions - go to the Ocugine Forums.

Gaming Object Methods

Leaderboards:

Achievements:

Missions:


Leaderboards

GetLeaderboards

This method requires Project ID and Client Key

API Url:

https://cp.ocugine.pro/api/gaming/get_leaderboards/

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": "Players Dies",
                "desc": "Players with the fewest deaths",
                "image": "https://cp.ocugine.pro/storage/6249146/704733.jpg",
                "ordering": "1",
                "time": "1569192952",
                "players": 0,
                "top": []
            },
            {
                "uid": "1",
                "project_id": "59",
                "name": "Best Players",
                "desc": "This is a best players leaderboard for our game",
                "image": "https://cp.ocugine.pro/storage/1425394/7595419.jpg",
                "ordering": "1",
                "time": "1568938359",
                "players": 2,
                "top": []
            }
        ]
    }
}

GetLeaderboardData

This method requires Project ID and Client Key

API Url:

https://cp.ocugine.pro/api/gaming/get_leaderboard_info/

Request POST Params:

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

Response Example:

{
    "complete": true,
    "message": "",
    "data": {
        "data": {
            "uid": "1",
            "project_id": "59",
            "name": "Best Players",
            "desc": "This is a best players leaderboard for our game",
            "image": "https://cp.ocugine.pro/storage/1425394/7595419.jpg",
            "ordering": "1",
            "time": "1568938359"
        }
    }
}

GetPlayersTop

This method requires Project ID and Client Key

API Url:

https://cp.ocugine.pro/api/gaming/get_players_top/

Request POST Params:

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

Response Example:

{
    "complete": true,
    "message": "",
    "data": {
        "list": [
            {
                "uid": "1",
                "project_id": "59",
                "profile_uid": "17",
                "scores": "500",
                "board_id": "1",
                "time": "1569193074",
                "profile": {
                    "uid": "17",
                    "first_name": "Ocugine",
                    "last_name": "Platform",
                    "avatar": "https://cp.ocugine.pro/storage/7111462/6325127.jpg",
                    "email": "[email protected]",
                    "profile_data": "",
                    "profile_type": "1"
                }
            },
            {
                "uid": "2",
                "project_id": "59",
                "profile_uid": "18",
                "scores": "400",
                "board_id": "1",
                "time": "0",
                "profile": {
                    "uid": "18",
                    "first_name": "Ocugine",
                    "last_name": "Platform",
                    "avatar": "",
                    "email": "[email protected]",
                    "profile_data": "",
                    "profile_type": "1"
                }
            }
        ]
    }
}

GetBoardScores

This method requires Access Token, Project ID and Client Key

API Url:

https://cp.ocugine.pro/api/gaming/get_board_scores/

Request POST Params:

Parameter Type Description
app_id (required) double Project ID
app_key (required) string Project Client Key
uid (required) double Leaderboard UID
access_token (required) string Player Access Token

Response Example:

{
    "complete": true,
    "message": "",
    "data": {
        "uid": "1",
        "project_id": "59",
        "profile_uid": "17",
        "scores": "500",
        "board_id": "1",
        "time": "1569193074"
    }
}

SetBoardScores

This method requires Access Token, Project ID and Client Key

API Url:

https://cp.ocugine.pro/api/gaming/set_board_scores/

Request POST Params:

Parameter Type Description
app_id (required) double Project ID
app_key (required) string Project Client Key
uid (required) double Leaderboard UID
access_token (required) string Player Access Token
scores (required) double Scores to set for this Player in this Leaderboard

Response Example:

{
    "complete": true,
    "message": "",
    "data": null
}

Achievements

GetAchievements

This method requires Project ID and Client Key

API Url:

https://cp.ocugine.pro/api/gaming/get_achievements/

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": "2",
                "project_id": "59",
                "name": "Achievement",
                "desc": "Test",
                "image": "https://cp.ocugine.pro/storage/6249146/704733.jpg",
                "time": "1569193114",
                "players": 1
            },
            {
                "uid": "4",
                "project_id": "59",
                "name": "New Achievement",
                "desc": "Second Achievement",
                "image": "https://cp.ocugine.pro/storage/1425394/7595419.jpg",
                "time": "1569193104",
                "players": 0
            }
        ]
    }
}

GetAchievementData

This method requires Project ID and Client Key

API Url:

https://cp.ocugine.pro/api/gaming/get_achievement_info/

Request POST Params:

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

Response Example:

{
    "complete": true,
    "message": "",
    "data": {
        "uid": "2",
        "project_id": "59",
        "name": "Achievement",
        "desc": "Test",
        "image": "https://cp.ocugine.pro/storage/6249146/704733.jpg",
        "time": "1569193114"
    }
}

GetPlayerAchievements

This method requires Access Token, Project ID and Client Key

API Url:

https://cp.ocugine.pro/api/gaming/get_player_achievements/

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

Response Example:

{
    "complete": true,
    "message": "",
    "data": {
        "list": [
            {
                "uid": "2",
                "project_id": "59",
                "achiv_id": "2",
                "profile_uid": "17",
                "time": "1569192890",
                "info": {
                    "uid": "2",
                    "project_id": "59",
                    "name": "Achievement",
                    "desc": "Test",
                    "image": "https://cp.ocugine.pro/storage/6249146/704733.jpg",
                    "time": "1569193114"
                }
            }
        ]
    }
}

UnlockPlayerAchievement

This method requires Access Token, Project ID and Client Key

API Url:

https://cp.ocugine.pro/api/gaming/unlock_player_achievement/

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
uid (required) double Achievement UID to Unlock

Response Example:

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

Missions

GetMissions

This method requires Project ID and Client Key

API Url:

https://cp.ocugine.pro/api/gaming/get_missions/

Request POST Params:

Parameter Type Description
app_id (required) double Project ID
app_key (required) string Project Client Key
search string Search by mission name or description
page double Page index (pagination) for the list

Response Example:

{
    "complete": true,
    "message": "",
    "data": {
        "list": [
            {
                "uid": "2",
                "project_id": "59",
                "name": "Mission #2",
                "desc": "This is a demo mission #2",
                "image": "https://cp.ocugine.pro/storage/4494614/5928202.jpg",
                "counter": "1",
                "next_mission": "0",
                "time": "1569274672",
                "players": 1
            },
            {
                "uid": "1",
                "project_id": "59",
                "name": "Mission #1",
                "desc": "This is a demo mission #1",
                "image": "https://cp.ocugine.pro/storage/4494614/5928202.jpg",
                "counter": "2",
                "next_mission": "2",
                "time": "1569274958",
                "players": 1
            }
        ]
    }
}

GetMissionData

This method requires Project ID and Client Key

API Url:

https://cp.ocugine.pro/api/gaming/get_mission_info/

Request POST Params:

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

Response Example:

{
    "complete": true,
    "message": "",
    "data": {
        "uid": "2",
        "project_id": "59",
        "name": "Mission #2",
        "desc": "This is a demo mission #2",
        "image": "https://cp.ocugine.pro/storage/4494614/5928202.jpg",
        "counter": "1",
        "next_mission": "0",
        "time": "1569274672"
    }
}

GetPlayerMissionsList

This list is returns only active player missions
This method requires Access Token, Project ID and Client Key

API Url:

https://cp.ocugine.pro/api/gaming/get_player_missions/

Request POST Params:

Parameter Type Description
app_id (required) double Project ID
app_key (required) string Project Client Key
access_token (required) string Access Token for this Player

Response Example:

{
    "complete": true,
    "message": "",
    "data": {
        "list": [
            {
                "uid": "4",
                "project_id": "59",
                "profile_uid": "17",
                "mission_id": "1",
                "counter": "1",
                "completed": "0",
                "time": "1569277545",
                "mission_data": {
                    "uid": "1",
                    "project_id": "59",
                    "name": "Mission #1",
                    "desc": "This is a demo mission #1",
                    "image": "https://cp.ocugine.pro/storage/4494614/5928202.jpg",
                    "counter": "2",
                    "next_mission": "2",
                    "time": "1569274958"
                }
            }
        ]
    }
}

AddMissionToPlayerList

This method requires Access Token, Project ID and Client Key

API Url:

https://cp.ocugine.pro/api/gaming/set_player_mission/

Request POST Params:

Parameter Type Description
app_id (required) double Project ID
app_key (required) string Project Client Key
access_token (required) string Access Token for this Player
uid (required) double Mission UID

Response Example:

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

RemoveMission

This method requires Access Token, Project ID and Client Key

API Url:

https://cp.ocugine.pro/api/gaming/remove_player_mission/

Request POST Params:

Parameter Type Description
app_id (required) double Project ID
app_key (required) string Project Client Key
access_token (required) string Access Token for this Player
uid (required) double Mission UID

Response Example:

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

SetMissionScores

This method requires Access Token, Project ID and Client Key

API Url:

https://cp.ocugine.pro/api/gaming/set_mission_scores/

Request POST Params:

Parameter Type Description
app_id (required) double Project ID
app_key (required) string Project Client Key
access_token (required) string Access Token for this Player
uid (required) double Mission UID
scores (required) double Scores to set for this mission by Player UID and Mission UID

Response Example:

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