AnsweredAssumed Answered

Why Create Course with API Returns 404

Question asked by Janice Yee on May 13, 2020
Latest reply on May 14, 2020 by Janice Yee

course

Hi,

I'm attempting to create a course using this api from within Postman: 

POST /v1/accounts/{account_id}/courses 

 

Request JSON

{
"course": {
"name" : "API Development Test in Postman Term Test",
"course_code" : "1",
"start_at" : "2020-09-27T11:43:36.174Z",
"end_at" : "2020-10-27T11:43:36.174Z",
"license" : "private",
"is_public" : true,
"is_public_to_auth_users" : false,
"public_syllabus" : true,
"public_syllabus_to_auth" : false,
"public_description" : "This course will help you to learn how to create APIs using Java.",
"allow_student_wiki_edits" : false,
"allow_wiki_comments" : true,
"allow_student_forum_attachments" : true,
"open_enrollment" : true,
"self_enrollment" : true,
"restrict_enrollments_to_course_dates" : true,
"hide_final_grades" : true,
"apply_assignment_group_weights" : true,
"time_zone" : "Asia/Kolkata",
"default_view" : "feed",
"syllabus_body" : "This is dummy syllabus body",
"term_id": "1"
"offer" : true,
"enroll_me" : true,
"enable_sis_reactivation" : false
}

 

The response is:

{
    "errors": [
        {
            "message""The specified resource does not exist."
        }
    ]
}
However, if I changed the request JSON to skip term_id:
{
     "course": {
          "name" : "API Development Test in Postman Term Test",
          "course_code" : "1",
          "start_at" : "2020-09-27T11:43:36.174Z",
          "end_at" : "2020-10-27T11:43:36.174Z",
          "license" : "private",
          "is_public" : true,
          "is_public_to_auth_users" : false,
          "public_syllabus" : true,
          "public_syllabus_to_auth" : false,
          "public_description" : "This course will help you to learn how to create APIs using Java.",
          "allow_student_wiki_edits" : false,
          "allow_wiki_comments" : true,
          "allow_student_forum_attachments" : true,
          "open_enrollment" : true,
          "self_enrollment" : true,
          "restrict_enrollments_to_course_dates" : true,
          "hide_final_grades" : true,
          "apply_assignment_group_weights" : true,
          "time_zone" : "Asia/Kolkata",
          "default_view" : "feed",
          "syllabus_body" : "This is dummy syllabus body"
     },
"offer" : true,
"enroll_me" : true,
"enable_sis_reactivation" : false
}
Then, a course is created but the course name and code are persisted but term is not set:

{
    "id": 1392070,
    "root_account_id": 228,
    "enrollment_term_id": 88,
    "restrict_enrollments_to_course_dates": true,
    "start_at": "2020-09-27T11:43:36Z",
    "account_id": 18135,
    "uuid": "YyHCpkW0K41CoMSShZNAPtgSTVbpnljCeRb73YjG",
    "name": "API Development Test in Postman Term Test",
    "grading_standard_id": null,
    "is_public": true,
    "created_at": "2020-05-14T13:08:37Z",
    "allow_student_forum_attachments": true,
    "course_code": "1",
    "default_view": "feed",
    "open_enrollment": true,
    "allow_wiki_comments": true,
    "self_enrollment": true,
    "license": "private",
    "public_description": "This course will help you to learn how to create APIs using Java.",
    "grade_passback_setting": null,
    "end_at": "2020-10-27T11:43:36Z",
    "public_syllabus": true,
    "public_syllabus_to_auth": false,
    "storage_quota_mb": 50000,
    "is_public_to_auth_users": false,
    "hide_final_grades": true,
    "apply_assignment_group_weights": true,
    "calendar": {
        "ics": "https://<our host>/feeds/calendars/course_YyHCpkW0K41CoMSShZNAPtgSTVbpnljCeRb73YjG.ics"
    },
    "time_zone": "Asia/Kolkata",
    "blueprint": false,
    "sis_course_id": null,
    "sis_import_id": null,
    "integration_id": null,
    "workflow_state": "available"
}

 

What is the proper request JSON?

Outcomes