Update Submission
Please note, there is not 100% coverage of the LMS systems when updating the `state` field to `submitted` (specifically). Some LMSs do not allow this property to be set to `submitted` without specifically using the student's credentials (e.g. via the User API endpoint).
You can update an existing Submission for a given Assignment using the following endpoints. They both perform the same action and you are welcome to choose whichever is more convenient, based on the identifier you have available (i.e. person_id
or submission_id
).
PATCH https://ed.link/api/v2/graph/classes/:class\_id/assignments/:assignment\_id/submissions/:person\_id
PATCH https://ed.link/api/v2/graph/classes/:class\_id/assignments/:assignment\_id/submissions/:submission\_id
Update an existing Submission for the given Assignment.
Request Parameters
Parameter | Type | Description |
---|---|---|
class_id | string | The UUID of the desired Class. |
assignment_id | string | The UUID of the desired Assignment. |
person_id | string | The UUID of the desired Person (Student) |
or | ||
submission_id | string | The UUID of the desired Submission. |
Request Body
The request body should contain a partial Submission object.
The following fields are allowed: attachments
, grader_id
, flags
, grade_comment
, grade_points
, grade
, extra_attempts
, override_due_date
, state
.
Sample Request To Submit Student Work
axios.patch('https://ed.link/api/v2/graph/classes/00000000-0000-0000-0000-000000000000/assignments/00000000-0000-0000-0000-000000000000/submissions/00000000-0000-0000-0000-000000000000', {
headers: {
authorization: `Bearer ${integration_access_token}`
},
data: {
attachments: [
{
type: 'link',
url: 'https://www.example.com/my-submission-01'
}
],
state: 'submitted'
}
});
Sample Request To Reclaim Submission
axios.patch('https://ed.link/api/v2/graph/classes/00000000-0000-0000-0000-000000000000/assignments/00000000-0000-0000-0000-000000000000/submissions/00000000-0000-0000-0000-000000000000', {
headers: {
authorization: `Bearer ${integration_access_token}`
},
data: {
state: 'reclaimed'
}
});
Sample Request To Grade Submission
axios.patch('https://ed.link/api/v2/graph/classes/00000000-0000-0000-0000-000000000000/assignments/00000000-0000-0000-0000-000000000000/submissions/00000000-0000-0000-0000-000000000000', {
headers: {
authorization: `Bearer ${integration_access_token}`
},
data: {
grade_points: 78
}
});
Sample Request To Return Submission
axios.patch('https://ed.link/api/v2/graph/classes/00000000-0000-0000-0000-000000000000/assignments/00000000-0000-0000-0000-000000000000/submissions/00000000-0000-0000-0000-000000000000', {
headers: {
authorization: `Bearer ${integration_access_token}`
},
data: {
state: 'returned'
}
});
Sample Response
{
"$data": {
"id": "00000000-0000-0000-0000-000000000000",
"attachments": [
{
"type": "link",
"url": "https://www.example.com/my-submission.html/"
}
],
"state": "submitted",
"created_date": "2021-12-23T22:24:39.934Z",
"updated_date": "2022-01-03T20:49:09.233Z"
},
"$request": "00000000-0000-0000-0000-000000000000"
}
Provider Specific Guidelines
Canvas
The Canvas API only accepts a singular flag. In the case multiple flags were sent as part of a request for grading/updating a Canvas submission, we will pass only one flag to be chosen based on the following order of importance, first being the most important: excused, missing, late.