diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 000000000..e69de29bb diff --git a/404.html b/404.html new file mode 100644 index 000000000..0d8cac96d --- /dev/null +++ b/404.html @@ -0,0 +1,1077 @@ + + + +
+ + + + + + + + + + + +This page details all the endpoints of the Autolab REST API.
+The client's access token should be included as a parameter to all endpoints. For details on obtaining access tokens, please see the API Overview.
+For version 1 of the API, all endpoints are under the path /api/v1/
. For example, to get user info, send a request to https://<host>/api/v1/user
.
All endpoints expect the HTTP GET method unless otherwise specified.
+All parameters listed below are required unless denoted [OPTIONAL].
+All responses are in JSON format.
+Notes on return value types
+All datetime formats are strings in the form of YYYY-MM-DDThh:mm:ss.sTZD
, e.g. 2017-10-23T04:17:41.000-04:00
, which means 4:17:41 AM on October 23rd, 2017 US Eastern Time.
JSON spec only has a 'number' type, but the spec below distinguishes between integers and floats for ease of use in certain languages.
+If a field does not exist, the value is generally null. Please be sure to check if a value is null before using it.
+Get basic user info.
+Scope: 'user_info'
+Endpoint: /user
Parameters: [none]
+Responses:
+key | +type | +description | +
---|---|---|
first_name | +string | +The user's first name. | +
last_name | +string | +The user's last name. | +
string | +The user's registered email. | +|
school | +string | +The school the user belongs to. | +
major | +string | +The user's major of study. | +
year | +string | +The user's year. | +
Get all courses currently taking or taken before.
+Scope: 'user_courses'
+Endpoint: /courses
Parameters:
+state
+[OPTIONAL] filter the courses by the state of the course. Should be one of 'disabled', 'completed', 'current', or 'upcoming'. If no state is provided, all courses are returned.
+Responses:
+A list of courses. Each course contains:
+key | +type | +description | +
---|---|---|
name | +string | +The unique url-safe name. | +
display_name | +string | +The full name of the course. | +
semester | +string | +The semester this course is being offered. | +
late_slack | +integer | +The number of seconds after a deadline that the server will still accept a submission and not count it as late. | +
grace_days | +integer | +AKA late days. The total number of days (over the entire semester) a student is allowed to submit an assessment late. | +
auth_level | +string | +The user's level of access for this course. One of 'student', 'course_assistant', or 'instructor'. | +
Get all the assessments of a course.
+Scope: 'user_courses'
+Endpoint: /courses/{course_name}/assessments
Parameters: [none]
+Responses:
+A list of assessments. If the user is only a student of the course, only released assessments are available. Otherwise, all assessments are available. Each assessment contains:
+key | +type | +description | +
---|---|---|
name | +string | +The unique url-safe name. | +
display_name | +string | +The full name of the assessments. | +
start_at | +datetime | +The time this assessment is released to students. | +
due_at | +datetime | +Students can submit before this time without being penalized or using grace days. | +
end_at | +datetime | +Last possible time that students can submit (except those granted extensions.) | +
category_name | +string | +Name of the category this assessment belongs to. | +
Show detailed information of an assessment.
+Scope: 'user_courses'
+Endpoint: GET /courses/{course_name}/assessments/{assessment_name}
Parameters: [none]
+Response:
+key | +type | +description | +
---|---|---|
name | +string | +The unique url-safe name. | +
display_name | +string | +The full name of the assessments. | +
description | +string | +A short description of the assessment. | +
start_at | +datetime | +The time this assessment is released to students. | +
due_at | +datetime | +Students can submit before this time without being penalized or using grace days. | +
end_at | +datetime | +Last possible time that students can submit (except those granted extensions.) | +
updated_at | +datetime | +The last time an update was made to the assessment. | +
max_grace_days | +integer | +Maximum number of grace days that a student can spend on this assessment. | +
max_submissions | +integer | +The maximum number of times a student can submit the assessment. -1 means unlimited submissions. |
+
max_unpenalized_submissions | +integer | +The maximum number of times the assessment can be submitted without incurring a penalty. -1 means unlimited submissions. |
+
disable_handins | +boolean | +Are handins disallowed by students? | +
category_name | +string | +Name of the category this assessment belongs to. | +
group_size | +integer | +The maximum size of groups for this assessment. | +
writeup_format | +string | +The format of this assessment's writeup. One of 'none', 'url', or 'file'. |
+
handout_format | +string | +The format of this assessment's handout. One of 'none', 'url', or 'file'. |
+
has_scoreboard | +boolean | +Does this assessment have a scoreboard? | +
has_autograder | +boolean | +Does this assessment use an autograder? | +
max_total_score | +float | +The maximum total score for this assessment | +
max_scores | +object | +An object with the problem name as the key, and the maximum score for the problem as the value | +
set the group size of the assessment.
+Scope: 'user_courses'
+Endpoint: POST /courses/{course_name}/assessments/{assessment_name}/set_group_settings
Parameters:
+key | +type | +description | +
---|---|---|
group_size | +integer | +the number of people in a group | +
allow_student_assign_group | +boolean | +whether students are allowed to edit and self-assign groups | +
Response:
+key | +type | +description | +
---|---|---|
group_size | +integer | +the number of people in a group | +
allow_student_assign_group | +boolean | +whether students are allowed to edit and self-assign groups | +
List all groups in an assessment
+Scope: 'instructor_all'
+Endpoint: GET /courses/{course name}/assessments/{assessment name}/groups
Parameters:
+show_members
key | ++ | type | +description | +
---|---|---|---|
show_members | +optional | +boolean | +whether to retrieve the members of each group or not | +
Response:
+A JSON object containing the group_size, a list of groups, and the assessment containing the groups.
+If show_members
is set to true, each group will have a list members
of user objects that are members of that group.
Show the details of a group and its members
+Scope: 'instructor_all'
+Endpoint: GET /courses/{course name}/assessments/{assessment name}/groups/{id}
Parameters: [none]
+Response:
+The requested group object. It contains a list members
of user objects that are members of that group.
Create groups in the assessment, given the emails of the people in the group, and an optional group name.
+Scope: 'instructor_all'
+Endpoint: POST /courses/{course name}/assessments/{assessment name}/groups
Parameters:
+Groups
key | ++ | type | +description | +
---|---|---|---|
groups | +required | +string | +List of group s to be created. Refer to group object. |
+
Group
key | ++ | type | +description | +
---|---|---|---|
name | ++ | string | +Name of the group | +
group_members | +required | +list of string | +List of emails of students in that group | +
Example json object +
{
+ "groups" : [{
+ "name": "hello",
+ "group_members": ["user@foo.bar","user1@foo.bar"]
+ },
+ {
+ "name": "hello2",
+ "group_members": ["user2@foo.bar",""user3@foo.bar"]
+ } ]
+}
+
Response:
+A list of the groups created if successful. Otherwise an error message will be returned.
+Delete a certain group of an assessment given the id
+Scope: 'instructor_all'
+Endpoint: DELETE /courses/{course name}/assessments/{assessment name}/groups/{id}
Parameters: [none]
+Response:
+Success message if deleted.
+Get all problems of an assessment.
+Scope: 'instructor_all'
+Endpoint GET /courses/{course_name}/assessments/{assessment_name}/problems
Parameters: [none]
+Responses:
+A list of problems. Each problem contains:
+key | +type | +description | +
---|---|---|
name | +string | +Full name of the problem. | +
description | +string | +Brief description of the problem. | +
max_score | +float | +Maximum possible score for this problem. | +
optional | +boolean | +Is this problem optional? | +
starred | +boolean | +Is this problem starred? | +
Create a problem for an assessment.
+Scope: 'instructor_all'
+Endpoint POST /courses/{course_name}/assessments/{assessment_name}/problems
Parameters:
+key | +type | +description | +
---|---|---|
name | +string | +Full name of the problem. | +
description | +string | +Brief description of the problem. | +
max_score | +float | +Maximum possible score for this problem. | +
optional | +boolean | +Is this problem optional? | +
Responses:
+The newly created problem.
+key | +type | +description | +
---|---|---|
name | +string | +Full name of the problem. | +
description | +string | +Brief description of the problem. | +
max_score | +float | +Maximum possible score for this problem. | +
optional | +boolean | +Is this problem optional? | +
Get the submission scores for all users for an assessment.
+Scope: 'instructor_all'
+Endpoint GET /courses/{course_name}/assessments/{assessment_name}/scores
Parameters: [none]
+Responses:
+A dictionary containing the submission data for each student that's made a submission. +The keys are students' emails, and the values are a dictionary with keys equal to the submission number, and values equal to the scores for the graded problems.
+Example json object +
{
+ "student1@andrew.cmu.edu" : {
+ "1": {
+ "problem1": 100.0,
+ "problem2": 10.0
+ },
+ "2": {
+ "problem1": 100.0,
+ "problem2": 15.0
+ }
+ },
+ "student2@andrew.cmu.edu" : {
+ "1": {}
+ }
+}
+
Get the submission scores for a user for an assessment.
+Scope: 'instructor_all'
+Endpoint GET /courses/{course_name}/assessments/{assessment_name}/scores/{email}
Parameters: [none]
+Response:
+A dictionary containing the submission data for the student. +The keys are the submission number, and values equal to the scores for the graded problems.
+Example json response: +
{
+ "1": {
+ "Problem 1": 100.0,
+ "Problem 2": 10.0
+ }
+}
+
Update the scores for a student's latest submission.
+Scope: 'instructor_all'
+Endpoint PUT /courses/{course_name}/assessments/{assessment_name}/scores/{email}/update_latest/
Parameters:
+key | +type | +description | +
---|---|---|
update_group_scores | +boolean | +Should the score update be propagated to the students in the student's group? | +
problems | +json object | +Keys equal to the name of the problems to update, values equal to the updated score for a problem | +
Responses:
+problems
does not exist for the assessmentkey | +type | +value | +
---|---|---|
error | +string | +"Problem '...' not found in this assessment" | +
In this case, no score updates will be saved.
+problems
exist for the assessmentThe a dictionary with keys equal to the email of the users with updated scores, values equal to the scores for the latest submission.
+Example json response: +
{
+ "student1@andrew.cmu.edu": {
+ "Problem 2": 10.0,
+ "Problem 1": 10.0
+ },
+ "student2@andrew.cmu.edu": {
+ "Problem 2": 10.0,
+ "Problem 1": 10.0
+ }
+}
+
Get the writeup of an assessment.
+Scope: 'user_courses'
+Endpoint: /courses/{course_name}/assessments/{assessment_name}/writeup
Parameters: [none]
+Responses:
+key | +type | +value | +
---|---|---|
writeup | +string | +"none" | +
key | +type | +description | +
---|---|---|
url | +string | +The url of the writeup. | +
Get the handout of an assessment.
+Scope: 'user_courses'
+Endpoint: /courses/{course_name}/assessments/{assessment_name}/handout
Parameters: [none]
+Responses: [same as writeup]
+Make a submission to an assessment.
+Scope: 'user_submit'
+Endpoint: POST /courses/{course_name}/assessments/{assessment_name}/submit
Parameters:
+submission[file]
+The file to submit
+Note: the name should be the string 'submission[file]'
+Success Response:
+key | +type | +description | +
---|---|---|
version | +integer | +The version number of the newly submitted submission. | +
filename | +string | +The final filename the submitted file is referred to as. | +
Failure Response:
+A valid submission request may still fail for many reasons, such as file too large, handins disabled by staff, deadline has passed, etc.
+When a submission fails, the HTTP response code will not be 200. The response body will include a json with the key 'error'. Its contents will be a user-friendly string that the client may display to the user to explain why the submission has failed. The client must not repeat the request without any modifications. The client is not expected to be able to handle the error automatically.
+Get all submissions the user has made.
+Scope: 'user_scores'
+Endpoint: /courses/{course_name}/assessments/{assessment_name}/submissions
Parameters: [none]
+Response:
+A list of submissions. Each submission includes:
+key | +type | +description | +
---|---|---|
version | +integer | +The version number of this submission. | +
filename | +string | +The final filename the submitted file is referred to as. | +
created_at | +datetime | +The time this submission was made. | +
scores | +object | +A dictionary containing the scores of each problem. The keys are the names of the problems, and the value is either the score (a float), or the string 'unreleased' if the score for this problem is not yet released. |
+
Get the text feedback given to a problem of a submission.
+For autograded assessments, the feedback will by default be the autograder feedback, and will be identical for all problems.
+Scope: 'user_scores'
+Endpoint: /courses/{course_name}/assessments/{assessment_name}/submissions/{submission_version}/feedback
Parameters:
+problem
+The name of the problem that the feedback is given to.
+Response:
+key | +type | +description | +
---|---|---|
feedback | +string | +The full feedback text for this problem. | +
Autolab uses the term course_user_data to represent the users affiliated with a course. It includes all students, course assistants, and instructors of the course.
+A course_user_data object in the response will be formatted in this form:
+key | +type | +description | +
---|---|---|
first_name | +string | +The user's first name. | +
last_name | +string | +The user's last name. | +
string | +The user's registered email. | +|
school | +string | +The school the user belongs to. | +
major | +string | +The user's major of study. | +
year | +string | +The user's year. | +
lecture | +string | +The user's assigned lecture. | +
section | +string | +The user's assigned section. | +
grade_policy | +string | +The user's grade policy for this course. | +
nickname | +string | +The user's nickname for this course. | +
dropped | +boolean | +Is the user marked as dropped from this course? | +
auth_level | +string | +The user's level of access for this course. One of 'student', 'course_assistant', or 'instructor'. | +
There are five endpoints related to course_user_data:
+List all course_user_data of a course.
+Scope: 'instructor_all'
+Endpoint: GET /courses/{course_name}/course_user_data
Parameters: [none]
+Response:
+A list of course_user_data objects.
+Show the course_user_data of a particular student in a course.
+Scope: 'instructor_all'
+Endpoint: GET /courses/{course_name}/course_user_data/{user_email}
Parameters: [none]
+Response:
+The requested user's course_user_data object.
+Create a new course_user_data for a course.
+The user's email is used to uniquely identify the user on Autolab. If the user is not yet a user of Autolab, they need to be registered on Autolab before they can be enrolled in any courses.
+Scope: 'instructor_all'
+Endpoint: POST /courses/{course_name}/course_user_data
Parameters:
+key | ++ | type | +description | +
---|---|---|---|
required | +string | +The email of the user (to uniquely identify the user). | +|
lecture | +required | +string | +The lecture to assign the user to. | +
section | +required | +string | +The section to assign the user to. | +
grade_policy | ++ | string | +The user's grade policy (opaque to Autolab). | +
dropped | ++ | boolean | +Should the user be marked as dropped? | +
nickname | ++ | string | +The nickname to give the user. | +
auth_level | +required | +string | +The level of access this user has for this course. One of 'student', 'course_assistant', or 'instructor'. | +
Response:
+The newly created course_user_data object.
+Update an existing course_user_data.
+Scope: 'instructor_all'
+Endpoint: PUT /courses/{course_name}/course_user_data/{user_email}
Parameters:
+key | ++ | type | +description | +
---|---|---|---|
lecture | ++ | string | +The lecture to assign the user to. | +
section | ++ | string | +The section to assign the user to. | +
grade_policy | ++ | string | +The user's grade policy (opaque to Autolab). | +
dropped | ++ | boolean | +Should the user be marked as dropped? | +
nickname | ++ | string | +The nickname to give the user. | +
auth_level | ++ | string | +The level of access this user has for this course. One of 'student', 'course_assistant', or 'instructor'. | +
Response:
+The newly updated course_user_data object.
+Drop a user from a course. Since CUDs are never deleted from the course, this is just a shortcut for updating a user with the dropped attribute set to true.
+Scope: 'instructor_all'
+Endpoint: DELETE /courses/{course_name}/course_user_data/{user_email}
Parameters: [none]
+Response:
+The newly updated course_user_data object.
+ + + + + + + + +The web interface that has served us well for many years is no longer the only way to use Autolab. With the API, developers will be able to help make Autolab more versatile and convenient: Whether it be with a mobile app, a command line tool, a browser extension, or something we’ve never even thought of.
+What this means for users is that you can now use third-party programs to access Autolab to view assignments, download handouts, and even submit your solutions. Rest assured that all developers and their clients will be manually vetted by our team to ensure quality and safety. However, it is still important that you understand how clients interact with your account.
+As a user of Autolab, when you want to use a client for the first time, you need to grant access to the client so that it can interact with Autolab for you.
+Note: Third-party clients never ask for your Autolab username or password. Never enter them anywhere else except on the Autolab website (always check the page url before entering your credentials).
+
+Manual activation page
When you enter the code on the website and click “Activate”, you will be taken to the Grant Permissions page.
+
+API Grant Permissions Page
This page shows you all the permissions the client requests. Click ‘approve’ to grant these permissions to this client.
+As a user, you can review all the clients that you’ve granted access to on the Manage Authorized Clients page. Click on the menu at the upper right corner, then click on ‘Account’. At the bottom of the page you’ll find the ‘Manage Authorized Clients’ link.
+
+Manage all the clients that currently have access to your account
You can view the permissions that each client has (hover over the icon to see a description of each permission). You can also click ‘Revoke’ at any time to revoke the access of a client immediately.
With the advent of the API, developers can now create new, more versatile and convenient ways of accessing Autolab.
+What this means for users is that you can now use third-party programs to access Autolab to view assignments, download handouts, and even submit your solutions. Rest assured that all developers and their clients will be manually vetted by our team to ensure quality and safety. However, it is still important that you understand how clients interact with your account.
+As a user of Autolab, when you want to use a client for the first time, you need to grant access to the client so that it can interact with Autolab for you.
+Note: Third-party clients never ask for your Autolab username or password. Never enter them anywhere else except on the Autolab website (always check the page url before entering your credentials).
++Manual activation page
+When you enter the code on the website and click "Activate", you will be taken to the Grant Permissions page.
++API Grant Permissions Page
+This page shows you all the permissions the client requests. Click 'approve' to grant these permissions to this client.
+As a user, you can review all the clients that you've granted access to on the Manage Authorized Clients page. Click on the menu at the upper right corner, then click on 'Account'. At the bottom of the page you'll find the 'Manage Authorized Clients' link.
++Manage all the clients that currently have access to your account
+You can view the permissions that each client has (hover over the icon to see a description of each permission). You can also click 'Revoke' at any time to revoke the access of a client immediately.
+ + + + + + + + +The web interface that has served us well for many years is no longer the only way to use Autolab. With the API, developers will be able to help make Autolab more versatile and convenient: Whether it be with a mobile app, a command line tool, a browser extension, or something we've never even thought of.
+For students and instructors who only plan to use Autolab, try out the Autolab CLI.
+The Autolab REST API allows developers to create clients that can access features of Autolab on behalf of Autolab users.
+V1 of the API allows clients to:
+All endpoints of the Autolab API requires client authentication in the form of an access token. To obtain this access token, clients must obtain authorization from the user.
+Autolab API uses the standard OAuth2 Authorization Code Grant for user authorization.
+For clients with no easy access to web browsers (e.g. console apps), an alternative device flow-based authorization method is provided as well.
+To register an API application, one needs to have an admin privileges, and then visit Manage Autolab > Manage API application
. Refer to Scopes for the available scopes. To understand how to authorize and unauthorize clients as a user, go to Managing Authorized Apps
/oauth/authorize
oauth/token
The authorization code grant consists of 5 basic steps:
+Section 4.1 of RFC 6749 details the parameters required and the response clients can expect from these endpoints.
+Autolab API provides a refresh token with every new access token. Once the access token has expired, the client can use the refresh token to obtain a new access token, refresh token pair. Details are also provided in RFC 6749 here.
+For devices that cannot use a web browser to obtain user authorization, the alternative device flow approach circumvents the first 3 steps in the authorization code grant flow. Instead of directing a user to the authorization page directly, the client obtains a user code that the user can enter on the Autolab website from any device. The website then takes the user through the authorization procedure, and returns the authorization code to the client. The client can then use this code to request an access token from the access token endpoint as usual.
+Note that this is different from the "device flow" described in the Internet Draft linked above.
+Request Endpoint: GET /oauth/device_flow_init
Parameters:
+Success Response:
+/activate
The latter two should be displayed to the user.
+After asking the user to enter the user code on the verification site, the client should poll the device_flow_authorize endpoint to find out if the user has completed the authorization step.
+Request Endpoint: GET /oauth/device_flow_authorize
Parameters:
+Failure Responses:
+400 Bad Request: {error: authorization_pending}
+The user has not yet granted or denied the authorization request. Please try again in a while.
+429 Too Many Requests: {error: Retry later}
+The client is polling too frequently. Please wait for a while before polling again.
+The default rate limit is once every 5 seconds.
+Success Response:
+The client could then perform steps 4 and 5 of the Authorization Code Grant Flow.
+Autolab requires all client applications to be registered clients. Upon registration, a client_id and client_secret pair will be provided to the developers for use in the app as identification to the server. Please contact the administrators of your specific Autolab deployment for registration.
+Security Concerns
+Please make sure to keep the client_secret secret. Leaking this code may allow third-parties to impersonate your app.
+The scopes of an API client specifies the permissions it has, and must be specified during client registration (can be modified later). Currently, Autolab offers the following scopes for third-party clients:
+Example usages
+Of course, these are only examples. We can't wait to see what new usages of the API you may come up with! We just recommend that you only ask for the scopes you need as the users will be shown the required scopes during authorization, and it gives them peace of mind to know that an app doesn't ask for excessive permissions.
+ + + + + + + + +\n {translation(\"search.result.term.missing\")}: {...missing}\n
\n }\n