Courses API (v1)

Download OpenAPI specification:Download

Authentication

OAuth2

Security Scheme Type OAuth2
authorizationCode OAuth Flow
Authorization URL: https://auth.fit.cvut.cz/oauth/authorize
Token URL: https://auth.fit.cvut.cz/oauth/token
Scopes:
  • cvut:cpages:common:read -

    Allows to read non-personal data related to Course Pages (e.g. news).

  • cvut:kosapi:read -

    Allows to read list of user's courses from KOSapi.

clientCredentials OAuth Flow
Token URL: https://auth.fit.cvut.cz/oauth/token
Scopes:
  • cvut:cpages:common:read -

    Allows to read non-personal data related to Course Pages (e.g. news).

  • cvut:kosapi:read -

    Allows to read list of user's courses from KOSapi.

Gets Course Pages News

get /cpages/news
https://courses.fit.cvut.cz/api/v1/cpages/news

Returns news messages aggregated from all the course pages. This resource supports path extensions as an alternative to the Accept header to select the response format: /cpages/news.json and /cpages/news.xml.

Authorizations:
OAuth2 (cvut:cpages:common:read)
query Parameters
type
any
Default: "default"
Enum: "default" "grouped" "jsonfeed"

Specify type of the JSON representation:

  • default - an array of messages,
  • grouped - messages grouped by audience (KOS course code),
  • jsonfeed - messages in the JSON Feed format.
courses
Array of strings
Example: courses=BI-LIN,MI-RUB

Return messages only from the specified course pages.

deleted
boolean
Default: false

Whether to return even deleted messages.

limit
integer

Maximum number of messages to return. If type=grouped, this parameter limits number of the messages per course.

offset
integer
Default: 0

Offset of the first message to return. This parameter is ignored when type=grouped.

since
string <ISO 8601>
Example: since=2019-06-01

Return messages published since this date.

until
string <ISO 8601>
Example: until=2019-06-01

Return messages published until this date.

Responses

200

OK

Response Schema:
One of
  • default
  • grouped
  • jsonfeed
Array
id
required
integer

Unique ID of the message.

title
required
string

Title of the message (may be empty).

content
required
string <html>

HTML content of the message.

createdAt
required
string <ISO 8601 DateTime>

ISO 8601 date and time when the message was created.

createdBy
required
object

Person who created the message.

modifiedAt
string <ISO 8601 DateTime>

ISO 8601 date and time when the message was last modified.

modifiedBy
object

The last person who modified the message.

publishedAt
required
string <ISO 8601 DateTime>

ISO 8601 date and time when the message should be published.

ref
required
string <SHA-1>

Hash of the last commit that created/modified the message.

deleted
required
boolean

Whether this message was removed from the source file.

audience
required
Array of strings

KOS codes of the courses for which the message is intended.

default

Error

Response samples

Content type
Example

JSON response for type=default.

Copy
Expand all Collapse all
[
  • {
    },
  • {
    }
]

Gets info about GitLab project

get /gitlab/projects/{proj-path}/info
https://courses.fit.cvut.cz/api/v1/gitlab/projects/{proj-path}/info

Returns information about the specified GitLab project.

Authorizations:
OAuth2 (cvut:cpages:common:read)
path Parameters
proj-path
required
string
Example: /MI-RUB/mi-rub

Responses

200

OK

Response Schema: application/json
issues
required
object

The project’s issues.

pipeline
required
null or object

Status of the latest pipeline in the project (if there’s any)

default

Error

Response samples

Content type
application/json
Copy
Expand all Collapse all
{}

Get info about the current user

get /users/me
https://courses.fit.cvut.cz/api/v1/users/me
Authorizations:
OAuth2 (cvut:kosapi:read)

Responses

200

OK

Response Schema: application/json
username
required
string <= 8 characters
firstName
required
string
lastName
required
string
titlesPre
string

Titles before the person's name.

titlesPost
string

Titles after the person's name.

default

Error

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "username": "flynnkev",
  • "firstName": "Kevin",
  • "lastName": "Flynn",
  • "titlesPre": "Ing.",
  • "titlesPost": "CSc."
}

Gets courses of the current user

get /users/me/courses
https://courses.fit.cvut.cz/api/v1/users/me/courses

Returns list of courses the current user was/is studying and teaching in the specified semester.

Authorizations:
OAuth2 (cvut:kosapi:read)
query Parameters
semester
string
Default: "current"
Example: semester=B192

Responses

200

OK

Response Schema: application/json
studying
required
Array of strings

List of course codes the user is studying.

teaching
required
Array of strings

List of course codes the user is teaching.

default

Error

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "studying":
    [
    ],
  • "teaching":
    [
    ]
}