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.
This API is available in the following national cloud deployments.
Global service | US Government L4 | US Government L5 (DOD) | China operated by 21Vianet |
---|---|---|---|
✅ | ❌ | ❌ | ❌ |
Permissions
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
Permission type | Least privileged permissions | Higher privileged permissions |
---|---|---|
Delegated (work or school account) | EduAssignments.ReadBasic | EduAssignments.Read, EduAssignments.ReadWrite, EduAssignments.ReadWriteBasic |
Delegated (personal Microsoft account) | Not supported. | Not supported. |
Application | EduAssignments.ReadBasic.All | EduAssignments.Read.All, EduAssignments.ReadWrite.All, EduAssignments.ReadWriteBasic.All |
Calling the /me
endpoint requires a signed-in user and therefore delegated permissions. Application permissions aren't 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.
All properties are supported by the $filter
query parameter.
You can use $orderby
with the following properties of the educationAssignment resource: assignDateTime, assignedDateTime, closeDateTime, createdDateTime, displayName, dueDateTime, lastModifiedDateTime, and status.
Request headers
Header | Value |
---|---|
Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
Request body
Don't 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 signed-in user
Request
The following example shows a request.
GET https://graph.microsoft.com/v1.0/education/me/assignments
Response
The following example shows 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
}
}
}
]
}
Example 2: Get assignments of a user
Request
The following example shows a request.
GET https://graph.microsoft.com/v1.0/education/users/f3a5344e-dbde-48b0-be24-b5b62a243836/assignments
Response
If a user tries to query a different user than their own, this method returns a 403 Forbidden
response code.
The following example shows 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
}
}
}
]
}
Example 3: Get user assignments with expand submissions
Request
The following example shows a request.
GET https://graph.microsoft.com/v1.0/education/users/80cefd93-8d88-40e2-b5d3-67898383e226/assignments?expand=submissions
Response
The following example shows 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
}
}
}
]
}
]
}
Example 4: Using $filter
to get user assignments
Request
The following example shows a request.
GET https://graph.microsoft.com/v1.0/education/me/assignments?$filter=dueDateTime eq 2050-05-18T17:00:00Z
Response
The following example shows 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",
"@odata.nextLink": "https://graph.microsoft.com/v1.0/education/me/assignments?$filter=dueDateTime+eq+2050-05-18T17%3a00%3a00Z&$skiptoken=MyZRVkZCUVVGQlFVRk9RVUZCUVVGQlFVRkJRWGxCUVVGQmVFNDJOV0pqWTJ0RVJXMVFUVU5NUTJodVUxYzVkejA5",
"value": [
{
"classId": "2003c52e-807a-4186-9b49-60c573095461",
"displayName": "2022-04-14T05_08_50_854Z",
"closeDateTime": "2050-05-26T17:00:00Z",
"dueDateTime": "2050-05-18T17:00:00Z",
"assignDateTime": null,
"assignedDateTime": null,
"allowLateSubmissions": true,
"resourcesFolderUrl": null,
"feedbackResourcesFolderUrl": null,
"createdDateTime": "2022-04-13T05:09:21.009Z",
"lastModifiedDateTime": "2022-10-19T23:02:21.3868802Z",
"allowStudentsToAddResourcesToSubmission": false,
"status": "assigned",
"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%222003c52e-807a-4186-9b49-60c573095461%5C%22,%5C%22displayName%5C%22%3Anull,%5C%22assignmentIds%5C%22%3A%5B%5C%222be08d97-b140-4eec-8cbd-88238d571060%5C%22%5D,%5C%22submissionId%5C%22%3Anull%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": "2be08d97-b140-4eec-8cbd-88238d571060",
"instructions": null,
"assignTo": null,
"grading": {
"@odata.type": "#microsoft.graph.educationAssignmentPointsGradeType",
"maxPoints": 100
},
"createdBy": {
"application": null,
"device": null,
"user": {
"id": "fffafb29-e8bc-4de3-8106-be76ed2ad499",
"displayName": null
}
},
"lastModifiedBy": {
"application": null,
"device": null,
"user": {
"id": "AAAAAAAA-0123-4567-89AB-1B4BB48C3119",
"displayName": null
}
}
}
]
}
Example 5: Using $orderby
to get user assignments
Request
The following example shows a request.
GET https://graph.microsoft.com/v1.0/education/me/assignments?$orderby=createdDateTime
Response
The following example shows 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",
"@odata.nextLink": "https://graph.microsoft.com/v1.0/education/me/assignments?$orderby=createdDateTime&$skiptoken=MyZRVkZCUVVGQlFVRlVkMUZCUVVGQlFVRkJRWGxCUVVGQmNFRkhaMEY1ZFhOelJXRm1TRmRrWTBoT1MwVjVRVDA5",
"@microsoft.graph.tips": "Use $select to choose only the properties your app needs, as this can lead to performance improvements. For example: GET education/me/assignments?$select=addedStudentAction,addToCalendarAction",
"value": [
{
"classId": "b009a655-584c-4cb7-80dd-2cf04ec863d2",
"displayName": "2023-08-30T05:24:32.267Z2578",
"closeDateTime": null,
"dueDateTime": "2023-09-29T05:24:32.267Z",
"assignDateTime": null,
"assignedDateTime": "2023-08-30T05:24:40.846Z",
"allowLateSubmissions": true,
"resourcesFolderUrl": null,
"feedbackResourcesFolderUrl": null,
"createdDateTime": "2023-08-30T05:24:32.492Z",
"lastModifiedDateTime": "2023-08-30T05:24:40.905Z",
"allowStudentsToAddResourcesToSubmission": false,
"status": "assigned",
"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%22b009a655-584c-4cb7-80dd-2cf04ec863d2%5C%22,%5C%22assignmentIds%5C%22%3A%5B%5C%22e9d561aa-a6b2-4b53-8dcb-999f202d6bef%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,%5C%22appId%5C%22%3A%5C%22de8bc8b5-d9f9-48b1-a8ad-b748da725064%5C%22%7D%22,%22channelId%22%3Anull%7D",
"addToCalendarAction": "none",
"addedStudentAction": "none",
"id": "e9d561aa-a6b2-4b53-8dcb-999f202d6bef",
"instructions": null,
"assignTo": null,
"grading": {
"@odata.type": "#microsoft.graph.educationAssignmentPointsGradeType",
"maxPoints": 100
},
"createdBy": {
"application": null,
"device": null,
"user": {
"id": "fffafb29-e8bc-4de3-8106-be76ed2ad499",
"displayName": null
}
},
"lastModifiedBy": {
"application": null,
"device": null,
"user": {
"id": "AAAAAAAA-0123-4567-89AB-1B4BB48C3119",
"displayName": null
}
}
}
]
}