From 15324aee8abd7797908a4f7c11e1ed057e9b4079 Mon Sep 17 00:00:00 2001 From: IDzyre Date: Wed, 22 May 2024 12:15:17 -0700 Subject: [PATCH] Add more to the API --- source/index.html.md | 53 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/source/index.html.md b/source/index.html.md index 928bd53..15ee956 100644 --- a/source/index.html.md +++ b/source/index.html.md @@ -16,7 +16,7 @@ search: true *Note: API is still a work in progress.* -Most of the API is restricted to faculty, however the [Gradeables](#gradeables) section can be used by students or faculty. +Most of the API is restricted to faculty, however the [Students](#students) section can be used by students or faculty. API provides an alternative way of interacting with Submitty. It facilitates testing, helps system administrators to modify resources and enables users to create customized frontends. Note that as we rely on the Authorization header information to authenticate users, please make sure that you have a correct Apache configuration file as specified in [Installation Version Notes: v19.06.02](https://submitty.org/sysadmin/version_notes/v19.06.02). @@ -325,8 +325,57 @@ This endpoint helps system administrators set up cron jobs for automatic grade s `POST /api///reports/summaries` - # Gradeables + +## Download Gradeable JSON + +```shell +curl --request GET \ + --url /api////download \ + --header 'Authorization: my_token' +``` + +This endpoint downloads the JSON representation of the gradeable with the given gradeable_id, course, and semester. +This JSON file can be uploaded to add createa a new gradeable. + +### HTTP Request + +`GET /api////download` + +### Parameters + +Parameter | Description +--------- | ----------- +semester | Semester of the gradeable +course | Course of the gradeable +gradeable_id | ID of the gradeable + + +## Upload Gradeable JSON + +```shell +curl --request POST \ + --url /api////download \ + --header 'Authorization: my_token' +``` + +This endpoint downloads the JSON representation of the gradeable with the given gradeable_id, course, and semester. +This JSON file can be uploaded to add createa a new gradeable. + +### HTTP Request + +`GET /api////download` + +### Parameters + +Parameter | Description +--------- | ----------- +semester | Semester of the gradeable +course | Course of the gradeable +gradeable_id | ID of the gradeable + + +# Students ## Get gradeable values ```shell