Leaderboard
    • PDF

    Leaderboard

    • PDF

    Article summary

    Leaderboard API

    Register leaderboard user score API

    Request

    • Method : POST
    • URI : https://gamepot.apigw.ntruss.com/gpapps/v2/leaderboardlogs
    POST
    url : https://gamepot.apigw.ntruss.com/gpapps/v2/leaderboardlogs
    Header : 'content-type: application/json'
    Header 'x-api-key: 86dcgffae0xxxxxxxxxxxxxx'
    Header : 'x-project-id: ec8231b2-6b20-4ad1-xxxx-xxxxxxxxx'
    data:
    {
         "leaderboardId" : "leaderboardId",
        "userId" : "70045665-f64a-45c0-xxxx-xxxxxxxxx",
        "score": 10,
        "subscore": 0,
        "metadata": "{\"key\":\"value\"}"
    }
    
    HeaderTypeRequiredDescription
    X-API-KEYStringOAuthentication key issued by GAMEPOT
    X-PROJECT-IDStringODashboard project ID
    AttributeTypeRequiredDescription
    leaderboardIdStringOLeaderboard unique ID generated in the dashboard
    userIdStringOUser ID
    scoreIntegerXScore
    subscoreIntegerXSubscore (not required)
    metadataStringXAdditional information

    Response

    Succeeded

    {
       "leaderboardlog": {
            "project_id": "ec8231b2-6b20-4ad1-xxxx-xxxxxxxxx",
            "id": "TGVhZGVyYm9hcmRMb2c6NjNkMzRhYTgxxxxxxxxx",
            "user_id": "70045665-f64a-45c0-xxxx-xxxxxxxxx",
            "score": 10,
            "subscore": 0,
            "metadata": "{\"key\":\"value\"}",
            "expiredAt": "2023-01-30T20:00:00-08:00"
        }
    }
    
    AttributeTypeDescription
    statusIntResult value \ (-1 fail )
    messageStringError message
    leaderboardlog.project_idStringProject ID
    leaderboardlog.idStringInput ID
    leaderboardlog.user_idStringUser ID
    leaderboardlog.scoreIntScore
    leaderboardlog.subscoreIntSubscore
    leaderboardlog.metadataIntUser created data
    leaderboardlog.expiredAtStringExpiry date

    Failure

    {
        "status": -1,
        "message": "Registration failed"
    }
    
    AttributeTypeDescription
    codeIntResult \ (1: success, refer to the error code in case of failure )
    errorStringError message

    Retrieve user score from leaderboard API

    Request

    • Method : GET
    • URI : https://gamepot.apigw.ntruss.com/gpapps/v2/leaderboardlogs
    GET
    url : https://gamepot.apigw.ntruss.com/gpapps/v2/leaderboardlogs
    Header : 'content-type: application/json'
    Header 'x-api-key: 86dcgffae0xxxxxxxxxxxxxx'
    Header : 'x-project-id: ec8231b2-6b20-4ad1-xxxx-xxxxxxxxx'
    data:
    {
         "leaderboardId" : "leaderboardId",
        "offset": 0,
        "per_page": 20
    }
    
    HeaderTypeRequiredDescription
    X-API-KEYStringOAuthentication key issued by GAMEPOT
    X-PROJECT-IDStringODashboard project ID
    AttributeTypeRequiredDescription
    leaderboardIdStringOLeaderboard unique ID generated in the dashboard
    offsetIntegerXOFFSET
    per_pageIntegerXLIMIT

    Response

    Succeeded

    [
        {
            "rank": 1,
            "leaderboard_id": "leaderboardId",
            "user_id": "9c510599-f77a-4e3e-xxxxxx-xxxxxxx",
             "project_id": "ec8231b2-6b20-4ad1-9c59-xxxxxxxxxxx",
            "score": 1100,
            "subscore": 0,
            "metadata": "{\"key\":\"value\"}",
            "expiredAt": "2023-01-30T20:00:00-08:00",
            "updatedAt": "2023-01-26T19:46:07-08:00"
        },
        {
            "rank": 2,
            "leaderboard_id": "leaderboardId",
            "user_id": "63ae4ac9-a0f4-4fba-xxxx-xxxxxxxx",
            "project_id": "ec8231b2-6b20-4ad1-9c59-xxxxxxxxxxx",
            "score": 1000,
            "subscore": 0,
            "metadata": "{\"key\":\"value\"}",
            "expiredAt": "2023-01-30T20:00:00-08:00",
            "updatedAt": "2023-01-26T19:45:58-08:00"
        },
    ]
      
    
    AttributeTypeDescription
    statusIntResult value \ (-1 fail )
    messageStringError message
    rankIntRanking
    project_idStringProject ID
    leaderboardIdStringLeaderboard unique ID generated in the dashboard
    user_idStringUser ID
    scoreIntScore
    subscoreIntSubscore
    metadataIntUser created data
    updatedAtStringUpdated date
    expiredAtStringExpiration date

    Failure

    {
        "status": -1,
        "message": "Failure to search"
    }
    
    AttributeTypeDescription
    statusIntResult \ (refer to the error code in case of failure )
    messageStringError message

    Retrieve score with specific keyword API

    Request

    • Method : GET
    • URI : https://gamepot.apigw.ntruss.com/gpapps/v2/leaderboardlogs

    Search with ID

    GET
    url : https://gamepot.apigw.ntruss.com/gpapps/v2/leaderboardlogs
    Header : 'content-type: application/json'
    Header 'x-api-key: 86dcgffae0xxxxxxxxxxxxxx'
    Header : 'x-project-id: ec8231b2-6b20-4ad1-xxxx-xxxxxxxxx'
    data:
    {
         "leaderboardId" : "leaderboardId",
         "search" : "user_id",
         "query" : "f1deb103-cae1-47dd-b0aa-xxxxxxxxxx",
        "offset": 0,
        "per_page": 20
    }
    

    Search with SCORE range

    GET
    url : https://gamepot.apigw.ntruss.com/gpapps/v2/leaderboardlogs
    Header : 'content-type: application/json'
    Header 'x-api-key: 86dcgffae0xxxxxxxxxxxxxx'
    Header : 'x-project-id: ec8231b2-6b20-4ad1-xxxx-xxxxxxxxx'
    data:
    {
         "leaderboardId" : "leaderboardId",
         "search" : "score",
         "query" : "99-120",
        "offset": 0,
        "per_page": 20
    }
    
    HeaderTypeRequiredDescription
    X-API-KEYStringOAuthentication key issued by GAMEPOT
    X-PROJECT-IDStringODashboard project ID
    AttributeTypeRequiredDescription
    leaderboardIdStringOLeaderboard unique ID generated in the dashboard
    offsetIntegerXOFFSET
    per_pageIntegerXLIMIT

    Response

    Succeeded

    [
        {
            "rank": 5,
            "leaderboard_id": "leaderboardId",
            "user_id": "f1deb103-cae1-47dd-b0aa-xxxxxx",
            "project_id": "ec8231b2-6b20-4ad1-9c59-xxxxxxxxx",
            "score": 99,
            "subscore": 100,
            "metadata": "{\"key\":\"value\"}",
            "expiredAt": "2023-01-30T20:00:00-08:00",
            "updatedAt": "2023-01-26T16:23:39-08:00"
        }
    ]
      
    

    Failure

    {
        "status": -1,
        "message": "Error message"
    }
    
    AttributeTypeDescription
    statusIntResult \ (refer to the error code in case of failure )
    messageStringError message

    Retrieve leaderboard information and user count API

    Request

    • Method : GET
    • URI : https://gamepot.apigw.ntruss.com/gpapps/v2/leaderboards?/{leaderboardId}?offset=0&per_page=10
    GET
    url : https://gamepot.apigw.ntruss.com/gpapps/v2/leaderboard
    Header 'x-api-key: 86dcgffae0xxxxxxxxxxxxxx'
    Header : 'x-project-id: ec8231b2-6b20-4ad1-xxxx-xxxxxxxxx'
    
    HeaderTypeRequiredDescription
    X-API-KEYStringOAuthentication key issued by GAMEPOT
    X-PROJECT-IDStringODashboard project ID
    AttributeTypeRequiredDescription
    leaderboardIdStringOLeaderboard unique ID generated in the dashboard
    offsetIntegerXOFFSET
    per_pageIntegerXLIMIT

    Response

    Succeeded

    [
        {
            "status": true,
            "ranking": "best",
            "tie_breaking": "first",
            "id": "TGVhZGVyYm9hcmQ6YXNkYWRhZHNhZHNh",
            "name": "test",
            "description": "TEST",
            "descending": true,
            "resetDay": 0,
            "resetTime": "00:00",
            "resetDate": 1,
            "startedAt": "2023-01-25T12:09:47-08:00",
            "timezone": "America/Kralendijk",
            "project_id": "ec8231b2-6b20-4ad1-9c59-8e183087a742",
            "period_type": "monthly",
            "icon_url": "sdadasds",
            "user_count": 28,
        }
    ]
      
    
    AttributeTypeRequiredDescription
    idStringOLeaderboard unique ID
    projectIdStringOProject ID
    statusBooleanOCondition
    is_check_userBooleanXWhether to check the user ID
    nameStringXLeaderboard name
    descriptionStringXDescription
    icon_urlStringXIcon URL
    descendingBooleanXSort
    startedAtStringXStart date
    expiredAtStringXEnd date (if seasonal)
    timezoneStringXTime zone
    period_typeStringXCycle (daily, weekly, monthly, season)
    resetDayIntegerXReset day 1: Sun, 2: Mon, 3: Tue, 4: Wed, 5: Thu, 6: Fri, 7: Sat (where the periodType is weekly)
    resetTimeStringXReset time
    resetDateIntegerXReset date 1-31 (where the periodType is monthly)
    rankingStringORanking update criteria (latest, accumulated, best)
    tie_breakingStringOTie breaker (first, last)

    Failure

    {
        "status": -1,
        "message": "Error message"
    }
    
    AttributeTypeDescription
    statusIntResult \ (refer to the error code in case of failure )
    messageStringError message

    Search user score in leaderboard API

    Request

    • Method : GET
    • URI : https://gamepot.apigw.ntruss.com/gpapps/v2/leaderboard/{leaderboardID}/user{userid}
    GET
    url : https://gamepot.apigw.ntruss.com/gpapps/v2/leaderboard
    Header 'x-api-key: 86dcgffae0xxxxxxxxxxxxxx'
    Header : 'x-project-id: ec8231b2-6b20-4ad1-xxxx-xxxxxxxxx'
    
    
    HeaderTypeRequiredDescription
    X-API-KEYStringOAuthentication key issued by GAMEPOT
    X-PROJECT-IDStringODashboard project ID
    AttributeTypeRequiredDescription
    leaderboardIDStringOLeaderboard unique ID generated in the dashboard
    useridStringOUser ID

    Response

    Succeeded

    {
    	"rank": 1,
    	"leaderboard_id": "leaderboardID",
    	"user_id": "8f372bf4-XXXX-XXXX-XXXX-XXXXXXXX",
    	"project_id": "ec8231b2-6b20-4ad1-XXXX-XXXXXXXX",
    	"score": 1,
    	"prev_score": null,
    	"subscore": 10,
    	"metadata": "",
    	"user_count": 2,
    	"expiredAt": "2023-01-30T17:00:00+09:00",
    	"updatedAt": "2023-01-30T11:55:37+09:00"
    }
      
    
    AttributeTypeDescription
    statusIntResult value \ (-1 fail )
    messageStringError message
    rankIntRanking
    project_idStringProject ID
    leaderboardIdStringLeaderboard unique ID generated in the dashboard
    user_idStringUser ID
    scoreIntScore
    subscoreIntSubscore
    metadataIntUser created data
    updatedAtStringUpdated date
    expiredAtStringExpiration date

    Failure

    {
        "status": -1,
        "message": "Error message"
    }
    
    AttributeTypeDescription
    statusIntResult \ (refer to the error code in case of failure )
    messageStringError message

    Delete user registered in leaderboard API

    Request

    • Method : DELETE
    • URI : https://gamepot.apigw.ntruss.com/gpapps/v2/leaderboardlogs
    DELETE
    url : https://gamepot.apigw.ntruss.com/gpapps/v2/leaderboardlogs
    Header : 'content-type: application/json'
    Header 'x-api-key: 86dcgffae0xxxxxxxxxxxxxx'
    Header : 'x-project-id: ec8231b2-6b20-4ad1-xxxx-xxxxxxxxx'
    data:
    {
         "leaderboardId" : "leaderboardId",
         "userId" : "560963c3-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    }
    
    HeaderTypeRequiredDescription
    X-API-KEYStringOAuthentication key issued by GAMEPOT
    X-PROJECT-IDStringODashboard project ID
    AttributeTypeRequiredDescription
    leaderboardIdStringXLeaderboard ID
    userIdStringXLeaderboard user ID

    Response

    Succeeded

    [
        {
            "leaderboard_id": "leaderboardId",
            "user_id": "f1deb103-cae1-47dd-b0aa-xxxxxx",
            "project_id": "ec8231b2-6b20-4ad1-9c59-xxxxxxxxx",
            "score": 99,
            "subscore": 100,
            "metadata": "{\"key\":\"value\"}",
            "expiredAt": "2023-01-30T20:00:00-08:00",
            "updatedAt": "2023-01-26T16:23:39-08:00"
        }
    ]
      
    
    AttributeTypeDescription
    statusIntResult value \ (-1 fail )
    messageStringError message
    project_idStringProject ID
    leaderboardIdStringLeaderboard unique ID generated in the dashboard
    user_idStringUser ID
    scoreIntScore
    subscoreIntSubscore
    metadataIntUser created data
    updatedAtStringUpdated date
    expiredAtStringExpiration date

    Failure

    {
        "status": -1,
        "message": "Error message"
    }
    
    AttributeTypeDescription
    statusIntResult \ (refer to the error code in case of failure )
    messageStringError message

    Register leaderboard API

    Request

    • Method : POST
    • URI : https://gamepot.apigw.ntruss.com/gpapps/v2/leaderboards
    POST
    url : https://gamepot.apigw.ntruss.com/gpapps/v2/leaderboards
    Header : 'content-type: application/json'
    Header 'x-api-key: 86dcgffae0xxxxxxxxxxxxxx'
    Header : 'x-project-id: ec8231b2-6b20-4ad1-xxxx-xxxxxxxxx'
    data:
    {
        "id" : "leaderboardId",
        "status": true,
        "name": "name",
        "description": "description",
        "iconUrl" : "icon_url",
        "descending": true,
        "startedAt" : "2023-01-22 13:00:00",
        "timezone" : "Asia/Seoul",
        "periodType" : "weekly",
        "resetDay": 1,
        "resetDate": 1,
        "resetTime" : "00:01:01",
        "ranking" : "latest", 
        "tie_breaking" : "first"
    }
    
    HeaderTypeRequiredDescription
    X-API-KEYStringOAuthentication key issued by GAMEPOT
    X-PROJECT-IDStringODashboard project ID
    AttributeTypeRequiredDescription
    idStringOLeaderboard unique ID
    projectIdStringOProject ID
    statusBooleanOCondition
    is_check_userBooleanXWhether to check the user ID
    nameStringXLeaderboard name
    descriptionStringXDescription
    iconUrlStringXIcon URL
    descendingBooleanXSort
    startedAtStringXStart date
    expiredAtStringXEnd date (if seasonal)
    timezoneStringXTime zone
    period_typeStringXCycle (daily, weekly, monthly, season)
    resetDayIntegerXReset day 1: Sun, 2: Mon, 3: Tue, 4: Wed, 5: Thu, 6: Fri, 7: Sat (where the periodType is weekly)
    resetTimeStringXReset time
    resetDateIntegerXReset date 1-31 (where the periodType is monthly)
    rankingStringORanking update criteria (latest, accumulated, best)
    tie_breakingStringOTie breaker (first, last)

    Response

    Succeeded

    {
       "leaderboard": {
            "status": true,
            "is_check_user": true,
            "ranking": "latest",
            "tie_breaking": "first",
            "id": "TGVhZGVyYm9hcmQ6ZHNzZGFkMTIyMjIyMTJhZA==",
            "name": "name",
            "description": "description",
            "descending": true,
            "resetDay": 1,
            "resetTime": "00:01:01",
            "resetDate": 1,
            "startedAt": "2023-01-22T13:00:00-08:00",
            "expiredAt": "2023-11-22T13:00:00-08:00",
            "timezone": "Asia/Seoul",
            "project_id": "ec8231b2-6b20-4ad1-9c59-8e183087a742",
            "period_type": "weekly",
            "icon_url": "icon_url",
            "user_count": null,
            "updatedAt": "2023-02-01T15:52:24-08:00",
            "createdAt": "2023-02-01T15:52:24-08:00"
        }
    }
    
    AttributeTypeRequiredDescription
    idStringOLeaderboard unique ID
    projectIdStringOProject ID
    statusBooleanOCondition
    is_check_userBooleanXWhether to check the user ID
    nameStringXLeaderboard name
    descriptionStringXDescription
    icon_urlStringXIcon URL
    descendingBooleanXSort
    startedAtStringXStart date
    expiredAtStringXEnd date (if seasonal)
    timezoneStringXTime zone
    period_typeStringXCycle (daily, weekly, monthly, season)
    resetDayIntegerXReset day 1: Sun, 2: Mon, 3: Tue, 4: Wed, 5: Thu, 6: Fri, 7: Sat (where the periodType is weekly)
    resetTimeStringXReset time
    resetDateIntegerXReset date 1-31 (where the periodType is monthly)
    rankingStringORanking update criteria (latest, accumulated, best)
    tie_breakingStringOTie breaker (first, last)

    Failure

     "status": -1,
    "message": "Error message"
    
    AttributeTypeDescription
    codeIntResult \ (1: success, refer to the error code in case of failure )
    errorStringError message

    Edit leaderboard API

    Request

    • Method : PUT
    • URI : https://gamepot.apigw.ntruss.com/gpapps/v2/leaderboards/{leaderboardId}
    PUT
    url : https://gamepot.apigw.ntruss.com/gpapps/v2/leaderboards/{leaderboardId}
    Header : 'content-type: application/json'
    Header 'x-api-key: 86dcgffae0xxxxxxxxxxxxxx'
    Header : 'x-project-id: ec8231b2-6b20-4ad1-xxxx-xxxxxxxxx'
    data:
    {
        "status": true,
        "name": "name",
        "description": "description",
        "iconUrl" : "icon_url",
        "descending": true,
        "startedAt" : "2023-01-22 13:00:00",
        "timezone" : "Asia/Seoul",
        "periodType" : "weekly",
        "resetDay": 1,
        "resetDate": 1,
        "resetTime" : "00:01:01",
        "ranking" : "latest", 
        "tie_breaking" : "first"
    }
    
    HeaderTypeRequiredDescription
    X-API-KEYStringOAuthentication key issued by GAMEPOT
    X-PROJECT-IDStringODashboard project ID
    AttributeTypeRequiredDescription
    leaderboardIdStringOLeaderboard unique ID
    statusBooleanOCondition
    is_check_userBooleanXWhether to check the user ID
    nameStringXLeaderboard name
    descriptionStringXDescription
    icon_urlStringXIcon URL
    descendingBooleanXSort
    startedAtStringXStart date
    expiredAtStringXEnd date (if seasonal)
    timezoneStringXTime zone
    period_typeStringXCycle (daily, weekly, monthly, season)
    resetDayIntegerXReset day 1: Sun, 2: Mon, 3: Tue, 4: Wed, 5: Thu, 6: Fri, 7: Sat (where the periodType is weekly)
    resetTimeStringXReset time
    resetDateIntegerXReset date 1-31 (where the periodType is monthly)
    rankingStringORanking update criteria (latest, accumulated, best)
    tie_breakingStringOTie breaker (first, last)

    Response

    Succeeded

    {
       "leaderboard": {
            "status": true,
            "is_check_user": true,
            "ranking": "latest",
            "tie_breaking": "first",
            "id": "TGVhZGVyYm9hcmQ6ZHNzZGFkMTIyMjIyMTJhZA==",
            "name": "name",
            "description": "description",
            "descending": true,
            "resetDay": 1,
            "resetTime": "00:01:01",
            "resetDate": 1,
            "startedAt": "2023-01-22T13:00:00-08:00",
            "expiredAt": "2023-11-22T13:00:00-08:00",
            "timezone": "Asia/Seoul",
            "project_id": "ec8231b2-6b20-4ad1-9c59-8e183087a742",
            "period_type": "weekly",
            "icon_url": "icon_url",
            "user_count": null,
            "updatedAt": "2023-02-01T15:52:24-08:00",
            "createdAt": "2023-02-01T15:52:24-08:00"
        }
    }
    
    AttributeTypeRequiredDescription
    idStringOLeaderboard unique ID
    projectIdStringOProject ID
    statusBooleanOCondition
    is_check_userBooleanXWhether to check the user ID
    nameStringXLeaderboard name
    descriptionStringXDescription
    icon_urlStringXIcon URL
    descendingBooleanXSort
    startedAtStringXStart date
    expiredAtStringXEnd date (if seasonal)
    timezoneStringXTime zone
    period_typeStringXCycle (daily, weekly, monthly, season)
    resetDayIntegerXReset day 1: Sun, 2: Mon, 3: Tue, 4: Wed, 5: Thu, 6: Fri, 7: Sat (where the periodType is weekly)
    resetTimeStringXReset time
    resetDateIntegerXReset date 1-31 (where the periodType is monthly)
    rankingStringORanking update criteria (latest, accumulated, best)
    tie_breakingStringOTie breaker (first, last)

    Failure

     "status": -1,
    "message": "Error message"
    
    AttributeTypeDescription
    codeIntResult \ (1: success, refer to the error code in case of failure )
    errorStringError message

    Delete leaderboard API

    Request

    • Method : DELETE
    • URI : https://gamepot.apigw.ntruss.com/gpapps/v2/leaderboards/{leaderboardId}
    DELETE
    url : https://gamepot.apigw.ntruss.com/gpapps/v2/leaderboards/leaderboardId
    Header 'x-api-key: 86dcgffae0xxxxxxxxxxxxxx'
    Header : 'x-project-id: ec8231b2-6b20-4ad1-xxxx-xxxxxxxxx'
    
    
    HeaderTypeRequiredDescription
    X-API-KEYStringOAuthentication key issued by GAMEPOT
    X-PROJECT-IDStringODashboard project ID
    AttributeTypeRequiredDescription
    leaderboardIdStringOLeaderboard unique ID

    Response

    Succeeded

    {
       "leaderboard": {
            "status": true,
            "is_check_user": true,
            "ranking": "latest",
            "tie_breaking": "first",
            "id": "TGVhZGVyYm9hcmQ6ZHNzZGFkMTIyMjIyMTJhZA==",
            "name": "name",
            "description": "description",
            "descending": true,
            "resetDay": 1,
            "resetTime": "00:01:01",
            "resetDate": 1,
            "startedAt": "2023-01-22T13:00:00-08:00",
            "expiredAt": "2023-11-22T13:00:00-08:00",
            "timezone": "Asia/Seoul",
            "project_id": "ec8231b2-6b20-4ad1-9c59-8e183087a742",
            "period_type": "weekly",
            "icon_url": "icon_url",
            "user_count": null,
            "updatedAt": "2023-02-01T15:52:24-08:00",
            "createdAt": "2023-02-01T15:52:24-08:00"
        }
    }
    

    Succeeded

    AttributeTypeRequiredDescription
    idStringOLeaderboard unique ID
    projectIdStringOProject ID
    statusBooleanOCondition
    is_check_userBooleanXWhether to check the user ID
    nameStringXLeaderboard name
    descriptionStringXDescription
    icon_urlStringXIcon URL
    descendingBooleanXSort
    startedAtStringXStart date
    expiredAtStringXEnd date (if seasonal)
    timezoneStringXTime zone
    period_typeStringXCycle (daily, weekly, monthly, season)
    resetDayIntegerXReset day 1: Sun, 2: Mon, 3: Tue, 4: Wed, 5: Thu, 6: Fri, 7: Sat (where the periodType is weekly)
    resetTimeStringXReset time
    resetDateIntegerXReset date 1-31 (where the periodType is monthly)
    rankingStringORanking update criteria (latest, accumulated, best)
    tie_breakingStringOTie breaker (first, last)

    Failure

     "status": -1,
    "message": "Error message"
    
    AttributeTypeDescription
    codeIntResult \ (1: success, refer to the error code in case of failure )
    errorStringError message

    Was this article helpful?

    What's Next
    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.