All queries to the API need to be presented in this form: http://api.ctf.yummytacos.me/METHOD_NAME
. Like this for example: http://api.ctf.yummytacos.me/tasks
API supports four ways of passing parameters in requests:
- URL query string
application/x-www-form-urlencoded
application/json
(except for uploading files)multipart/form-data
(use to upload files)
The response contains a JSON object. On success, an object in Endpoints section is returned. Otherwise, object with error_code
and human-readable message
is returned. Some errors may also have an optional String field key
, which can help to handle the error.
To use methods, which require authentication, confirmed account or admin rights, you must provide token as Authorization
HTTP header like this: Authorization: Bearer <token>
, where <token>
is your token (you can get it by authenticating, see Endpoints section for more).
Use this method to get information about this platform
About platform
- Nothing
name
(String
): Platform nameversion
(String
): Platform versionlicense
(String
): Platform distribution licenselicense_url
(String
): Platform distribution license URLrepository
(String
): Platform repository URLcontact
(String
): Contact name in case of questionscontact_url
(String
): Contact URL in case of questionsuptime
(Integer
): Platform uptime (seconds)
Use this method to retrieve article
Get article
id
(Integer
, required): Article ID
article
(Article
): Article
Use this method to retrieve articles
Get articles
category_id
(Integer
, optional): If provided, filter articles by category, otherwise return all articles
articles
(List<Article>
): Resulting list of articles
Use this method to authenticate in platform.
Authenticate
username
(String
, required): Username for the userpassword
(String
, required): Password for the user
token
(String
): Token which can be used to authenticate API requests
Use this method to retrieve all categories
Get categories
- Nothing
categories
(List<Category>
): Resulting list of categories
Use this method to retrieve category information
Get category
id
(Integer
, required): Category ID
category
(Category
): Category
Use this method to recover account password
Request password recovery email or confirm password recovery
code
(String
, optional): If provided, try to recover account password, otherwise, request password recovery emailemail
(String
, optional): Email of account to recoverurl
(String
, optional): If provided, this URL will be used to provide alternative verification method
token
(String
): If account password recovery was requested and it succeeded, token, which can be used to log in and change password, empty string otherwise
Use this method to register in platform.
Register in platform. Send first request without captcha_id and captcha_data, then you will get captcha_id together with a "Captcha required" error. Solve it and send result as captcha_data back with captcha_id
username
(String
, required): Username. Must contain only latin letters, digits, underscores and dotsfirst_name
(String
, required): First namelast_name
(String
, optional): Last nameemail
(String
, required): E-mailpassword
(String
, required): Passwordcaptcha_id
(String
, optional): ID of the captcha that can confirm your registrationcaptcha_data
(String
, optional): Solved captcha that can confirm your registration
user_id
(Integer
): ID of successfully registered user
Use this method to retrieve task information or to send flags for the task.
Get task
id
(Integer
, required): Task ID
task
(Task
): Task
Send task flag (requires authentication)
id
(Integer
, required): Task IDflag
(String
, required): Task flag
- Nothing
Use this method to retrieve list of tasks
Get tasks
- Nothing
tasks
(List<Task>
): Resulting list of tasks
Use this method to retrieve information about the user
Get user info
id
(Integer
, optional): User ID. If not provided, returns info about current user
user
(User
): User
Edit current user info (requires authentication)
id
(Integer
, optional): User ID to edit (requires admin rights)username
(String
, optional): New usernameemail
(String
, optional): New email. Resets confirmation status, if presentfirst_name
(String
, optional): New first namelast_name
(String
, optional): New last namepassword
(String
, optional): New passwordis_admin
(Integer
, optional): If this is set to 0, removes admin rights, else if this is set to 1, sets admin rights (requires admin rights)
- Nothing
Use this method to retrieve all users.
Get users
- Nothing
users
(List<User>
): Resulting list of users
Use this method to verify user's email
Request email verification or verify email
code
(String
, optional): If provided, try to verify email, otherwise, request email verification (requires authentication)url
(String
, optional): If provided, this URL will be used to provide alternative verification method
- Nothing
Use this method to retrieve API documentation
Get API documentation
method
(String
, optional): If provided, return documentation for this method, otherwise return documentation for all methods
doc
(Mapping<str, str>
): Documentation in Markdown format. "_" key is documentation header, which describes how to make requests
Use this method to manage articles
Create new article (requires admin rights)
title
(String
, required): Article titletext
(String
, required): Article textcategory
(Integer
, required): Category ID for article
article
(Article
): Created article
Edit article (requires admin rights)
id
(Integer
, required): Article IDtitle
(String
, optional): New article titletext
(String
, optional): New article textcategory
(Integer
, optional): New category ID for article
article
(Article
): Edited article
Delete article (requires admin rights)
id
(Integer
, required): Article ID
- Nothing
Use this method to manage categories
Create new category (requires admin rights)
name
(String
, required): Category name
category
(Category
): Created category
Edit category (requires admin rights)
id
(Integer
, required): Category IDname
(String
, optional): New category name
category
(Category
): Edited category
Delete category (requires admin rights)
id
(Integer
, required): Category ID
- Nothing
Use this method to manage tasks.
Create or propose new task (requires confirmed account)
title
(String
, required): Task nameauthor
(Integer
, required): If provided, user ID of task author (cannot be set on task proposals), otherwise current user IDcategory
(String
, required): Task categorypoints
(Integer
, required): Task points, must be positivedescription
(String
, required): Task descriptionwriteup
(String
, required): Task write-up (solution)flag
(String
, required): Task flag
task
(Task
): Created task
Edit task (if user is admin, this also confirms task proposal) (requires confirmed account)
id
(Integer
, required): Task ID to edittitle
(String
, optional): New task nameauthor
(Integer
, optional): User ID of new task authorcategory
(String
, optional): New task categorypoints
(Integer
, optional): New task points, must be positivedescription
(String
, optional): New task descriptionwriteup
(String
, optional): New task write-up (solution)flag
(String
, optional): New task flag
task
(Task
): Edited task
Delete task (requires confirmed account)
id
(Integer
, required): Task ID to delete
- Nothing
Use this method to manage task files
Send file and attach it to task (requires confirmed account)
task_id
(Integer
, required): Task IDfile
(multipart/form-data
, required): File
file
(File
): Added file
Delete file (requires confirmed account)
id
(Integer
, required): File ID to delete
- Nothing