Skip to content

Course Content

This guide covers how to access courses and topics through the API.

Content Hierarchy

Course
├── Topic 1
└── Topic 2

List Courses

Get all active courses that the API key's tenant has access to:

curl -X GET "https://api.mccoy.org/api/v1/courses" \
  -H "X-Api-Key: YOUR_API_KEY"

Filtering

Parameter Values Description
pipeline_version any string, e.g. v1, v2 Filter by course pipeline version

Example:

curl -X GET "https://api.mccoy.org/api/v1/courses?pipeline_version=v2" \
  -H "X-Api-Key: YOUR_API_KEY"

List responses do not include a status field. The list endpoint always returns active courses only.

Pagination

All list endpoints support pagination:

Parameter Default Max Description
page 1 - Page number (1-indexed)
page_size 50 100 Results per page
sort_by varies - Field to sort by
sort_order asc - asc or desc

Example:

curl -X GET "https://api.mccoy.org/api/v1/courses?page=2&page_size=20&sort_order=desc" \
  -H "X-Api-Key: YOUR_API_KEY"

Get Course Details

curl -X GET "https://api.mccoy.org/api/v1/courses/{course_id}" \
  -H "X-Api-Key: YOUR_API_KEY"

Response:

{
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "course_name": "Introduction to Python",
    "description": "Learn Python fundamentals",
    "status": "active"
  }
}

List Topics

Get all topics within a course:

curl -X GET "https://api.mccoy.org/api/v1/courses/{course_id}/topics" \
  -H "X-Api-Key: YOUR_API_KEY"

Response:

{
  "data": [
    {
      "id": "770e8400-e29b-41d4-a716-446655440001",
      "l1_name": "Programming Basics",
      "l2_name": "Variables and Data Types"
    },
    {
      "id": "770e8400-e29b-41d4-a716-446655440002",
      "l1_name": "Programming Basics",
      "l2_name": "Control Flow"
    }
  ],
  "pagination": {
    "page": 1,
    "page_size": 50,
    "total_items": 2,
    "total_pages": 1,
    "has_next": false,
    "has_prev": false
  }
}

Topic Fields

Field Description
l1_name High-level category (e.g., "Programming Basics")
l2_name Specific topic name (e.g., "Variables and Data Types")

Get Topic Details

curl -X GET "https://api.mccoy.org/api/v1/topics/{topic_id}" \
  -H "X-Api-Key: YOUR_API_KEY"

Access Control

The tenant associated with your API key must have access to a course to retrieve its content. If you receive a COURSE_ACCESS_DENIED or FEATURE_NOT_ENTITLED error, contact your McCoy administrator to request access.

Next Steps