Pearson
Always Learning

API Group: 

This API returns a list of all the courses in which a particular user has been enrolled. You will need to know the User ID; see the Users API.

Best Practice: Try to cache these results. Once courses are well underway a user's list of courses will change very little, if at all (especially after the first couple of weeks).

Best Practice: Be careful of course dates. If no filters are used this API will return future and past courses that the user may not be allowed to access; furthermore, the inbound Single Sign On tools will not restrict a user from accessing a course outside its date range. Therefore your application should have logic to restrict a user from accessing or doing any work in inactive courses.


Supported Roles and Authentication Protocols

Type Supported Values
Authentication Protocols OAuth 1.0a, OAuth 2.0
Valid for Roles (OAuth 2): Professor, Teaching Assistant, Student

API Request

API Endpoints

HTTP Verbs and URIs

GET /users/{userId}/courses{.format}
  • Returns the detail about the specified course. .

Parameters

Parameter Description Valid Values
{userId} LearningStudio User ID or relevant user overload.
  • Numeric ID issued by LearningStudio
  • loginid={clientString}|{username}
  • or replace /users/{userId} with /me
    (OAuth 2 only)
{.format} Desired format of response data. See Response Formats. .json , .xml , or Blank

Query String Parameters

By default, all of a user's courses will be returned irrespective of the course active date range. Using filters can restrict the set of courses that are returned (see best practice note, above).

Query Parameter Name Description Valid Values
startDatesBetween Defines the range of dates in which the course start date must occur. The value for this parameter is two dates, joined by a comma, for example: startDatesBetween=01/01/2014,02/01/2014 The dates must be in this format: MM/DD/YYYY
endDatesBetween Defines the range of dates in which the course end date must occur. The value for this parameter is two dates, joined by a comma, for example: startDatesBetween=01/01/2014,02/01/2014 The dates must be in this format: MM/DD/YYYY
expand By default the API will return links to the courses but no course information. This parameter opts to include the course details from the Course Information API.

Note that you can also use the roster expansions from the Course Information API, prefixed with course.. This will include both the expanded course information and that detail's expanded roster information.

course
course.teachingAssistants
course.students
course.instructors

Request Body

None

API Response

HTTP Status Codes & Headers

This API returns the standard HTTP Status Codes used by the LearningStudio APIs. There are no special headers returned by the API.

Response Body

Format

{
  "courses":[
    {
      "links":[{
        "href":"http://api.learningstudio.com/courses/{courseId}",
        "rel":"self"
      }]
    },
  ]
}

Description

The courses element is an array of course objects. Each object, by default, has a href that points to the course detail.

Important: you should not parse this URL to find the ID. Instead, use a GET request against this complete URL to retrieve Course details, or use the expand query string parameter. Learn more.

Note: If you use the expand parameter, the links property for each object will contain an additional property of course containing the same values as the Course Information API. See the example below.

Example: Get Course List Without Expansion

Request

Endpoint

GET /users/654321/courses

Response

Body

{
  "courses":[
    {
      "links":[{
        "href":"https://api.learningstudio.com/courses/000001",
        "rel":"self"
      }]
    },
    {
      "links":[{
        "href":"https://api.learningstudio.com/courses/000002",
        "rel":"self"
      }]  
    }
  ]
}

Example: Get Expanded Course List

Request

Endpoint

GET /users/654321/courses?expand=course

Response

Body

{
  "courses":[
    {
      "links":[{
          "course": {
            "instructors": {
              "links": [
                {
                  "href": "https://api.learningstudio.com/courses/000001/instructors",
                  "rel": "self",
                  "title": "instructors"
                }
              ]
            },
            "teachingAssistants": {
              "links": [
                {
                  "href": "https://api.learningstudio.com/courses/000001/teachingAssistants",
                  "rel": "self",
                  "title": "teachingAssistants"
                }
              ]
            },
            "students": {
              "links": [
                {
                  "href": "https://api.learningstudio.com/courses/000001/students",
                  "rel": "self",
                  "title": "students"
                }
              ]
            },
            "id": 000001,
            "displayCourseCode": "ACCT-1",
            "title": "Accounting 101",
            "callNumbers": [
              "EIVY4-EENCA-1398799292"
            ],
            "links": [
              {
                "href": "https://api.learningstudio.com/terms/71553",
                "rel": "https://api.learningstudio.com/rels/term"
              }
            ]
          },
          "href":"https://api.learningstudio.com/courses/000001",
          "rel":"self"
      }]
    },
    {
      "links":[{
          "course": {
            "instructors": {
              "links": [
                {
                  "href": "https://api.learningstudio.com/courses/000002/instructors",
                  "rel": "self",
                  "title": "instructors"
                }
              ]
            },
            "teachingAssistants": {
              "links": [
                {
                  "href": "https://api.learningstudio.com/courses/000002/teachingAssistants",
                  "rel": "self",
                  "title": "teachingAssistants"
                }
              ]
            },
            "students": {
              "links": [
                {
                  "href": "https://api.learningstudio.com/courses/000002/students",
                  "rel": "self",
                  "title": "students"
                }
              ]
            },
            "id": 000002,
            "displayCourseCode": "ACCT-2",
            "title": "Accounting 201",
            "callNumbers": [
              "EIVY4-EENCA-234241414"
            ],
            "links": [
              {
                "href": "https://api.learningstudio.com/terms/71553",
                "rel": "https://api.learningstudio.com/rels/term"
              }
            ]
          },
          "href":"https://api.learningstudio.com/courses/000002",
          "rel":"self"
      }]
    }
  ]
}
1645 reads
Always Learning
Pearson