Pearson
Always Learning

This API retrieves a hierarchical view of all posts and replies under a topic. The response is a nested series of arrays of link objects. You will need to follow the links to get the detail about each post or reply.



Supported Roles and Authentication Protocols

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

API Request

API Endpoints

HTTP Verbs and URIs

GET /courses/{courseId}/threadeddiscussions/{contentItemId}/topics/{topicId}/responseHierarchy{.format}
  • Retrieves the hierarchy of all posts in a topic.

Parameters

Parameter Description Valid Values
{courseId} LearningStudio Course ID or relevant course overload.
  • Numeric ID issued by LearningStudio
  • ccn={callNumber}
{contentItemId} LearningStudio Content Item ID of the threaded discussion. Numeric ID issued by LearningStudio
{topicId} LearningStudio Topic ID. Numeric ID issued by LearningStudio
{.format} Desired format of response data. See Response Formats. .json , .xml , or Blank

Query String Parameters

No query string parameters are supported.

Request Body

None.

API Response

Response 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

{
  "responseHierarchy": {
    "childResponseNodes": [
      {
        "links": [{
            "href": "{responseHref}",
            "rel": "related"
          }],
        "childResponseNodes": [{
            "links": [{
                "href": "{responseHref}",
            	"rel": "related"
              }],
            "childResponseNodes": []
          }]
      },{
        "links": [{
            "href": "{responseHref}",
            "rel": "related"
          }],
        "childResponseNodes": [{
            "links": [{
                "href": "{responseHref}",
            	"rel": "related"
              }],
            "childResponseNodes": []
          }]
      }]
  }
}

Description

The response body is a series of nested arrays of objects. The first level (the value of responseHierarchy) has only a childResponseNodes property. That property is an array of the top-level posts in the topic. Each of those objects has a links property, which contains a URL for the post detail and content object, and another childResponseNodes property, which is an array of any posts under that one (and it may be empty).

Property Descriptions

Name Description
{responseHref} URL of the post's detail and content object. You should not parse this URL to find or store the IDs. Instead, use a GET request against this complete URL to retrieve the questions list. Learn more.

Example

Request

GET /courses/123456/threadeddiscussions/10012345678/topics/800055/responseHierarchy

Response

Body

{
  "responseHierarchy": {
    "childResponseNodes": [
      {
        "links": [{
            "href": "http://api.learningstudio.com/courses/123456/threadeddiscussions/10012345678/topics/800055/responses/800100100",
            "rel": "related"
          }],
        "childResponseNodes": [{
            "links": [{
                "href": "http://api.learningstudio.com/courses/123456/threadeddiscussions/10012345678/topics/800055/responses/800100222",
            	"rel": "related"
              }],
            "childResponseNodes": []
          }]
      },{
        "links": [{
            "href": "http://api.learningstudio.com/courses/123456/threadeddiscussions/10012345678/topics/800055/responses/800100333",
            "rel": "related"
          }],
        "childResponseNodes": [{
            "links": [{
                "href": "http://api.learningstudio.com/courses/123456/threadeddiscussions/10012345678/topics/800055/responses/800100444",
            	"rel": "related"
              }],
            "childResponseNodes": []
          }]
      }]
  }
}
2538 reads
Always Learning
Pearson