Observação
O acesso a essa página exige autorização. Você pode tentar entrar ou alterar diretórios.
O acesso a essa página exige autorização. Você pode tentar alterar os diretórios.
Namespace: microsoft.graph
Importante
As APIs na versão /beta no Microsoft Graph estão sujeitas a alterações. Não há suporte para o uso dessas APIs em aplicativos de produção. Para determinar se uma API está disponível na v1.0, use o seletor Versão.
Recupere uma lista de objetos educationAssignment . Somente professores, alunos e aplicativos com permissões de aplicativo podem executar esta operação.
Um professor ou um aplicativo em execução com permissões de aplicativo pode ver todos os objetos de tarefa da classe. Os alunos só podem ver as tarefas atribuídas a eles.
Disponibilidade da API
Essa API está disponível nas seguintes implantações de nuvem nacional.
| Serviço global | Governo dos EUA L4 | US Government L5 (DOD) | China operada pela 21Vianet |
|---|---|---|---|
| ✅ | ❌ | ❌ | ❌ |
Permissões
Escolha a(s) permissão(s) marcada(s) como menos privilegiada(s) para essa API. Use uma permissão ou permissões com privilégios mais altos somente se o aplicativo exigir. Para obter detalhes sobre permissões delegadas e de aplicativo, consulte Tipos de permissão. Para saber mais sobre essas permissões, consulte a referência de permissões.
| Tipo de permissão | Permissões menos privilegiadas | Permissões com privilégios mais elevados |
|---|---|---|
| Delegado (conta corporativa ou de estudante) | EduAssignments.ReadBasic | EduAssignments.Read, EduAssignments.ReadWrite, EduAssignments.ReadWriteBasic |
| Delegado (conta pessoal da Microsoft) | Sem suporte. | Sem suporte. |
| Application | EduAssignments.ReadBasic.All | EduAssignments.Read.All, EduAssignments.ReadWrite.All, EduAssignments.ReadWriteBasic.All |
Solicitação HTTP
GET /education/classes/{id}/assignments
Parâmetros de consulta opcionais
Esse método dá suporte $expand ao parâmetro de consulta OData para ajudar a personalizar a resposta.
As seguintes $expand opções estão disponíveis para este método: categories, resources, rubricsubmissions, e *, que inclui todas as opções anteriores.
Todas as propriedades têm suporte para os parâmetros $filter de consulta e $orderby.
Cabeçalhos de solicitação
| Cabeçalho | Valor |
|---|---|
| Autorização | {token} de portador. Obrigatório. Saiba mais sobre autenticação e autorização. |
Corpo da solicitação
Não forneça um corpo de solicitação para esse método.
Resposta
Se for bem-sucedido, esse método retornará um 200 OK código de resposta e uma coleção de objetos educationAssignment no corpo da resposta.
Exemplos
Exemplo 1: Obter atribuições
Solicitação
O exemplo a seguir mostra uma solicitação.
GET https://graph.microsoft.com/beta/education/classes/ce2cd7da-e41b-4e66-8390-c9251e4c3a40/assignments
Resposta
O exemplo a seguir mostra a resposta.
Observação: o objeto de resposta mostrado aqui pode ser encurtado para legibilidade.
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#education/classes('ce2cd7da-e41b-4e66-8390-c9251e4c3a40')/assignments",
"@odata.nextLink": "https://graph.microsoft.com/beta/education/classes/ce2cd7da-e41b-4e66-8390-c9251e4c3a40/assignments?$skiptoken=MyZRVkZCUVVGQlFVRlNRVUZCUVVGQlFVRkJRWGxCUVVGQlNDczVLMmRqVWpsWWEyVlhWV3BwVkVrd09EUk1aejA5",
"@microsoft.graph.tips": "Use $select to choose only the properties your app needs, as this can lead to performance improvements. For example: GET education/classes('<guid>')/assignments?$select=addedStudentAction,addToCalendarAction",
"value": [
{
"classId": "ce2cd7da-e41b-4e66-8390-c9251e4c3a40",
"displayName": "New assignment",
"closeDateTime": null,
"dueDateTime": "2025-05-09T00:00:00Z",
"assignDateTime": null,
"assignedDateTime": null,
"allowLateSubmissions": true,
"resourcesFolderUrl": null,
"feedbackResourcesFolderUrl": null,
"createdDateTime": "2025-05-07T18:17:06.2831309Z",
"lastModifiedDateTime": "2025-05-07T18:17:06.4526679Z",
"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%22ce2cd7da-e41b-4e66-8390-c9251e4c3a40%5C%22,%5C%22assignmentIds%5C%22%3A%5B%5C%22f5e60dc1-d084-4ca4-a3b4-025f11023059%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",
"languageTag": "en-US",
"moduleUrl": null,
"id": "f5e60dc1-d084-4ca4-a3b4-025f11023059",
"grading": null,
"instructions": {
"content": null,
"contentType": "text"
},
"assignTo": {
"@odata.type": "#microsoft.graph.educationAssignmentClassRecipient"
},
"createdBy": {
"application": null,
"device": null,
"user": {
"id": "fffafb29-e8bc-4de3-8106-be76ed2ad499",
"displayName": null
}
},
"lastModifiedBy": {
"application": null,
"device": null,
"user": {
"id": "fffafb29-e8bc-4de3-8106-be76ed2ad499",
"displayName": null
}
}
}
]
}
Exemplo 2: Obter atribuições usando opções $expand
Solicitação
O exemplo a seguir mostra uma solicitação.
GET https://graph.microsoft.com/beta/education/classes/ce2cd7da-e41b-4e66-8390-c9251e4c3a40/assignments?$expand=resources
Resposta
O exemplo a seguir mostra a resposta. A resposta inclui a lista de recursos para cada tarefa.
Observação: o objeto de resposta mostrado aqui pode ser encurtado para legibilidade.
HTTP/1.1 200 OK
Content-type: application/json
Content-length: 344
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#education/classes('ce2cd7da-e41b-4e66-8390-c9251e4c3a40')/assignments(resources())",
"@odata.nextLink": "https://graph.microsoft.com/beta/education/classes/ce2cd7da-e41b-4e66-8390-c9251e4c3a40/assignments?$expand=resources&$skiptoken=MyZRVkZCUVVGQlFVRlNRVUZCUVVGQlFVRkJRWGxCUVVGQmRFY3lhVXgwV20xWVZYbDZOMHhqY1ZKckswMXBkejA5",
"@microsoft.graph.tips": "Use $select to choose only the properties your app needs, as this can lead to performance improvements. For example: GET education/classes('<guid>')/assignments?$select=addedStudentAction,addToCalendarAction",
"value": [
{
"classId": "ce2cd7da-e41b-4e66-8390-c9251e4c3a40",
"displayName": "New assignment",
"closeDateTime": null,
"dueDateTime": "2025-05-09T00:00:00Z",
"assignDateTime": null,
"assignedDateTime": null,
"allowLateSubmissions": true,
"resourcesFolderUrl": null,
"feedbackResourcesFolderUrl": null,
"createdDateTime": "2025-05-07T18:17:06.2831309Z",
"lastModifiedDateTime": "2025-05-07T18:17:06.4526679Z",
"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%22ce2cd7da-e41b-4e66-8390-c9251e4c3a40%5C%22,%5C%22assignmentIds%5C%22%3A%5B%5C%22f5e60dc1-d084-4ca4-a3b4-025f11023059%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",
"languageTag": "en-US",
"moduleUrl": null,
"id": "f5e60dc1-d084-4ca4-a3b4-025f11023059",
"grading": null,
"instructions": {
"content": null,
"contentType": "text"
},
"assignTo": {
"@odata.type": "#microsoft.graph.educationAssignmentClassRecipient"
},
"createdBy": {
"application": null,
"device": null,
"user": {
"id": "fffafb29-e8bc-4de3-8106-be76ed2ad499",
"displayName": null
}
},
"lastModifiedBy": {
"application": null,
"device": null,
"user": {
"id": "fffafb29-e8bc-4de3-8106-be76ed2ad499",
"displayName": null
}
},
"resources@odata.context": "https://graph.microsoft.com/beta/$metadata#education/classes('ce2cd7da-e41b-4e66-8390-c9251e4c3a40')/assignments('f5e60dc1-d084-4ca4-a3b4-025f11023059')/resources",
"resources": []
}
]
}
Exemplo 3: Usando $filter para obter atribuições
Solicitação
O exemplo a seguir mostra uma solicitação.
GET https://graph.microsoft.com/beta/education/classes/ce2cd7da-e41b-4e66-8390-c9251e4c3a40/assignments?$filter=status eq 'assigned'
Resposta
O exemplo a seguir mostra a resposta.
Observação: o objeto de resposta mostrado aqui pode ser encurtado para legibilidade.
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#education/classes('ce2cd7da-e41b-4e66-8390-c9251e4c3a40')/assignments(resources())",
"@odata.nextLink": "https://graph.microsoft.com/beta/education/classes/ce2cd7da-e41b-4e66-8390-c9251e4c3a40/assignments?$expand=resources&$skiptoken=MyZRVkZCUVVGQlFVRlNRVUZCUVVGQlFVRkJRWGxCUVVGQlozTk9VVEZCWmpCS01IRm5ZMHBzTVhGT0szY3JkejA5",
"@microsoft.graph.tips": "Use $select to choose only the properties your app needs, as this can lead to performance improvements. For example: GET education/classes('<guid>')/assignments?$select=addedStudentAction,addToCalendarAction",
"value": [
{
"classId": "ce2cd7da-e41b-4e66-8390-c9251e4c3a40",
"displayName": "New assignment",
"closeDateTime": null,
"dueDateTime": "2025-05-09T00:00:00Z",
"assignDateTime": null,
"assignedDateTime": null,
"allowLateSubmissions": true,
"resourcesFolderUrl": null,
"feedbackResourcesFolderUrl": null,
"createdDateTime": "2025-05-07T18:17:06.2831309Z",
"lastModifiedDateTime": "2025-05-07T18:17:06.4526679Z",
"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%22ce2cd7da-e41b-4e66-8390-c9251e4c3a40%5C%22,%5C%22assignmentIds%5C%22%3A%5B%5C%22f5e60dc1-d084-4ca4-a3b4-025f11023059%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",
"languageTag": "en-US",
"moduleUrl": null,
"id": "f5e60dc1-d084-4ca4-a3b4-025f11023059",
"grading": null,
"instructions": {
"content": null,
"contentType": "text"
},
"assignTo": {
"@odata.type": "#microsoft.graph.educationAssignmentClassRecipient"
},
"createdBy": {
"application": null,
"device": null,
"user": {
"id": "fffafb29-e8bc-4de3-8106-be76ed2ad499",
"displayName": null
}
},
"lastModifiedBy": {
"application": null,
"device": null,
"user": {
"id": "fffafb29-e8bc-4de3-8106-be76ed2ad499",
"displayName": null
}
},
"resources@odata.context": "https://graph.microsoft.com/beta/$metadata#education/classes('ce2cd7da-e41b-4e66-8390-c9251e4c3a40')/assignments('f5e60dc1-d084-4ca4-a3b4-025f11023059')/resources",
"resources": []
}
]
}
Exemplo 4: Usando $orderby para obter atribuições
Solicitação
O exemplo a seguir mostra uma solicitação.
GET https://graph.microsoft.com/beta/education/classes/ce2cd7da-e41b-4e66-8390-c9251e4c3a40/assignments?$ordeby= id
Resposta
O exemplo a seguir mostra a resposta.
Observação: o objeto de resposta mostrado aqui pode ser encurtado para legibilidade.
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#education/classes('ce2cd7da-e41b-4e66-8390-c9251e4c3a40')/assignments",
"@odata.nextLink": "https://graph.microsoft.com/beta/education/classes/ce2cd7da-e41b-4e66-8390-c9251e4c3a40/assignments?$filter=status+eq+%27assigned%27&$skiptoken=MyZRVkZCUVVGQlFVRlJkMEZCUVVGQlFVRkJRWGxCUVVGQllWbFdhVlF5UVdWcVZYbEZNRXB0TUhWVFRYUXpkejA5",
"@microsoft.graph.tips": "Use $select to choose only the properties your app needs, as this can lead to performance improvements. For example: GET education/classes('<guid>')/assignments?$select=addedStudentAction,addToCalendarAction",
"value": [
{
"classId": "ce2cd7da-e41b-4e66-8390-c9251e4c3a40",
"displayName": "Physics",
"closeDateTime": null,
"dueDateTime": "2024-07-05T18:29:00Z",
"assignDateTime": null,
"assignedDateTime": "2024-07-04T10:13:55.7459728Z",
"allowLateSubmissions": true,
"resourcesFolderUrl": null,
"feedbackResourcesFolderUrl": "https://graph.microsoft.com/v1.0/drives/b!uf0jSRLkbEOG04PymQ5PtqVEDwHjP_xMlkkpCG-1CkLPLpFkTfqZR5sy80gMS-VY/items/01VPGD5VLEUC5G56NOFVDKD6POMN4LGKVD",
"createdDateTime": "2024-07-04T08:46:19.8896923Z",
"lastModifiedDateTime": "2024-07-04T10:13:59.8878321Z",
"allowStudentsToAddResourcesToSubmission": true,
"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%22ce2cd7da-e41b-4e66-8390-c9251e4c3a40%5C%22,%5C%22assignmentIds%5C%22%3A%5B%5C%22cb190e9f-650d-4798-b8d0-6d00079a4c4b%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": "studentsAndPublisher",
"addedStudentAction": "none",
"languageTag": "en-US",
"moduleUrl": null,
"id": "cb190e9f-650d-4798-b8d0-6d00079a4c4b",
"instructions": {
"content": "<div>Screw guage</div>",
"contentType": "html"
},
"grading": {
"@odata.type": "#microsoft.graph.educationAssignmentPointsGradeType",
"maxPoints": 100
},
"assignTo": {
"@odata.type": "#microsoft.graph.educationAssignmentClassRecipient"
},
"createdBy": {
"application": null,
"device": null,
"user": {
"id": "0dcb98c3-8c7c-4f7a-a10d-7ed76e03e38f",
"displayName": null
}
},
"lastModifiedBy": {
"application": null,
"device": null,
"user": {
"id": "5e3ce6c0-2b1f-4285-8d4b-75ee78787346",
"displayName": null
}
}
}
]
}
Exemplo 5: Use $expand para obter o gradingScheme de uma tarefa
Solicitação
O exemplo a seguir mostra uma solicitação.
GET https://graph.microsoft.com/beta/education/classes/37d99af7-cfc5-4e3b-8566-f7d40e4a2070/assignments?&expand=gradingScheme
Resposta
O exemplo a seguir mostra a resposta.
Observação: o objeto de resposta mostrado aqui pode ser encurtado para legibilidade.
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#education/classes('37d99af7-cfc5-4e3b-8566-f7d40e4a2070')/assignments(gradingScheme())",
"@odata.nextLink": "https://graph.microsoft.com/beta/education/classes/37d99af7-cfc5-4e3b-8566-f7d40e4a2070/assignments?expand=gradingScheme&$skiptoken=MyZRVkZCUVVGQlFVRmtRVVZCUVVGQlFVRkJRWGxCUVVGQmNubDJiblZOYzBnNVJWTndkbEJHVTNKVlVuVmlRVDA5",
"@microsoft.graph.tips": "Use $select to choose only the properties your app needs, as this can lead to performance improvements. For example: GET education/classes('<guid>')/assignments?$select=addedStudentAction,addToCalendarAction",
"value": [
{
"classId": "37d99af7-cfc5-4e3b-8566-f7d40e4a2070",
"displayName": "new submission",
"closeDateTime": null,
"dueDateTime": "2025-04-29T18:29:00Z",
"assignDateTime": null,
"assignedDateTime": "2025-04-29T14:53:05.2974529Z",
"allowLateSubmissions": true,
"resourcesFolderUrl": null,
"feedbackResourcesFolderUrl": "https://graph.microsoft.com/v1.0/drives/b!-Ik2sRPLDEWy_bR8l75jfeDcpXQcRKVOmcml10NQLQ1F8CNZWU38SarWxPyWM7jx/items/01VANVJQ7ONF5UOYTXZVEKCZE43FTQRH2S",
"createdDateTime": "2025-04-29T14:52:15.4472281Z",
"lastModifiedDateTime": "2025-05-07T21:28:57.6756103Z",
"allowStudentsToAddResourcesToSubmission": true,
"status": "assigned",
"notificationChannelUrl": "https://graph.microsoft.com/v1.0/teams/37d99af7-cfc5-4e3b-8566-f7d40e4a2070/channels/37d99af7-cfc5-4e3b-8566-f7d40e4a2070",
"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%2237d99af7-cfc5-4e3b-8566-f7d40e4a2070%5C%22,%5C%22assignmentIds%5C%22%3A%5B%5C%22ed33a213-f67f-4eb8-bfea-f45e6cba041f%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": "studentsAndTeamOwners",
"addedStudentAction": "assignIfOpen",
"languageTag": "en-US",
"moduleUrl": "https://graph.microsoft.com/v1.0/education/classes/37d99af7-cfc5-4e3b-8566-f7d40e4a2070/modules/1b9a03b6-dcc5-4ff1-8226-b92e25072f43/",
"id": "ed33a213-f67f-4eb8-bfea-f45e6cba041f",
"instructions": {
"content": "new submission",
"contentType": "html"
},
"grading": {
"@odata.type": "#microsoft.graph.educationAssignmentPointsGradeType",
"maxPoints": 100
},
"assignTo": {
"@odata.type": "#microsoft.graph.educationAssignmentClassRecipient"
},
"createdBy": {
"application": null,
"device": null,
"user": {
"id": "fffafb29-e8bc-4de3-8106-be76ed2ad499",
"displayName": null
}
},
"lastModifiedBy": {
"application": null,
"device": null,
"user": {
"id": "fffafb29-e8bc-4de3-8106-be76ed2ad499",
"displayName": null
}
},
"gradingScheme": {
"id": "696290ba-1925-490e-a5d2-026bad0dbdc1",
"displayName": "New name for Pass/Fail Scheme",
"hidePointsDuringGrading": false,
"grades": [
{
"displayName": "Pass",
"minPercentage": 60,
"defaultPercentage": 100
},
{
"displayName": "Fail",
"minPercentage": 0,
"defaultPercentage": 0
}
]
}
}
]
}