1

我似乎无法收到使用 Microsoft Graph 创建分配的 POST 请求。

在 Graph Explorer 和 PHP 中,我都会遇到同样的错误:"message": "The content of the request is invalid. Common causes are an invalid Content-Type header or no content in the body.",

端点:https ://graph.microsoft.com/beta/education/classes/class-id/assignments

请求标头:content-type: application/json

身体:

{
  "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
}

任何帮助将不胜感激!

请参阅下面的图形资源管理器的图像。

Microsoft Graph 示例请求

4

1 回答 1

1

弄清楚了。"contentType": "Text"从指令中删除属性有效。

于 2018-11-08T15:54:38.837 回答