Skip to content

API Endpoint for creating contests #102

@chipbell4

Description

@chipbell4

I would assume we would pass the API Key as a header: X-Judge-API-Key: ABC123, and then the POST body might contain something like:

{
    "name": "Practice 1/2/2018",
    "starts_at": "2018-01-02 01:02:03-05:00",
    "ends_at": "2018-01-02 01:02:03-05:00",
    "problems": [
        {
            "name" : "Problem A",
            "judging_input": "RAW TEXT",
            "judging_output": "RAW TEXT"
        },
        ...
    ]
}

Response value should probably be a 200:

{
    "contest_id": 234,
    "problem_id": [2, 5, ...]
}

where the problem ids are in the order of the problems you provided.

Validation should require at least one problem, and all fields to be provided. This endpoint is useless if there's no contest problems created

And the endpoint should maybe live at POST /api/v1/contests

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions