List all courses: Migration guide

Transitioning from v1's getCourses to v2's List all courses endpoint involves several key changes. This guide details those changes, including modifications to request parameters, response formats, and overall functionality, to ensure a smooth migration.

💡

Key changes

  • Pagination: To improve performance, we've added pagination to this endpoint in v2. Now, you'll receive your results in pages of 500 items. For more information, see our Pagination guide.
  • Filtering: The API v2 uses the Left-Hand side (LHS) bracket notation in query parameters for filtering. For more information, see our Filtering guide.

Documentation links

Here are the links to the API reference for:

Endpoint mapping

Here's the direct correlation between the v1 and v2 endpoint URLs:

  • API v1: /api/v1/courses
  • API v2: /api/v2/courses

Input changes

This section details the specific alterations to the input requirements between API versions.

API v1 input example

curl --location 'https://app.360learning.com/api/v1/courses?company={{company}}&apiKey={{apiKey}}&createdBefore=2025-01-01T00%3A00%3A00.000Z&modifiedAfter=2024-06-30T00%3A00%3A00.000Z&modifiedBefore=2024-07-30T00%3A00%3A00.000Z&createdAfter=2024-01-01T00%3A00%3A00.000Z'

API v2 input example

curl --request GET \
     --url 'https://app.360learning.com/api/v2/courses?createdAt[lt]=2025-01-01&createdAt[gte]=2024-01-01&modifiedAt[lt]=2024-07-30&modifiedAt[gte]=2024-06-30' \
     --header '360-api-version: v2.0' \
     --header 'accept: application/json' \
     --header 'authorization: Bearer access_token'

Main input differences

Change type

API v1

API v2

Modified
Query parameters

createdBefore / createdAfter (Optional): Timestamp filters, in the formatYYYY-MM-DDTHH:mm:ss.sssZ.

createdAt (Optional): Modified name, functionality, syntax, and date format. Now, this single filter combines the functionalities of createdBefore and createdAfter. It filters courses by creation date range using the LHS bracket notation. The date format is now YYYY-MM-DD.

Modified
Query parameters

modifiedBefore / modifiedAfter (Optional): Timestamp filters, in the formatYYYY-MM-DDTHH:mm:ss.sssZ.

modifiedAt (Optional): Modified name, functionality, syntax, and date format. Now, this single filter combines the functionalities of modifiedBefore and modifiedAfter. It filters courses by modification date range using the LHS bracket notation. The date format is now YYYY-MM-DD.

Added
Query parameter

status (Optional): New query parameter to filter courses by status (archived, deleted, published).

Added
Query parameter

type (Optional): New query parameter to filter courses by type (external, internal, scorm).

Output changes

This section details the specific alterations to the successful output returned between API versions.

API v1 output example

[
  {
    "_id": "58eb5c621a92bb4fb526b2b0",
    "author": "edouard.lansalut#[email protected]",
    "creationDate": "2018-04-16T13:19:01.000Z",
    "defaultLang": "fr",
    "description": "Description du module de démo",
    "lang": "en",
    "modificationDate": "2018-04-16T17:55:48.032Z",
    "name": "Module de démo",
    "sourceLang": "en",
    "status": "published",
    "type": "internal",
    "coAuthors": [
      "edouard.lansalut#[email protected]"
    ],
    "courseDuration": 15,
    "group": "57ec5cb81abbbb4fb526b2bd",
    "groupName": "Onboardess",
    "reactionScore": 100,
    "relevanceScore": 50,
    "translationsLangs": [
      {
        "lang": "fr",
        "published": true,
        "translators": [
          "edouard.lansalut#[email protected]"
        ]
      }
    ]
  }
]

API v2 output example

[
  {
    "_id": "507f1f77bcf86cd799439011",
    "authorId": "507f1f77bcf86cd799439011",
    "coAuthorIds": [
      "507f1f77bcf86cd799439011"
    ],
    "createdAt": "2025-03-21T09:34:01.971Z",
    "defaultLang": "bg",
    "groupId": "507f1f77bcf86cd799439011",
    "modifiedAt": "2025-03-21T09:34:01.971Z",
    "name": "Employee Onboarding",
    "sourceLang": "bg",
    "status": "archived",
    "translations": [
      {
        "lang": "fr",
        "published": true,
        "translatorIds": [
          "507f1f77bcf86cd799439011"
        ],
        "translatedFields": {
          "name": "Accueil des employés",
          "description": "Ce module vous apprend à intégrer un nouveau collaborateur !"
        }
      }
    ],
    "type": "external",
    "description": "This course will teach you how to onboard a new employee!",
    "duration": 0,
    "externalPlatform": "Udemy"
  }
]

Main output differences

Change type

API v1

API v2

Removed
Output property

reactionScore: Removed from endpoint v2 version, not replaced.

Removed
Output property

relevanceScore: Removed from endpoint v2 version, not replaced.

Modified
Output property

author: Email.

authorId: Renamed. Now contains the author 360Learning ID instead of the email.

Modified
Output property

creationDate

createdAt: Renamed.

Modified
Output property

lang: Top-level property indicating the source language of a course (deprecated but retained in the API v1 for backward compatibility).

sourceLang: Replaced the top-level andno longer supported lang.

  • *Note: **lang indicating the language of a translation within translations (formerly translationsLang) remains unchanged.

Modified
Output property

coAuthors

coAuthorIds: Renamed. Now contains an array with the IDs of the co-authors, instead of the emails.

Modified
Output property

modificationDate

modifiedAt: Renamed.

Modified
Output property

translationsLangs

translations: Renamed.

Modified
Output property

translationsLangs.translators

translations.translatorIds: Renamed. Now contains an array with the IDs of the translators instead of the emails.

Modified
Output property

groupId

group: Renamed.

Modified
Output property

courseDuration

duration: Renamed.

Added
Output property

translations.translatedFields: New parameter with the translated fields of the course.

Added
Output property

translations.translatedFields.name: New parameter with the translated name of the course in the given language.

Added
Output property

translations.translatedFields.description: New parameter with the translated description of the course in the given language