2

我正在尝试通过 Microsoft Graph 获得我的 Microsoft Teams 作业。我提交了这个 GET 请求https://graph.microsoft.com/beta/education/me/classes/{id}/assignments,如文档中所示,我的身份验证令牌作为标头。但是,以下是我得到的答复。我正在使用 python 执行此操作,但是我也尝试从 Graph Explorer 产生相同的结果。

{
"error": {
  "code": "InternalServerError",
  "message": "Object reference not set to an instance of an object.",
  "innerError": {
    "date": "2020-09-07T16:44:48",
    "request-id": "011086a0-9240-4896-9363-d403a1a0fb05"
    }
  }
}

有没有人有任何见识?这是微软的问题吗?

4

1 回答 1

0

您需要删除/me. 正确的 URI 是https://graph.microsoft.com/beta/education/classes/{id}/assignments.

文档

POST https://graph.microsoft.com/beta/education/classes/11019/assignments
Content-type: application/json
Content-length: 279

{ 
  "dueDateTime": "2014-02-01T00:00:00Z",
  "displayName": "Midterm 1",
    "instructions":  {
      "contentType": "text",
      "content": "Read chapters 1 through 3"
    },
      "grading": {
        "@odata.type": "#microsoft.education.assignments.api.educationAssignmentPointsGradeType",
        "maxPoints": 100
      },
      "assignTo": {
        "@odata.type": "#microsoft.education.assignments.api.educationAssignmentClassRecipient"
      },
      "status":"draft",
      "allowStudentsToAddResourcesToSubmission": true
}
于 2020-09-10T16:07:36.283 回答