api_specification_template.md
- Specification of the Web API for the Video-AG Website (v0.87).
- Introduction
- Site status
- Stored Objects
- Routes
- Resources
- Types
- Objects
- api_error
- Changelog
- v0.87
- v0.86
- v0.85
- v0.84
- v0.83
- v0.82
- v0.81
- v0.80
- 0.79
- v0.78
- v0.77
- v0.76
- v0.75
- v0.74
- v0.73
- v0.72
- v0.71
- v0.70
- v0.69
- v0.68
- v0.67
- v0.66
- v0.65
- v0.64
- v0.63
- v0.62
- v0.61
- v0.60
- v0.59
- v0.58
- v0.57
- v0.56
- v0.55
- v0.54
- v0.53
- v0.52
- v0.51
- v0.50
- v0.49
- v0.48
- v0.47
- v0.46
- v0.45
- v0.44
- v0.43
- v0.42
- v0.41
- v0.40
- v0.39
- v0.38
- v0.37
- v0.36
- v0.35
- v0.34
- v0.33
- v0.32
- v0.31
- v0.30
- v0.29
- v0.28
- v0.27
- v0.26
- v0.25
- v0.24
- v0.23
- v0.22
- v0.21
- v0.20
- v0.19
- v0.18
- v0.17
- v0.16
- v0.15
- v0.14
- v0.13
- v0.12
- v0.11
- v0.10
- v0.9
- v0.8
- v0.7
- v0.6
- v0.5
- v0.3
- v0.2
- v0.1
Specification of the Web API for the Video-AG Website (v0.87).
Introduction
In this document we use a lot of URLs. Parameters which need to be replaced are put in {}
. Anything inside and the
braces need to be replaced with the actual argument. These are called URL Parameters.
The Base-URL is /api/{version}
, where {version}
must be a version id from below. All URLs in this document are
relative to this Base-URL (Unless explicitly
stated otherwise).
The versions are:
Version | id | Status |
---|---|---|
0 | v0 | In Development |
HTTP Bodies, if present, are always JSON objects unless explicitly stated otherwise. We use tables to represent the json object structure:
Field | Type | Notes |
---|---|---|
id | int | |
something | ?string | We don't know what it is |
Example json object:
{ "id": 42, "something": "asdfghjkl" }
The Field is the name of the JSON Key. Type is the type of data. The type may have some additional indicators:
- A question mark indicates that the value is optional.
- An exclamation mark indicates that the value may only be present if the user is a moderator.
- A plus indicates that the field is directly modifiable
Some routes, marked as such, require a CSRF token. This token is set as a cookie csrf_token
by
POST /authentication/fsmpi
or POST /authentication/status
and must be included as the X-Csrf-Token
HTTP Header in
such requests.
On success, status code 200 OK
is always returned unless otherwise noted. Response Body is always present. For
status codes 4xx
and 5xx
the response contains an api_error (May not be present if the error
happened in a proxy, etc.).
The changelog can be found at the end.
Site status
The current site status can be retrieved with GET /status
. It can be in three states
-
available
: The site is running and all routes can be used -
readonly
: The site cannot update any data. You can only call routes for which is specified:- 'This may be used while the site is read-only.'
-
unavailable
: The site is unavailable and the only route you can call isGET /status
Stored Objects
The API is based on a concept of stored objects. In their serialized json form these look exactly the same as non-stored
objects. However, stored objects have an id which is contained in their serialized form. With this ID the configuration
of an object can be fetched and modified. The configuration of an object lists the object's fields along with their types
and the current values. This allows the configuration to dynamically add or remove fields without the fields being hardcoded.
Some of these fields correspond directly to fields in the object's serialized form. Such fields are marked with a +
in
this documentation and can also be modified directly. Note that some restrictions from the
field description may still apply, and that the configuration should be queried before editing.
Some fields of the serialized json are not included in the object's configuration and vice-versa.
Currently, the following objects have a configuration: {{CONFIG_OBJECT_LIST}}
TODO parents TODO deleted TODO variants
The types of these fields are described in the field description. For most fields the field type
is exactly the same as the value type. Currently, the only exception are object
fields where the value is a stored
object. The object type is specified in the field description and the configuration only expects/returns integer ids.
Routes
{{ROUTES_SPECIFICATION}}
Resources
Types
Type | Notes |
---|---|
int | |
float | |
boolean | |
string | |
datetime | A string which must be in format YYYY-MM-ddTHH:mm:ss.SSSZ (Year, Month, day, Hour, minute, second, millisecond, 'T' and 'Z' are literals) (Note that this is a UTC date time according to ISO 8601) |
Additionally, the following objects may appear as the type of some field:
view_permissions
Objects
{{OBJECTS_SPECIFICATION}}
api_error
Field | Type | Notes |
---|---|---|
error_code | id_string | Possible values are listed below |
message | string | Human readable message |
server | string | Name of the server which served the request |
Possible error_code
:
Code | HTTP Code | Notes |
---|---|---|
bad_request | 400 | |
method_not_allowed | 405 | |
malformed_json | 400 | Content-Type needs to be set to application/json
|
request_missing_parameter | 400 | |
request_invalid_parameter | 400 | |
unknown_request_path | 400 | |
internal_server_error | 500 | |
lecture_has_no_password | 400 | |
authentication_failed | 403 | |
authentication_not_available | 503 | |
unauthorized | 401 | |
csrf_token_invalid | 403 | CSRF token must be included as X-Csrf-Token Header |
access_forbidden | 403 | |
rate_limited | 429 | |
unknown_object | 404 | |
object_error | 400 | |
modification_unexpected_current_value | 409 | |
too_many_suggestions | 403 | |
site_is_readonly | 503 | |
site_is_disabled | 503 | |
site_is_overloaded | 503 |
Changelog
v0.87
- Added
GET /stats/course/{course_id}
v0.86
- Updated
ffmpeg_filter_graph_node
- Added
webm
tofile_format
- Added
v0.85
- Updated
GET /stats/publish_medium/{publish_medium_id}
- Added fields
total_watched_seconds
andview_count
- Added fields
v0.84
- Updated
medium_metadata
- Added field
file_format
- Added field
v0.83
- Updated
GET /lecture/{lecture_id}/media_process_overview
- Added
is_automatic_media_process_scheduler_enabled
field - Added
process_sha256
field
- Added
- Updated
POST /lecture/{lecture_id}/run_media_process_scheduler
- Changed response to same format as run_source_file_sorter
- Updated
ffmpeg_filter_graph_output_stream
- Added
crf
field
- Added
- Updated
media_process_target_producer
- Added
crf
field for typerescale_video
- Added
v0.82
- Changed
publish_medium
- Removed field
allow_download
- Added field
download_url
- Removed field
v0.81
- Added milliseconds to
datetime
type and clarified that it is in UTC.
v0.80
- Updated
field_description
- Added
may_be_null
for typemedia_process
- Added
0.79
- Added
POST /job/status
- Updated
POST /run_source_file_sorter
- Added
job_id
- Renamed
scheduled
toscheduled_new
- Added
- Updated
job
- Renamed
status
tostate
- Renamed
v0.78
- Added type
logo_overlay
toffmpeg_filter_graph_node
- Updated type
output_file
offfmpeg_filter_graph_node
- Added field
output_file
- Changed field
stream_graph_ids
to contain a new objectffmpeg_filter_graph_output_stream
- Added field
- Updated
video_slide_row
- Now is typed with types
text
(what previously everything was) andspacer
- Added fields
padding_top
,padding_bottom
,padding_left
,padding_right
- Now is typed with types
- Added
is_authenticated
tolecture
v0.77
- Renamed
data
tounknown_data
ofchangelog_entry
v0.76
- Removed
lecture_id
,is_lecture_authenticated
fromPOST /authentication/fsmpi
. Not sure why this was here. The status already has that functionality - Added
POST /course/{course_handle}/watched/publish_medium/{publish_medium_id}
- Added
GET /stats/publish_medium/{publish_medium_id}
- Added
GET /stats/lecture/{lecture_id}
- Added
float
standard type
v0.75
- Renamed
media_duration
tomedia_duration_sec
inlecture
v0.74
- Renamed field
source_id
ofmedia_process_target_producer
for all variants toinput_id
v0.73
- Added separate
object_list
type to `field_description-
object
is only for a single object -
is_list
has been removed
-
- Added
may_be_null
for typesdatetime
andobject
v0.72
- Added
media_duration
tolecture
- Reworked
field_description
- Added
has_default_value
. A missingdefault_value
and a nulldefault_value
no longer have a different meaning - Stored objects are now handled with their own type
object
instead of every object type being a field type - All types are now listed explicitly
- Type
enum
has new fieldname
(For translation keys)
- Added
v0.71
- Added
allow_download
andinclude_in_player
topublish_medium
v0.70
- Added
user_context
toGET /job/{job_id}
- Added
job_context
toGET /lecture/{lecture_id}/media_process_overview
v0.69
- Changes in
user
- Removed field
name
- Added fields
display_name
,full_name
,email
- Removed field
v0.68
- Added
file_size
tomedium_metadata
v0.67
- Renamed
GET /lecture/{lecture_id}
- Now as
GET /course/{course_id}/lecture/{lecture_id}
- or
GET /course/{course_handle}/lecture/{lecture_id}
- With handle is preferred, since unlisted courses and their lectures can no longer be found by non-mods if the id is provided
- Now as
- Also renamed
PUT /lecture/{lecture_id}/chapter_suggestion
- to
PUT /course/{course_id}/lecture/{lecture_id}/chapter_suggestion
- or
PUT /course/{course_handle}/lecture/{lecture_id}/chapter_suggestion
- to
- Removed job status
finished_and_processed
andfailed_and_processed
- Media Process has been updated
- Removed
target_medium
object - Added objects
-
medium_file
(stored) -
medium_metadata
(stored) -
ffmpeg_filter_graph_node
(non-stored) -
ffmpeg_filter_graph_stream_specifier
(non-stored) -
video_slide
(non-stored) -
video_slide_row
(non-stored)
-
- Renamed
source_medium
tosource_file
- Moved
GET /source_media
toGET /sorter_files
- Removed fields
file_metadata
,file_size
- Added field
designated_medium_file_id
- Moved
- Changed
media_process_target_producer
object- Added type
ffmpeg_filter_graph
- Renamed type
downscale_video
torescale_video
- Added type
- Changed
publish_medium
object- Now has
medium_metadata
instead oftarget_medium
field - Added
url
field
- Now has
- Adjusted
GET /lecture/{lecture_id}/media_process_overview
- Now returns the new objects and also the process
- Removed
v0.66
-
GET /source_media
is only for mods -
GET /lecture/{lecture_id}/media_process_overview
is only for mods - Added
POST /run_source_file_sorter
- Added
POST /lecture/{lecture_id}/run_media_process_scheduler
- Added
GET /media_process_templates
-
old_value
ofchangelog_entry
is no longer present if the entry was at creation -
publish_time
oflecture
is now only returned for mods - Added
name
andprocess
tomedia_process_template
v0.65
- Changes in
target_medium
- Renamed
video_horizontal_resolution
tohorizontal_resolution
- Renamed
video_vertical_resolution
tovertical_resolution
- Added
horizontal_resolution
andvertical_resolution
tothumbnail
- Added
image
variant
- Renamed
v0.64
- Added
GET /source_media
- Fixed
source_id
name ofmedia_process_target_producer
(Was documented asinput_id
) - Added
sample_thumbnail
variant tomedia_process_target_producer
- Changes in
source_medium
- Added
force_immediate_sort
- Added
lecture_id
- Added
status
- Added
tag
- Added
- Added
GET /lecture/{lecture_id}/media_process_overview
- Changes in
target_medium
- Added
input_data_sha256
- Added
is_produced
- Added
process_sha256
- Added
process_target_id
- Added
producer_job
- Added
to_be_replaced
- Added
v0.63
- Added
file_metadata
,file_modification_time
,file_size
tosource_medium
- Added and renamed variables in
target_medium
v0.62
- Removed
thumbnail_url
fromlecture
- Added new variant
thumbnail
totarget_medium
- Removed
visible
fromsource_medium
(Only accessible by mods anyway) - Added missing variant
plain
tofeatured
andplain_audio
totarget_medium
which were mentioned nowhere before
v0.61
- Renamed
path
tofile_path
insource_medium
- Added
update_time
tosource_medium
v0.60
- In
job
- Renamed
run_finish_time
torun_end_time
(to avoid confusing withfinished
status. This time is also set if failed) - Added
on_end_event_data
andon_end_event_type
- Renamed
- In
source_medium
- Added
path
,sha256
,sorter_error_message
,sorting_paused_due_to_recent_modification
- Added
- Completely redid
media_process
- Renamed
media_process_target
tomedia_process_target_producer
- Removed
id
- Added
output_id
- Changed
tags
list to a singletag
- Removed
v0.59
- Changed
entries_per_page
maximum inGET /jobs
to 100 - Changed response of
GET /jobs
- Removed
GET /events
- Removed
event
- Removed
cause_event_id
fromjob
- Added
cause_user_id
tojob
- Added
GET /job/{job_id}
v0.58
- Renamed
frame_rate_nominator
toframe_rate_numerator
intarget_medium
v0.57
- Removed
GET /diagnostics
- Added
thumbnail_url
tolecture
- Added
url
totarget_medium
v0.56
- Added stored objects
media_process_template
,target_medium
andsource_medium
- Added non-stored object
media_process
,media_process_target
- Added
GET /jobs
- Added
GET /events
- Added
user_context
toGET /object_management/changelog
- Added
target_medium
topublish_medium
v0.55
- Removed all 'types' except
int
,boolean
,string
,datetime
- Most other types were just some of the standard data types with some additional conditions/notes and only used once. These notes are now just wherever the type is used
- Changed allowed fields for configuration objects
- Changes in
GET /search
- Renamed
courses_context
tocourse_context
- The search term may not have more than 20 words
- Renamed
- Removed
GET /feedback?entries_per_page={entries_per_page}&page={page}
,feedback_entry
- Changes in
GET /object_management/changelog
- Renamed URL parameter
field
tofield_id
- URL parameter
field_id
may now be set even if theobject_type
is missing - Added URL parameter
user_id
- Renamed URL parameter
- Removed
GET /sorter/log
,DELETE /sorter/error_log/{log_id}
,sorter_log_entry
,sorter_error_log_entry
- Removed
GET /jobs
,DELETE /job/{id}
,POST /job/{id}/action
,job
,worker
- Removed
announcement_configuration
,featured_configuration
,course_configuration
,lecture_configuration
- Added
object_configuration
instead (Format is exactly the same)
- Added
- Removed
homepage
object. This is now an anonymous response object ofGET /homepage
- Renamed
courses_context
tocourse_context
- Renamed
new_lectures
tolatest_lectures
- Renamed
- Changes in
announcement
- Removed
is_currently_visible
,has_expired
- Added
publish_time
,expiration_time
,visible
- Renamed
visibility
topage_visibility
- Removed
- Changes in
changelog_entry
-
object_type
andobject_id
are now for all variants -
object_type
may be for type which no longer exists (due to legacy values) -
new_value
andold_value
no longer have types guaranteed to match the field's type (due to legacy values) - All fields for type
unknown
have been removed and a new json fielddata
has been added
-
- Changes in
chapter
- Renamed
is_visible
tovisible
- Renamed
- Changes in
course
- Renamed
is_visible
tovisible
- Renamed
is_listed
tolisted
- Renamed
id_string
tohandle
-
topic
is now directly modifiable -
visible
is now directly modifiable - Added
allow_embed
- Added
internal_comment
- Renamed
- Changes in
featured
-
id
is now also returned if non-mod - Removed guarantees for
display_priority
. These might be added back later - Removed
course_list
type - Added
course
type - Renamed
is_visible
tovisible
-
- Changes in
field_description
- Removed fields for
long
,url
,datetime
,lecture_id
,user_id
- Added
enums
- Removed fields for
- Changes in
lecture
- Removed
thumbnail_url
(Will be added back later) - Removed
livestream_url
- Removed
allow_embed
(The course now has this field) - Renamed
media_sources
topublish_media
- Renamed
is_visible
tovisible
- Removed
- Changes in
media_source
which is now namedpublish_medium
-
id
is now also returned for non-mods - Removed
quality
,size
,player_url
,download_url
. These will be added back later - Removed
internal_comment
- Renamed
is_visible
tovisible
- Renamed
comment
totitle
-
- Removed
media_quality
- Removed
feedback_entry
- Changes in
user_info
which is now nameduser
- Renamed
id_string
tohandle
- Renamed
v0.54
- Added
PUT /feedback/new
,GET /feedback?entries_per_page={entries_per_page}&page={page}
- Added
feedback_entry
object
v0.53
- Changed type of
course_id_string
to regex. Added forbidden values.
v0.52
- Added error code
site_is_overloaded
v0.51
- Added
server_name
toGET /status
v0.50
- Removed
GET /announcements
- Updated
GET /status
. Among other things, this now returns the announcements - Changed name of error type
authentication_servers_not_available
toauthentication_not_available
- Added error types
site_is_readonly
andsite_is_disabled
- Added
GET /is_running
v0.49
- Added
GET /status
v0.48
- Removed
PUT /job/new/{type}
- Removed
POST /sorter/run
v0.47
- Removed
GET /object_management/{object_type}/{object_id}/{field_id}/changelog
- Removed
GET /object_management/{object_type}/{object_id}/changelog
- Added query parameters to
GET /object_management/changelog
instead - Update type
unknown
ofchangelog_entry
:-
unknown_type
->unknown_object_type
-
old_value
->param1
(May be null) -
new_value
->param2
-
v0.46
- Type
url
may be type of field.
v0.45
- Removed
permission
object - Removed
permissions
from the configurations of courses and lectures - Added
view_permissions
object which may appear as the type of some field -
may_be_null
may now only appear infield_description
of typedatetime
,lecture_id
oruser_id
-
duration
andtimestamp
may no longer appear as the type of some field
v0.44
- Added
expected_current_values
toPATCH /object_management/{object_type}/{object_id}/configuration
(and accordingly toPOST /object_management/modify_many
) - Added
modification_unexpected_current_value
error code
v0.43
- Added
parent_type
andparent_id
tochangelog_entry
of typecreation
v0.42
- Added
worker
object. Addedworkers
field toGET /jobs
- Removed
POST /job/{id}/restart
,POST /job/{id}/cancel
andPOST /job/{id}/copy
- Added
POST /job/{id}/action
instead
v0.41
- Added
GET /jobs
,PUT /job/new/{type}
,DELETE /job/{id}
,POST /job/{id}/restart
,POST /job/{id}/cancel
andPOST /job/{id}/copy
- Added
job
object - Added
job_state
andjob_type
types
v0.40
- Added
GET /user/me/settings
andPATCH /user/me/settings
- Added
settings
,settings_section
andsettings_entry
object
v0.39
- Added
sorter_log_entry
andsorter_error_log_entry
objects - Added
GET /sorter/log
,DELETE /sorter/error_log/{log_id}
andPOST /sorter/run
v0.38
- Removed
is_modifiable
offield_description
(All fields can be modified) - Fields with default values may be omitted at creation now
- Added guarantees for the creation of some objects
v0.37
- CSRF token is now returned in a cookie instead of the response body
v0.36
- Added CSRF tokens. The token is returned by
POST /authentication/status
. - CSRF token is required by:
GET /lecture_import/rwth_online/{rwth_course_id}
PATCH /object_management/{object_type}/{object_id}/configuration
POST /object_management/modify_many
PUT /object_management/{object_type}/new
DELETE /object_management/{object_type}/{object_id}
POST /object_management/{object_type}/{object_id}/resurrect
- Added error code
csrf_token_invalid
v0.35
- Added
POST /object_management/{object_type}/{object_id}/resurrect
v0.34
- Added error code
rate_limited
v0.33
- Removed
field_entry
- Added
field_description
andfield_value
instead. The format of the configuration endpoints andchangelog_entry
has changed accordingly.
v0.32
- Changes to changelog_entry format
- Added
GET /object_management/{object_type}/{object_id}/changelog?entries_per_page={entries_per_page}&page={page}
v0.31
- Changed
GET /{object_type}/{object_id}/configuration
toGET /object_management/{object_type}/{object_id}/configuration
- Changed
PATCH /{object_type}/{object_id}/configuration
toPATCH /object_management/{object_type}/{object_id}/configuration
- Changed
POST /objects/modify_many
toPOST /object_management/modify_many
- Changed
GET /{object_type}/new/configuration
toGET /object_management/{object_type}/new/configuration
- Changed
PUT /{object_type}/new/create
toPUT /object_management/{object_type}/new
- Changed
DELETE /{object_type}/{object_id}
toDELETE /object_management/{object_type}/{object_id}
- Changed
GET /{object_type}/{object_id}/{field_id}/changelog
toGET /object_management/{object_type}/{object_id}/{field_id}/changelog
- Changed
GET /objects/changelog
toGET /object_management/changelog
v0.30
- Updated
GET /{object_type}/{object_id}/{field_id}/changelog
- Added
GET /search?q={search_term}
v0.29
- Added
GET /{object_type}/{object_id}/{field_id}/changelog
- Changed
/lecture_import/rwthonline/{rwth_course_id}
to/lecture_import/rwth_online/{rwth_course_id}
v0.28
-
/lecture_import/list_document/{course_id}
=>/lecture_import/rwthonline/{rwth_course_id}
- Removed
POST /lecture_import/calendar_export
v0.27
- Added
GET /lecture_import/list_document/{course_id}
- Added
POST /lecture_import/calendar_export
v0.26
- Added
GET /objects/changelog?entries_per_page={entries_per_page}&page={page}
v0.25
- Allowed creation of
chapter
objects - Added
PUT /lecture/{lecture_id}/chapter_suggestion
- Added
too_many_suggestions
error type
v0.24
- Added
allow_embed
tolecture
v0.23
- Updated directly modifiable Fields. They are now indicated by a
+
- Added
legacy_announcement_type
v0.22
- Changed featured type
text
toplain
(Because all types contain text)
v0.21
- Updated
display_priority
offeatured
to be unique and no longer nullable
v0.20
- Added
DELETE /{object_type}/{object_id}
v0.19
- Changed type of
courses
infeatured
to array of int. Added courses to thecourses_context
of the homepage instead.
v0.18
- Renamed Object Types to Object Variants as this was confusing. Renamed
type_fields
tovariant_fields
andtype
tovariant
for this
v0.17
- Added
POST /objects/modify_many
v0.16
- Added
display_priority
tofeatured
(Also to Directly Modifiable Fields)
v0.15
- Added
course_filter_criteria
type -
id_string
may no longer be type of field entry - Added
course_id_string
type
v0.14
- Added
GET /users
v0.13
- Reverted
GET /announcement
back toGET /announcements
- Reverted
GET /course
back toGET /courses
v0.12
- Added
POST /authentication/moderator_logout
v0.11
- Added Object Modification API
- Added
announcement_configuration
,featured_configuration
,course_configuration
,lecture_configuration
,permission
andfield_entry
objects - Added
internal_comment
tomedia_source
- Added
unknown_object
andobject_error
error types. Removedunknown_course
andunknown_lecture
error types. - Changed
GET /announcements
toGET /announcement
(for consistency) - Changed
GET /courses
toGET /course
(for consistency) - Changed
GET /courses/{course_id}
toGET /course/{course_id}
(for consistency) - Changed
GET /lectures/{lecture_id}
toGET /lecture/{lecture_id}
(for consistency)
v0.10
- Added
id
,is_currently_visible
andhas_expired
toannouncement
object - Added
id
andis_visible
tofeatured
object - Added
is_listed
andis_visible
tocourse
object - Added
is_visible
andinternal_comment
tolecture
object - Added
id
andis_visible
tochapter
object - Added
id
andis_visible
tomedia_source
object - Changed pattern for
id_string
from[a-z0-9_-]{1,100}
to(?=.*[a-z_-])[a-z0-9_-]{1,100}
- Changed route
GET /courses/{course_id}/lectures/{lecture_id}
toGET /lectures/{lecture_id}
- Made
lecture
offeatured
nullable
v0.9
- Added
user_info
to response ofPOST /authentication/status
v0.8
- Added
authentication_information
tocourse
object
v0.7
- Added
bad_request
andmethod_not_allowed
error codes
v0.6
- Changed
/authentication/start
to/authentication/start_oauth
- Removed
/authentication/login
- Added
/authentication/password
and/authentication/fsmpi
instead
v0.5
- Changed
moderator
authentication type tofsmpi
(To be consistent withauthentication_methods
).
v0.3
-
GET /courses/{course_id}/lectures/{lecture_id}
now accepts course id_string and includes the course
v0.2
-
GET /courses
returns map instead of array
v0.1
- Initial version