Skip to content
Tony Zhang edited this page Oct 28, 2022 · 1 revision

Account

  • Get basic info

    GET api/account/{uid}

    Parameters Type ...
    uid int required

    Code: 200

    Response example:

    {
        "res": {
            "id": 1,
            "username": "admin",
            "lang": "cxx;20,clang,O2",
            "solved": 0,
            "submit_time": 2,
            "email": "xxx@xxx.xxx",
            "is_staff": true,
            "is_superuser": true,
            "is_active": true,
            "is_judger": false,
            "date_joined": "2022-10-28T09:41:11.376156+08:00",
            "last_login": "2022-10-28T10:20:42.199346+08:00",
            "email_verified": true,
            "avatar_url": "https://raw.githubusercontent.com/segment-oj/segmentoj-icon/master/thick/thick-white/background/SOJ-thick-white-background.png"
        }
    }
  • Edit basic info

    PATCH api/account/{uid}

    Parameters Type ...
    uid int required

    Code: 204

    Request Example:

    {
        "lang": "cxx;17,clang,O2",
        "avatar_url": "https://raw.githubusercontent.com/segment-oj/segmentoj-icon/master/thick/thick-white/background/SOJ-thick-white-background.png"
        
    } 
  • Create user

    POST api/account

    Request requirements Type
    username string
    password string
    email string

    Code: 201

  • Get introduction

    GET api/account/{uid}/introduction

    Parameters Type ...
    uid int required

    Code: 200

    Response example:

    {
        "res": {
            "id": 1,
            "introduction": "# Hello world!"
        }
    }
  • Get extra data

Clone this wiki locally