Pearson
Always Learning

This API is like its top-level counterpart except that it only retrieves the hierarchical view of all replies to a specific post, rather than all posts in 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.

Note: This API is basically starting in the middle of the "tree," and returns all the nested children, grandchildren, etc, starting from the response you specify.

Best Practice: This API is a good choice if you simply want to retrieve the "new" replies to a post you're tracking, in combination of the Last Response by User API, response counts APIs, or thread events.



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}/responses/{postId}/responseHierarchy{.format}
  • Retrieves the hierarchy of all replies to a particular post.

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
{postId} LearningStudio Thread Post 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 immediate replies to the specified post . 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/responses/800100204/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": []
          }]
      }]
  }
}
2803 reads
Always Learning
Pearson