Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • GET /api/courses

    • Returns a list of Courses.

    • Response
      HTTP 200

    Code Block
    languagejson
    {
      "courses": [
        {
          "id": 103,
          "name": "Course 103 - S3 Video",
          "type": null,
          "description": null,
          "status": "published",
          "featured_image_id": null,
          "instructor_id": null,
          "objectives": [],
          "length": "00:00:00",
          "completion_url": null,
          "experience_completion_urls": null,
          "custom_completion_message": null,
          "event_dates": null,
          "event_dates_requirement": null,
          "allow_local_leader_read_only": 0,
          "should_invite_users": 0,
          "due_date": null,
          "credit_value": null,
          "user_limit": null,
          "feedback_url": null,
          "feedback_label": null,
          "feedback_description": null,
          "language": null,
          "hidden": 0,
          "premium": 0,
          "registration_fee": null,
          "stackable_place_ids": null,
          "opens_at": null,
          "closes_at": null,
          "published_at": null,
          "created_at": "2023-09-11T21:03:41.000000Z",
          "updated_at": "2023-09-11T21:03:41.000000Z",
          "deleted_at": null,
          "class_name": "App\\Models\\Course",
          "image_url": "<url>",
          "excerpt": "",
          "is_actionable": true,
          "featured_image": null
        },
        ...
      ]
    }
  • GET /api/courses/{course}

    • Returns a single Course.

    • Parameters

      • course: int, required - The ID of the Course.

    • Response
      HTTP 200

    Code Block
    languagejson
    {
      "course": {
        "id": 103,
        "name": "Course 103 - S3 Video",
        "type": null,
        "description": null,
        "status": "published",
        "featured_image_id": null,
        "instructor_id": null,
        "objectives": [],
        "length": "00:00:00",
        "completion_url": null,
        "experience_completion_urls": null,
        "custom_completion_message": null,
        "event_dates": null,
        "event_dates_requirement": null,
        "allow_local_leader_read_only": 0,
        "should_invite_users": 0,
        "due_date": null,
        "credit_value": null,
        "user_limit": null,
        "feedback_url": null,
        "feedback_label": null,
        "feedback_description": null,
        "language": null,
        "hidden": 0,
        "premium": 0,
        "registration_fee": null,
        "stackable_place_ids": null,
        "opens_at": null,
        "closes_at": null,
        "published_at": null,
        "created_at": "2023-09-11T21:03:41.000000Z",
        "updated_at": "2023-09-11T21:03:41.000000Z",
        "deleted_at": null,
        "class_name": "App\\Models\\Course",
        "image_url": "<url>",
        "excerpt": "",
        "is_actionable": true,
        "featured_image": null,
        "assets": [
          {
            "id": 1,
            "type": "tincan",
            "url": "<url>",
            "rtmp_input_url": null,
            "rtmp_endpoint_url": null,
            "assetable_id": 1,
            "assetable_type": "App\\Models\\Course",
            "mentee_mentor_id": null,
            "date": null,
            "publicize_live_course": null,
            "rsvp_users_count": null,
            "created_at": "2020-02-19T17:11:12.000000Z",
            "updated_at": "2021-03-18T17:16:23.000000Z",
            "deleted_at": null,
            "meeting_calendar_link": null,
            "next_date_human_readable": null
          },
          {
            "id": 3,
            "type": "image",
            "url": "images/image.jpg",
            "rtmp_input_url": null,
            "rtmp_endpoint_url": null,
            "assetable_id": 103,
            "assetable_type": "App\\Models\\Course",
            "mentee_mentor_id": null,
            "date": null,
            "publicize_live_course": null,
            "rsvp_users_count": null,
            "created_at": "2020-02-19T17:17:19.000000Z",
            "updated_at": "2020-04-01T15:23:40.000000Z",
            "deleted_at": null,
            "meeting_calendar_link": null,
            "next_date_human_readable": null
          }
        ]
      }
    }
  • POST api/courses

    • Creates a new Course.

    • Headers

      • Content-Type: multipart/form-data

    • Parameters

      • name: string, required - The name of the Course.

      • description: string, nullable - The description of the Course.

      • type: string, nullable - The type of the Course. Must be either null or 'experience'.

      • length: string, nullable - The length of the Course.

      • objectives: array, nullable - An array of objectives (strings) for the Course.

      • featured_image_id: int, nullable - The ID of the Featured Image for the Course.

      • instructor_id: int, nullable - The ID of the Instructor for the Course.

      • hidden: boolean, nullable - Whether or not the Course is hidden.

      • premium: boolean, nullable - Whether or not the Course is premium.

      • registration_fee: float, nullable - The registration fee for the Course.

      • user_limit: int, nullable - The user limit for the Course.

      • published_at: string, nullable - The date and time the Course was or will be published. Must be in the format YYYY-MM-DD HH:MM:SS.

      • opens_at: string, nullable - The date and time the Course enrollment opens. Must be in the format YYYY-MM-DD HH:MM:SS.

      • closes_at: string, nullable - The date and time the Course enrollment closes. Must be in the format YYYY-MM-DD HH:MM:SS.

      • due_date: string, nullable - The date and time the Course is due. Must be in the format YYYY-MM-DD HH:MM:SS.

      • event_dates: array, nullable - An array of event dates for the Course. Each event date must be an object with the following properties:

        • date: string, required - The date and time of the event. Must be in the format YYYY-MM-DD HH:MM:SS.

        • capacity: int, nullable - The capacity of the event.

        • location: string, nullable - The location of the event.

      • event_dates_requirement: string, nullable - The requirement for event dates. Must be either null, 'all', or 'one'.

      • feedback_url: string, nullable - The URL for the feedback form for the Course.

      • feedback_label: string, nullable - The label for the feedback form for the Course.

      • feedback_description: string, nullable - The description for the feedback form for the Course.

      • credit_value: int, nullable - The number of credits the Course is worth.

      • custom_completion_message: string, nullable - A custom completion message to include in the email notification to the User upon completion of the Course.

      • language: string, nullable - The language of the Course.

      • allow_local_leader_read_only: boolean, nullable - Whether or not to give Local Leaders read-only access to an otherwise global In-Person course. Only applicable when type is 'experience'.

      • should_invite_users: boolean, nullable - Whether or not to send an invitation email to the User upon creation of the Course.

      • formstack_url: string, nullable - The URL for the Formstack form for the Course.

      • oembed_url: string, nullable - The URL for the oEmbed media for the Course.

      • storyline: file, nullable - The Storyline file for the Course. Must be a .zip file.

      • tincan: file, nullable - The TinCan file for the Course. Must be a .zip file.

      • zoom_urls: array, nullable - An array of Zoom URL data objects for the Course.

        • url: string, required - The URL for the Zoom meeting.

        • date: string, required - The date and time of the Zoom meeting. Must be in the format YYYY-MM-DD HH:MM:SS.

      • cohort_ids: array, nullable - An array of Cohort IDs to associate with the Course.

      • credit_ids: array, nullable - An array of Credit IDs to associate with the Course.

      • group_ids_and_includes: array, nullable - An array of Group IDs to associate with the Course. Each item in the array must be an object with the following properties:

        • id: int, required - The ID of the Group.

        • include_descendants: boolean, required - Whether or not to include the Group's descendants in the Course's user scoping.

      • stackable_place_ids: array, nullable - An array of Place IDs to associate with the Course.

    • Response
      HTTP 200

    Code Block
    languagejson
    {
      "course": {
        "description": "Description for API Test Course",
        "name": "API Test Course",
        "updated_at": "2023-09-19T00:32:14.000000Z",
        "created_at": "2023-09-19T00:32:14.000000Z",
        "id": 105,
        "class_name": "App\\Models\\Course",
        "image_url": "<url>",
        "excerpt": "Description for API Test Course", 
        "is_actionable": false,
        "featured_image": null
      },
      "success": "Course created successfully."
    }
    • Errors
      HTTP 422 - E.g., no "name" parameter specified

    Code Block
    languagejson
    {
      "errors": {
        "name": ["The name field is required."]
      },
      "message": "The name field is required."
    }
  • POST api/courses/{course}

    • Updates an existing Course.

    • Headers

      • Content-Type: multipart/form-data

    • Parameters

      • course: int, required - The ID of the Course to update.

      • _method: string, required - Must be 'PUT'.

      • Additional parameters are the same as for POST creation, above.

    • Response
      HTTP 200

    Code Block
    languagejson
    {
      "course": {
        "description": "Description for API Test Course",
        "name": "API Test Course",
        "updated_at": "2023-09-19T00:32:14.000000Z",
        "created_at": "2023-09-19T00:32:14.000000Z",
        "id": 105,
        "class_name": "App\\Models\\Course",
        "image_url": "<url>",
        "excerpt": "Description for API Test Course", 
        "is_actionable": false,
        "featured_image": null
      },
      "success": "Course updated successfully."
    }
    • Errors
      HTTP 422 - E.g., no "name" parameter specified

    Code Block
    languagejson
    {
      "errors": {
        "name": ["The name field is required."]
      },
      "message": "The name field is required."
    }
  • DELETE api/courses/{course}

    • Deletes a Course.

    • Parameters

      • course: int, required - The ID of the Course to delete.

    • Response
      HTTP 200

    Code Block
    languagejson
    {
      "success": "Course deleted successfully."
    }
  • POST api/courses/{course}/userusers/{user}

    • Attaches a User to a Course.

    • Parameters

      • course: int, required - The ID of the Course to attach the User to.

      • user: int, required - The ID of the User to attach to the Course.

      • status_mask: int, required - The status mask to apply to the User's enrollment in the Course. Must be one of the following:

        • null: not started

        • 1: started

        • 2: completed

    • Response
      HTTP 200

    Code Block
    languagejson
    {
      "success": "User attached to course successfully."
    }
  • PUT api/courses/{course}/users/{user}

    • Updates a User's attachment to a Course.

    • Parameters

      • course: int, required - The ID of the Course to update the User's attachment to.

      • user: int, required - The ID of the User to update the attachment to the Course for.

      • status_mask: int, required - The status mask to apply to the User's enrollment in the Course. Must be one of the following:

        • null: not started

        • 1: started

        • 2: completed

    • Response
      HTTP 200

    Code Block
    languagejson
    {
      "success": "User attachment to Course updated successfully."
    }
  • DELETE api/courses/{course}/userusers/{user}

    • Detaches a User from a Course.

    • Parameters

      • course: int, required - The ID of the Course to detach the User from.

      • user: int, required - The ID of the User to detach from the Course.

    • Response
      HTTP 200

    Code Block
    languagejson
    {
      "success": "User detached from course successfully."
    }
  • GET api/courses/{course}/check-completion

    • Checks completion of a course for a particular User. Response includes result (bool, whether or not course is completed), courseUser (the CourseUser object), course (the Course itself), and success (signifies a successful request response).

    • Parameters

      • course : int, required - The ID of the Course to check for a Completion

    • Response

    • HTTP 200

      Code Block
      {
          "success": "success",
          "course": {
              "id": 1,
              "name": "The Extraordinary Minister of Holy Communion",
              "type": null,
              "description": "The Extraordinary Minister of Holy Communion (EMHC) is one of many roles in which the laity can serve their parish community. This course is required for all those who serve in this role in the Diocese of Bridgeport.",
              "status": "published",
              "featured_image_id": 131,
              "instructor_id": null,
              "objectives": null,
              "length": "00:45:00",
              "completion_url": null,
              "experience_completion_urls": null,
              ...
              "is_actionable": true,
              "featured_image": {
                  "id": 1,
                  "name": "",
                  "url": "",
                  "original_filename": "",
                  "is_placeholder": 0,
                  "created_at": "2022-11-18T02:56:18.000000Z",
                  "updated_at": "2022-11-18T02:56:18.000000Z",
                  "deleted_at": null,
                  "actual_url": "https://bridgeport-lms-testing.s3.amazonaws.com/images/EMHC-2.jpg"
              }
          },
          "courseUser": {
              "id": 4,
              "course_id": 1,
              "user_id": 1,
              "term_id": null,
              "credit_id": null,
              "status_mask": 2,
              "has_paid": 0,
              "rsvp_time": null,
              "rsvp_id": null,
              "viewing_duration": null,
              "registered_event_dates": null,
              "completed_event_dates": null,
              "completed_by": null,
              "completed_at": null,
              "invited_at": null,
              "session_survey_completed_at": null,
              "bookmarked_at": null,
              "created_at": "2020-03-06T03:53:39.000000Z",
              "updated_at": "2020-03-06T03:59:43.000000Z",
              "is_bookmarked": false
          },
          "result": false
      }

...