Pearson
Always Learning

API Group: 

This API allows you to return either a list of all the content items in a course, or the detail around a single specific content item. This is the primary mode for retrieving details like content item ID, item title, item type, etc. You can also use the expand parameter on the Item Hierarchy APIs to include this detail in those results.

This API is a flattened list of the content items. There is not any hierarchy represented, however child items do include a 'parent' link that points to the Unit under which they live. The order of the results will match the order displayed in the LearningStudio user interface.

Hint About Content Item IDs: All Units have a content item ID starting with 200, and all content items have an ID starting with 100.

Best Practice: Because some content items may be hidden from students, the listing version of API should not be used by student-role access tokens when leveraging OAuth 2. Doing so will cause the API to return a 403 Forbidden status code if any content item is hidden from students. Nor should you use OAuth 1 to retrieve the list and then show the complete list to students. Instead, use the user-specific counterpart of this API, which returns only the items that the specified user is allowed to see.

Note: Even if you shouldn't use the listing version of this API with student roles, this is the only way to access details on individual content items. Therefore while this API call may not work with a student access token:
/courses/{courseId}/items
this one will:
/courses/{courseId}/items/{itemId}



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, Administrator
Students are only supported for retrieving individual content item details.

API Request

API Endpoints

HTTP Verbs and URIs

GET /courses/{courseId}/items{.format}
  • Retrieves an array of the items in the course.
GET /courses/{courseId}/items/{itemId}{.format}
  • Retrieves the course item with the given ID.

Parameters

Parameter Description Valid Values
{courseId} LearningStudio Course ID. Numeric ID issued by LearningStudio. Note this API does not support course overloads.
{itemId} LearningStudio Content Item ID. Numeric ID issued by LearningStudio.
{.format} Desired format of response data. See Response Formats. .json , .xml , or Blank

Query String Parameters

Query Parameter Name Description Valid Values
expand By default the API will return links to additional access information about each content item, including the schedule dates (start/end and due dates) and access permissions (whether a student can view the item before/after the dates). This parameter opts to include the content item detail such as its name or type with the results of this API. You can expand multiple children by separating the values with a comma, for example: ?expand=access,schedule.

access
schedule
or Blank

Request Body

None

API Response

Response Header

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

{
  "items" :[ 
  { 
    "id" : "{courseItemId}", 
	  "contentType" : "{courseItemType}", 
	  "title" : "{courseItemTitle}", 
          "isHidden":{isHidden},
	  "links" : [ 
	  { 
		  "href" : "http://api.learningstudio.com/courses/{courseId}/items/{itemId}/access",
		  "rel" : "related", 
		  "title" : "access"
		}, 
		{
		  "href" : "http://api.learningstudio.com/courses/{courseId}/items/{itemId}/schedule", 
		  "rel" : "related", 
		  "title" : "schedule" 
		}, 
		{ 
		  "href" : "http://api.learningstudio.com/courses/{courseId}/textMultimedias/{textMultimediaId}",
		  "rel" : "http://api.learningstudio.com/rels/course/item/content" 
		}
      ] 
    },
    {
	  "id" : "{courseItemId}", 
	  "contentType" : "{courseItemType}", 
	  "title" : "{courseItemTitle}", 
          "isHidden":{isHidden},
	  "links" : [ 
	  { 
		  "href" : "http://api.learningstudio.com/courses/{courseId}/items/{itemId}/access",
		  "rel" : "related", 
		  "title" : "access"
		}, 
		{
		  "href" : "http://api.learningstudio.com/courses/{courseId}/items/{itemId}/schedule", 
		  "rel" : "related", 
		  "title" : "schedule" 
		}, 
		{ 
		  "href" : "http://api.learningstudio.com/courses/{courseId}/threadedDiscussions/{threadId}",
		  "rel" : "http://api.learningstudio.com/rels/course/item/content" 
      }
	  ]
	}  
  ]

Property Descriptions

Name Description
{courseItemId} ID of the course item.
{courseItemType} Type of course item in this array. Each item contains an array of link objects that connect the item to its related resources. You'll need to use the appropriate content APIs to retrieve each type of content.
MS Office Documents types

  • MSOFFICEDOC
  • EXCEL
  • PPT
  • WORD
  • MANAGED_OD

Web Content Upload types

  • WEBUPLOAD
  • MANAGED_UPLOAD

Text/Multimedia types

  • HTML
  • TEXT
  • MANAGED_HTML

Exam types

  • IQT

Thread types

  • THREAD
  • MANAGED_THREADS
{courseItemTitle} Title of course item.
{isHidden} A Boolean flag that indicates whether the content item is hidden to students.
hrefs Direct link to content item's actual content (or equivalent, for threads and exams). Important: you should not parse this URL to find or store the IDs. Instead, use a GET request against this complete URL to retrieve Term details. Learn more.

Every item contains links to the access and schedule resources for that item.

Schedule and Access

Content Items can have scheduling dates attached to them. These dates include a range during which students are allowed to view the item (or when they are expected to use the content). There is also a due date option available. This information is accessible through the "schedule" link.

The "access" link notes whether students are permitted to access a content item before or after the date range in the "schedule" link. It is your responsibility to respect the schedule and access settings determined by the teacher or institution; the APIs will not filter out content based on schedules alone.

Example: Content Items List

Request

Endpoint

GET /courses/12345/items

Response

Body

{
  "items":[
  {
    "id":000001,
    "contentType":"HTML",
    "title":"text",
    "isHidden":false,
    "links" :[
    {
      "href": "https://api.learningstudio.com/courses/12345/items/000001/access",
      "rel": "related",
      "title": "access"
    },
    {
      "href": "https://api.learningstudio.com/courses/12345/items/000001/schedule",
      "rel": "related",
      "title": "schedule"
    },
    {
      "href": "https://api.learningstudio.com/courses/12345/textMultimedias/000001",
      "rel": "https://api.learningstudio.com/rels/course/item/content"
    }
    ]
  },
  {
    "id":000002,
    "contentType":"IQT",
    "title":"Exam",
    "isHidden":true,
    "links" :[
    {
      "href": "https://api.learningstudio.com/courses/12345/items/000002/access",
      "rel": "related",
      "title": "access"
    },
    {
      "href": "https://api.learningstudio.com/courses/12345/items/000002/schedule",
      "rel": "related",
      "title": "schedule"
    }
    ]
  },
  {
    "id":000003,
    "contentType":"THREAD",
    "title":"Threaded Discussion",
    "links" :[
    {
      "href": "https://api.learningstudio.com/courses/12345/items/000003/access",
      "rel": "related",
      "title": "access"
    },
    {
      "href": "https://api.learningstudio.com/courses/12345/items/000003/schedule",
      "rel": "related",
      "title": "schedule"
    },
    {
      "href": "https://api.learningstudio.com/courses/12345/threadedDiscussions/000003",
      "rel": "https://api.learningstudio.com/rels/course/item/content"
    }
    ]
  }
  ]
}

Example: Get Single Course Item with Expanded Schedule and Access

Request

Endpoint

GET /courses/123456/items/1000000?expand=access,schedule

Response

Body

{
  "items": [
    {
      "id": 1000000,
      "contentType": "HTML",
      "title": "Assignment 7.1",
      "links": [
        {
          "access": {
            "canAccessBeforeStartDateTime": false,
            "canAccessAfterEndDateTime": true
          },
          "href": "https://api.learningstudio.com/courses/123456/items/1000000/access",
          "rel": "related",
          "title": "access"
        },
        {
          "schedule": {
            "startDateTime": "2014-10-07T06:00:00Z",
            "endDateTime": "2014-10-31T05:59:00Z"
          },
          "href": "https://api.learningstudio.com/courses/123456/items/1000000/schedule",
          "rel": "related",
          "title": "schedule"
        },
        {
          "href": "https://api.learningstudio.com/courses/123456/items/1000000/parent",
          "rel": "related",
          "title": "parent"
        },
        {
          "href": "https://api.learningstudio.com/courses/123456/textMultimedias/1000000",
          "rel": "https://api.learningstudio.com/rels/course/item/content"
        }
      ]
    }
  ]
}
2718 reads
Always Learning
Pearson