List assignments of a user
Namespace: microsoft.graph
Returns a list of educationAssignment assigned to a educationUser for all classes. Only teachers, students, and applications with application permissions can perform this operation.
This method allows a caller to find all the assignments belonging to a student or a teacher in a single call rather than having to request assignments from each class. The assignment list contains what is needed to get the detailed information for the assignment from within the class namespace. Use the methods defined for the assignment for all other operations.
Note: The
instructions
,assignedDateTime
,assignTo
,resourcesFolderUrl
andwebUrl
properties will always display null.
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
Permission type | Permissions (from least to most privileged) |
---|---|
Delegated (work or school account) | EduAssignments.ReadBasic, EduAssignments.ReadWriteBasic, EduAssignments.Read, EduAssignments.ReadWrite |
Delegated (personal Microsoft account) | Not supported. |
Application | EduAssignments.ReadBasic.All, EduAssignments.ReadWriteBasic.All, EduAssignments.Read.All, EduAssignments.ReadWrite.All |
Calling the /me
endpoint requires a signed-in user and therefore a delegated permission. Application permissions are not supported when using the /me
endpoint.
The /users/{user-id}
endpoint works with delegated and application permissions.
HTTP request
GET /education/me/assignments
GET /education/users/{user-id}/assignments
Optional query parameters
This method supports the $top
, $filter
, $orderBy
, and $select
OData query parameters to help customize the response. For general information, see OData query parameters.
Request headers
Header | Value |
---|---|
Authorization | Bearer {token}. Required. |
Request body
Do not supply a request body for this method.
Response
If successful, this method returns a 200 OK
response code and a collection of educationAssignment objects in the response body.
Examples
Example 1: Get the assignments of the logged in user
Request
The following is an example of the request.
GET https://graph.microsoft.com/v1.0/education/me/assignments
Response
The following is an example of the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#education/me/assignments",
"value": [
{
"classId": "72a7baec-c3e9-4213-a850-f62de0adad5f",
"displayName": "Expand options 3.1",
"closeDateTime": "2021-11-19T07:59:00Z",
"dueDateTime": "2021-11-19T07:59:00Z",
"assignDateTime": null,
"assignedDateTime": null,
"allowLateSubmissions": false,
"resourcesFolderUrl": null,
"createdDateTime": "2021-11-10T23:56:21.1575202Z",
"lastModifiedDateTime": "2021-11-17T16:00:30.0523446Z",
"allowStudentsToAddResourcesToSubmission": false,
"status": "published",
"notificationChannelUrl": null,
"webUrl": "https://teams.microsoft.com/l/entity/66aeee93-507d-479a-a3ef-8f494af43945/classroom?context=%7B%22subEntityId%22%3A%22%7B%5C%22version%5C%22%3A%5C%221.0%5C%22,%5C%22config%5C%22%3A%7B%5C%22classes%5C%22%3A%5B%7B%5C%22id%5C%22%3A%5C%2272a7baec-c3e9-4213-a850-f62de0adad5f%5C%22,%5C%22displayName%5C%22%3Anull,%5C%22assignmentIds%5C%22%3A%5B%5C%223b870c07-21fe-47fb-8562-cdd6f2c281d6%5C%22%5D%7D%5D%7D,%5C%22action%5C%22%3A%5C%22navigate%5C%22,%5C%22view%5C%22%3A%5C%22assignment-viewer%5C%22%7D%22,%22channelId%22%3Anull%7D",
"addToCalendarAction": "none",
"addedStudentAction": "none",
"id": "3b870c07-21fe-47fb-8562-cdd6f2c281d6",
"instructions": null,
"grading": null,
"assignTo": null,
"createdBy": {
"application": null,
"device": null,
"user": {
"id": "f3a5344e-dbde-48b0-be24-b5b62a243836",
"displayName": null
}
},
"lastModifiedBy": {
"application": null,
"device": null,
"user": {
"id": "f3a5344e-dbde-48b0-be24-b5b62a243836",
"displayName": null
}
}
},
{
"classId": "72a7baec-c3e9-4213-a850-f62de0adad5f",
"displayName": "Expand options 4",
"closeDateTime": null,
"dueDateTime": "2021-11-12T07:59:00Z",
"assignDateTime": null,
"assignedDateTime": null,
"allowLateSubmissions": true,
"resourcesFolderUrl": null,
"createdDateTime": "2021-11-10T23:58:41.5064997Z",
"lastModifiedDateTime": "2021-11-10T23:58:41.5304842Z",
"allowStudentsToAddResourcesToSubmission": false,
"status": "draft",
"notificationChannelUrl": null,
"webUrl": "https://teams.microsoft.com/l/entity/66aeee93-507d-479a-a3ef-8f494af43945/classroom?context=%7B%22subEntityId%22%3A%22%7B%5C%22version%5C%22%3A%5C%221.0%5C%22,%5C%22config%5C%22%3A%7B%5C%22classes%5C%22%3A%5B%7B%5C%22id%5C%22%3A%5C%2272a7baec-c3e9-4213-a850-f62de0adad5f%5C%22,%5C%22displayName%5C%22%3Anull,%5C%22assignmentIds%5C%22%3A%5B%5C%2234ab8c17-eaae-4996-9c04-53696934e6ff%5C%22%5D%7D%5D%7D,%5C%22action%5C%22%3A%5C%22navigate%5C%22,%5C%22view%5C%22%3A%5C%22assignment-viewer%5C%22%7D%22,%22channelId%22%3Anull%7D",
"addToCalendarAction": "none",
"addedStudentAction": "none",
"id": "34ab8c17-eaae-4996-9c04-53696934e6ff",
"instructions": null,
"grading": null,
"assignTo": null,
"createdBy": {
"application": null,
"device": null,
"user": {
"id": "f3a5344e-dbde-48b0-be24-b5b62a243836",
"displayName": null
}
},
"lastModifiedBy": {
"application": null,
"device": null,
"user": {
"id": "f3a5344e-dbde-48b0-be24-b5b62a243836",
"displayName": null
}
}
}
]
}
Example 2: Get assignments of a user
Request
The following is an example of the request.
GET https://graph.microsoft.com/v1.0/education/users/f3a5344e-dbde-48b0-be24-b5b62a243836/assignments
Response
If user tries to query a different user-id than his own, this method returns a 403 Forbidden
response code.
The following is an example of the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#education/users('f3a5344e-dbde-48b0-be24-b5b62a243836')/assignments",
"value": [
{
"classId": "72a7baec-c3e9-4213-a850-f62de0adad5f",
"displayName": "Expand options 3.1",
"closeDateTime": "2021-11-19T07:59:00Z",
"dueDateTime": "2021-11-19T07:59:00Z",
"assignDateTime": null,
"assignedDateTime": null,
"allowLateSubmissions": false,
"resourcesFolderUrl": null,
"createdDateTime": "2021-11-10T23:56:21.1575202Z",
"lastModifiedDateTime": "2021-11-17T16:00:30.0523446Z",
"allowStudentsToAddResourcesToSubmission": false,
"status": "published",
"notificationChannelUrl": null,
"webUrl": "https://teams.microsoft.com/l/entity/66aeee93-507d-479a-a3ef-8f494af43945/classroom?context=%7B%22subEntityId%22%3A%22%7B%5C%22version%5C%22%3A%5C%221.0%5C%22,%5C%22config%5C%22%3A%7B%5C%22classes%5C%22%3A%5B%7B%5C%22id%5C%22%3A%5C%2272a7baec-c3e9-4213-a850-f62de0adad5f%5C%22,%5C%22displayName%5C%22%3Anull,%5C%22assignmentIds%5C%22%3A%5B%5C%223b870c07-21fe-47fb-8562-cdd6f2c281d6%5C%22%5D%7D%5D%7D,%5C%22action%5C%22%3A%5C%22navigate%5C%22,%5C%22view%5C%22%3A%5C%22assignment-viewer%5C%22%7D%22,%22channelId%22%3Anull%7D",
"addToCalendarAction": "none",
"addedStudentAction": "none",
"id": "3b870c07-21fe-47fb-8562-cdd6f2c281d6",
"instructions": null,
"grading": null,
"assignTo": null,
"createdBy": {
"application": null,
"device": null,
"user": {
"id": "f3a5344e-dbde-48b0-be24-b5b62a243836",
"displayName": null
}
},
"lastModifiedBy": {
"application": null,
"device": null,
"user": {
"id": "f3a5344e-dbde-48b0-be24-b5b62a243836",
"displayName": null
}
}
},
{
"classId": "72a7baec-c3e9-4213-a850-f62de0adad5f",
"displayName": "Expand options 4",
"closeDateTime": null,
"dueDateTime": "2021-11-12T07:59:00Z",
"assignDateTime": null,
"assignedDateTime": null,
"allowLateSubmissions": true,
"resourcesFolderUrl": null,
"createdDateTime": "2021-11-10T23:58:41.5064997Z",
"lastModifiedDateTime": "2021-11-10T23:58:41.5304842Z",
"allowStudentsToAddResourcesToSubmission": false,
"status": "draft",
"notificationChannelUrl": null,
"webUrl": "https://teams.microsoft.com/l/entity/66aeee93-507d-479a-a3ef-8f494af43945/classroom?context=%7B%22subEntityId%22%3A%22%7B%5C%22version%5C%22%3A%5C%221.0%5C%22,%5C%22config%5C%22%3A%7B%5C%22classes%5C%22%3A%5B%7B%5C%22id%5C%22%3A%5C%2272a7baec-c3e9-4213-a850-f62de0adad5f%5C%22,%5C%22displayName%5C%22%3Anull,%5C%22assignmentIds%5C%22%3A%5B%5C%2234ab8c17-eaae-4996-9c04-53696934e6ff%5C%22%5D%7D%5D%7D,%5C%22action%5C%22%3A%5C%22navigate%5C%22,%5C%22view%5C%22%3A%5C%22assignment-viewer%5C%22%7D%22,%22channelId%22%3Anull%7D",
"addToCalendarAction": "none",
"addedStudentAction": "none",
"id": "34ab8c17-eaae-4996-9c04-53696934e6ff",
"instructions": null,
"grading": null,
"assignTo": null,
"createdBy": {
"application": null,
"device": null,
"user": {
"id": "f3a5344e-dbde-48b0-be24-b5b62a243836",
"displayName": null
}
},
"lastModifiedBy": {
"application": null,
"device": null,
"user": {
"id": "f3a5344e-dbde-48b0-be24-b5b62a243836",
"displayName": null
}
}
}
]
}
Example 3: Get user assignments with expand submissions
Request
The following is an example of the request.
GET https://graph.microsoft.com/v1.0/education/users/80cefd93-8d88-40e2-b5d3-67898383e226/assignments?expand=submissions
Response
The following is an example of the response.
Note: It will expand submissions if the user has a student role, and will be null for teacher role.
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#education/users('80cefd93-8d88-40e2-b5d3-67898383e226')/assignments(submissions())",
"value": [
{
"classId": "72a7baec-c3e9-4213-a850-f62de0adad5f",
"displayName": "Reading test 09.03 #4",
"closeDateTime": null,
"dueDateTime": "2021-09-07T00:00:00Z",
"assignDateTime": null,
"assignedDateTime": null,
"allowLateSubmissions": true,
"resourcesFolderUrl": null,
"createdDateTime": "2021-09-13T19:18:35.2587894Z",
"lastModifiedDateTime": "2021-09-13T19:19:56.6381405Z",
"allowStudentsToAddResourcesToSubmission": false,
"status": "assigned",
"notificationChannelUrl": null,
"webUrl": null,
"addToCalendarAction": "none",
"addedStudentAction": "none",
"id": "1618dfb0-3ff2-4edf-8d5c-b8f81df00e80",
"instructions": null,
"assignTo": null,
"grading": {
"@odata.type": "#microsoft.graph.educationAssignmentPointsGradeType",
"maxPoints": 50
},
"createdBy": {
"application": null,
"device": null,
"user": {
"id": "f3a5344e-dbde-48b0-be24-b5b62a243836",
"displayName": null
}
},
"lastModifiedBy": {
"application": null,
"device": null,
"user": {
"id": "AAAAAAAA-0123-4567-89AB-1B4BB48C3119",
"displayName": null
}
},
"submissions": [
{
"status": "working",
"submittedDateTime": null,
"unsubmittedDateTime": null,
"returnedDateTime": null,
"reassignedDateTime": null,
"resourcesFolderUrl": null,
"id": "da443246-384d-673b-32db-bdba9d7f2b51",
"recipient": {
"@odata.type": "#microsoft.graph.educationSubmissionIndividualRecipient",
"userId": "80cefd93-8d88-40e2-b5d3-67898383e226"
},
"submittedBy": {
"application": null,
"device": null,
"user": {
"id": "80cefd93-8d88-40e2-b5d3-67898383e226",
"displayName": null
}
},
"unsubmittedBy": {
"application": null,
"device": null,
"user": {
"id": null,
"displayName": null
}
},
"returnedBy": {
"application": null,
"device": null,
"user": {
"id": null,
"displayName": null
}
},
"reassignedBy": {
"application": null,
"device": null,
"user": {
"id": null,
"displayName": null
}
}
}
]
}
]
}
Feedback
Submit and view feedback for