Sort Me API
  • 👋Sort Me Documentation
  • API Methods
    • ⚰️Problems
    • 🚲Submissions
    • 🏆Contests
    • 📚Archives
    • ❤️Users
    • 🛰️Websocket
      • /listenSubmission
      • /contestEvents
    • 👾Miscellaneous
  • Tricky moments
    • 🛂Account limits
    • 🔑Authorization
    • 🗃️Pagination
    • 🈂️Localization
    • 🖼️Images
Powered by GitBook
On this page
  • Get user by handle or ID
  • Set user info
  1. API Methods

Users

API Methods at /users route

Get user by handle or ID

GET https://sort-me.org/api/users/getByHandle

Query Parameters

Name
Type
Description

handle

string

Either user ID or user handle. If not provided, get info about current logged in user.

{
    "id": 2,
    "handle": "Goosescout",
    "name": "Мейнер Аяки",
    "avatar": "https://pic.sort-me.org/b2e242fd-22e3-474a-977d-e7e8fe899470"",
    : 1639489500,
    "regal": {
        "rank_record": {
            "rank": 7,
            "updated": 1649357398
        },
        "statistics": {
            "difficulties": [
                8,   // problems with  easy        difficulty solved
                2,   //                medium
                2,   //                hard
                0,   //                very hard
                0    //                impossible
            ],
            "total": 12,
            "last_accepted": 1652013997
        },
        "awards": [
            {
                "title": "Sort Me Round №4 prize-winner",
                "type": 4,
                "date": 1644427496
            },
            {
                "title": "Sort Me Olymp 2022 winner",
                "type": 2,
                "date": 1649357744
            }
        ]
    },
    : true,
    : false,
    : false
}

Another example. For this user, regal is omitted, because he is literally Sort Me CEO:

{
    "id": 1,
    "handle": "sadfun",
    "name": "Степан",
    "bio": "CEO of Sort Me",
    "avatar": "https://pic.sort-me.org/bd62e50c-7cfa-40d8-9009-f4753d696289",
    "integrations": {
        "google": {
            "id": "105681184725682592659",
            "name": "mrstepushok@gmail.com"
        },
        "telegram": {
            "id": "187305243",
            "name": "@sadfun"
        }
    },
    "registered_at": 1614556800,
    "elite": true
}
{
    "id": 123,
    "handle": "sort_me_user",
    "name": "You",
    "bio": "(are the best)",
    "avatar": "https://pic.sort-me.org/bd62e50c-7cfa-40d8-9009-f4753d696289",
    "integrations": {
        "google": {
            "id": "105681184725682594212",
            "name": "admin@gmail.com"
        },
        "telegram": {
            "id": "187305240",
            "name": "@sortmefan"
        }
    },
    "regal": {
        "rank_record": {
            "rank": 7,
            "updated": 1649357398
        },
        "statistics": {
            "difficulties": [
                8,
                2,
                2,
                0,
                0
            ],
            "total": 12,
            "last_accepted": 1652013997
        },
        "awards": [
            {
                "title": "Sort Me Round №4 prize-winner",
                "type": 4,
                "date": 1644427496
            },
            {
                "title": "Sort Me Olymp 2022 winner",
                "type": 2,
                "date": 1649357744
            }
        ]
    },
    "registered_at": 1614556800,
}
{
    "error": "user not found"
}

Set user info

GET https://sort-me.org/api/users/setInfo

Update general info about user.

All fields are mandatory. If you don't want to change some of the attributes, just pass the current value.

Query Parameters

Name
Type
Description

handle*

string

Handle to set

name*

string

Name to set

user_id*

int

ID of the user you want to change. Actually, can only be your own ID.

bio*

string

Bio to set

avatar*

string

URL of the avatar to set. Must be on Sort Me servers.

{
    "id": 2,
    "handle": "Goosescout",
    "name": "Мейнер Аяки",
    "avatar": "https://pic.sort-me.org/b2e242fd-22e3-474a-977d-e7e8fe899470"",
    : 1639489500,
    "regal": {
        "rank_record": {
            "rank": 7,
            "updated": 1649357398
        },
        "statistics": {
            "difficulties": [
                8,   // problems with  easy        difficulty solved
                2,   //                medium
                2,   //                hard
                0,   //                very hard
                0    //                impossible
            ],
            "total": 12,
            "last_accepted": 1652013997
        },
        "awards": [
            {
                "title": "Sort Me Round №4 prize-winner",
                "type": 4,
                "date": 1644427496
            },
            {
                "title": "Sort Me Olymp 2022 winner",
                "type": 2,
                "date": 1649357744
            }
        ]
    },
    : true,
    : false,
    : false
}

Another example. For this user, regal is omitted, because he is literally Sort Me CEO:

{
    "id": 1,
    "handle": "sadfun",
    "name": "Степан",
    "bio": "CEO of Sort Me",
    "avatar": "https://pic.sort-me.org/bd62e50c-7cfa-40d8-9009-f4753d696289",
    "integrations": {
        "google": {
            "id": "105681184725682592659",
            "name": "mrstepushok@gmail.com"
        },
        "telegram": {
            "id": "187305243",
            "name": "@sadfun"
        }
    },
    "registered_at": 1614556800,
    "elite": true
}
{
    "id": 123,
    "handle": "sort_me_user",
    "name": "You",
    "bio": "(are the best)",
    "avatar": "https://pic.sort-me.org/bd62e50c-7cfa-40d8-9009-f4753d696289",
    "integrations": {
        "google": {
            "id": "105681184725682594212",
            "name": "admin@gmail.com"
        },
        "telegram": {
            "id": "187305240",
            "name": "@sortmefan"
        }
    },
    "regal": {
        "rank_record": {
            "rank": 7,
            "updated": 1649357398
        },
        "statistics": {
            "difficulties": [
                8,
                2,
                2,
                0,
                0
            ],
            "total": 12,
            "last_accepted": 1652013997
        },
        "awards": [
            {
                "title": "Sort Me Round №4 prize-winner",
                "type": 4,
                "date": 1644427496
            },
            {
                "title": "Sort Me Olymp 2022 winner",
                "type": 2,
                "date": 1649357744
            }
        ]
    },
    "registered_at": 1614556800,
}

Last updated 1 year ago

❤️
🔑
Authorization required