Microsoft Graph - ошибка POST-запроса 20132

Я не могу получить запрос POST для создания назначений с помощью Microsoft Graph.

И в 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
}

Любая помощь будет по достоинству оценена!

Пожалуйста, смотрите изображение Graph Explorer ниже.

Microsoft Graph Пример запроса

1 ответ

Догадаться. Удаление "contentType": "Text" Атрибут из инструкции сработал.

Другие вопросы по тегам