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
  1. API Methods

Websocket

API methods at /wss route

Last updated 1 year ago

/wss/listenSubmission

This method can track submission judging almost in real-time.

Query parameters

Name
Description

id

ID of submission you want to listen for.

token

Your access token. Required here because WSS connections can't use headers.

language

Language required to get text verdict representation. Required here because WSS connections can't use headers.

When connection is established, you will start receiving plaintext numbers:

Thats a test number on which submission is being judged right now. You can display it as live counter, just as in sort-me.org after submission.

When judging is done, you receive a JSON with results in the same connection:

{
    "points": 100,
    "verdict": 1,
    "verdict_text": "Accepted",
    "worst_metrics": {
        "time": 25,
        "memory": 0
    },
    "subtasks": [
        {
            "points": 50,
            "worst_metrics": {
                "time": 25,
                "memory": 0
            }
        },
        {
            "points": 50,
            "worst_metrics": {
                "time": 19,
                "memory": 0
            }
        }
    ]
}
🛰️
Websocket connection in Chrome DevTools