-
Notifications
You must be signed in to change notification settings - Fork 5
CTFOJ API
This page describes CTFOJ's API and how to use it. All endpoints labelled with signify that they need to be authenticated. To make an authenticated request, include a session cookie in the request header.*
* Starting in v3.0.0, API tokens will be provided to users to use instead.
Found a bug? File a bug report here
All Markdown responses will return a Markdown file containing the requested Markdown content.
Request (curl):
curl --cookie "session=30b39c5e-1e7b-42a5-b7e8-fbd61a0df57f" \
http://127.0.0.1:5000/api/problem/description/helloworld
Response:
Here's a sample Hello World problem. It can include [links](https://www.youtube.com/watch?v=dQw4w9WgXcQ) because it uses Markdown!
The flag for this problem is: `CTF{welcome_to_ctf_club}`
This endpoint is used to get the problem description with the specified problem id.
Status Code | Meaning | Response Format |
---|---|---|
401 | You are unauthorized; make sure you have included a valid session cookie in your request | None |
404 | The problem referenced by the problem_id does not exist | None |
200 | The request has succeeded | Markdown |
This endpoint is used to get any hints associated with the specified problem id. If there are no hints, the response body will be empty.
Status Code | Meaning | Response Format |
---|---|---|
401 | You are unauthorized; make sure you have included a valid session cookie in your request | None |
404 | The problem referenced by the problem_id does not exist | None |
200 | The request has succeeded | Markdown |
This endpoint is used to get the editorial associated with the specified problem id. If the problem does not have an editorial, the response body will be empty.
Status Code | Meaning | Response Format |
---|---|---|
401 | You are unauthorized; make sure you have included a valid session cookie in your request | None |
404 | The problem referenced by the problem_id does not exist | None |
200 | The request has succeeded | Markdown |
This endpoint is used to get the problem description with the specified contest & problem id.
Status Code | Meaning | Response Format |
---|---|---|
401 | You are unauthorized; make sure you have included a valid session cookie in your request | None |
404 | The problem or contest referenced by the problem_id or contest_id does not exist | None |
200 | The request has succeeded | Markdown |
This endpoint is used to get any hints associated with specified contest & problem id. If there are no hints, the response body will be empty.
Status Code | Meaning | Response Format |
---|---|---|
401 | You are unauthorized; make sure you have included a valid session cookie in your request | None |
404 | The problem or contest referenced by the problem_id or contest_id does not exist | None |
200 | The request has succeeded | Markdown |
This endpoint is used to get the description of the contest with the specified contest id.
Status Code | Meaning | Response Format |
---|---|---|
401 | You are unauthorized; make sure you have included a valid session cookie in your request | None |
404 | The contest referenced by the contest_id does not exist | None |
200 | The request has succeeded | Markdown |
This endpoint is used to get the contents of an announcement with the specified id. Authentication will be required if the site requires logging in to view announcements.
Status Code | Meaning | Response Format |
---|---|---|
401 | You are unauthorized; make sure you have included a valid session cookie in your request | None |
404 | The announcement referenced by the announcement_id does not exist | None |
200 | The request has succeeded | Markdown |
This endpoint is used to get the contents of the homepage, if it is enabled. If the homepage is disabled, admin authentication will be required.
Status Code | Meaning | Response Format |
---|---|---|
403 | The homepage is disabled and you are not an admin | None |
200 | The request has succeeded | Markdown |