Pearson
Always Learning

This API retrieves the ancestry of a post, starting at the top-level post and providing links to each parent post in the chain down to and including the specified post.

Note: No descendants of the specified post are returned. Even if the post is in the middle of a thread, only the parent, grandparent, etc, are returned. Combine this API with the Hierarchical List of Replies to a Post API to retrieve the entire chain.

Note: No siblings of any ancestral post is included, only the direct ancestors of each post in the chain.

Example

If all the posts under a topic create a tree that looks like:

  • Post A

    • Post A-1
    • Post A-2
      • Post A-2-1
      • Post A-2-2
        • Post A-2-2-1
    • Post A-3
  • Post B
  • Post C

And you used this API with Post A-2-2 as the specified post, the API would respond with:

  • Post A

    • Post A-2

      • Post A-2-2


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

API Request

API Endpoints

HTTP Verbs and URIs

GET /courses/{courseId}/threadeddiscussions/{contentItemId}/topics/{topicId}/responses/{postId}/responseBranch{.format}
  • Retrieves the hierarchy of all ancestor posts to the specified reply.

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

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

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.
{specifiedPostHref} The last child in the chain is the URL of the specified 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

Endpoint

GET /courses/123456/threadeddiscussions/10012345678/topics/800055/responses/8000200244/responseBranch

Response

Body

{
  "responseBranch":{
    "childResponseNodes":[{
      "links":[{
        "href":"https://api.learningstudio.com/courses/123456/threadeddiscussions/10012345678/topics/800055/responses/8000200200",
        "rel":"related"
	    }],
      "childResponseNodes":[{
        "links":[{
          "href":"https://api.learningstudio.com/courses/123456/threadeddiscussions/10012345678/topics/800055/responses/8000200111",
          "rel":"related"
 	      }],
        "childResponseNodes":[{
          "links":[{
            "href":"https://api.learningstudio.com/courses/123456/threadeddiscussions/10012345678/topics/800055/responses/8000200244",
           "rel":"related"
	      }],
        }]
      }]
    }]
  }
}
2643 reads
Always Learning
Pearson