Players

The player model

The player model contains public information about a player, such as their username and rank.

Properties

  • Name
    id
    Type
    string
    Description

    The MongoDB ObjectID of the player

  • Name
    identityId
    Type
    ObjectId
    Description

    The Identity Id of a player, common across all their alts. This trascends Minecraft IGN and represents a "person", regardless of what account they are on.

  • Name
    name
    Type
    string
    Description

    The in-game name of the player. This is only updated when a player logs in, so there isn't a guarantee that the name returned by the API would be the same as the name returned by Mojang's API.

  • Name
    uuid
    Type
    string
    Description

    The Minecraft UUID of the player.

  • Name
    rank
    Type
    string
    Description

    The rank of the player.

  • Name
    discordId
    Type
    integer
    Description

    The ID of the player's linked Discord account.


GET/players

List all players

This endpoint allows you to retrieve a list of all players on Loka.

Optional Attributes

  • Name
    size
    Type
    integer
    Description
    Limit the number of players returned.
  • Name
    page
    Type
    integer
    Description
    Page of players to return.

Request

GET
/players
const axios = require('axios');

axios.get('https://api.lokamc.com/players')
    .then((response) => console.log(response.data));

Response

{
    _embedded: {
        players: [
        {
            "id": "5462b7c5e4b0cad9a0f3e6a4",
            "name": "Cryptite",
            "rank": "elder",
            "uuid": "b72542e7-3f35-4c29-9290-2b2032e9d98c",
            "discordId": "138419767567450112",
        }
        {
            "id": "54499df8e4b075a62477692b"
            // ...
        }
        ]
    },
    page: {
        size: 20,
        totalElements: 50000,
        totalPages: 2500,
        number: 0
    }
}

GET/players/search/findByName

Find a player by name

This endpoint allows you to retrieve a Player by providing their name.

Required attributes

  • Name
    name
    Type
    string
    Description

    The name of the player to retrieve.

Request

GET
/players/search/findByName
const axios = require('axios');

axios.get('https://api.lokamc.com/players/search/findByName', {
    params: { name: 'Cryptite' }
}).then((response) => console.log(response.data));

Response

{
    "id": "5462b7c5e4b0cad9a0f3e6a4",
    "identityId": "5462b7c5e4b0cad9a0f3e6a4",
    "name": "Cryptite",
    "rank": "elder",
    "uuid": "b72542e7-3f35-4c29-9290-2b2032e9d98c",
    "discordId": "138419767567450112",
}

GET/players/search/findByUuid

Find a player by UUID

This endpoint allows you to retrieve a Player by providing their Minecraft UUID.

Required attributes

  • Name
    uuid
    Type
    string
    Description

    The UUID of the player to retrieve.

Request

GET
/players/search/findByUuid
const axios = require('axios');

axios.get('https://api.lokamc.com/players/search/findByUuid', {
    params: { uuid: 'b72542e7-3f35-4c29-9290-2b2032e9d98c' }
}).then((response) => console.log(response.data));

Response

{
    "id": "5462b7c5e4b0cad9a0f3e6a4",
    "identityId": "5462b7c5e4b0cad9a0f3e6a4",
    "name": "Cryptite",
    "rank": "elder",
    "uuid": "b72542e7-3f35-4c29-9290-2b2032e9d98c",
    "discordId": "138419767567450112",
}