Pearson
Always Learning

This API is like its top-level counterpart except that it allows you to get the replies to a particular post, and create a reply to another post. It doesn't matter how deeply you're traversing the thread, this API always returns the children of the specified response.

Like it's top-level counterpart, this API includes all the responses under the specified post, with no hierarchy and no parent identifiers from which to create a hierarchy. However, you can use the depth query string parameter (see below) to specify only a certain level of posts to return. You can combine a query string of ?depth=1 (to return only immediate children) with further requests to this API to traverse a thread.

This API only returns a list of responses. To get the detail of a single response, use the top-level counterpart to request a single post.

You will use this API to create a reply to any other post at any level of the thread.



Supported Roles and Authentication Protocols

Type Supported Values
Authentication Protocols OAuth 1.0a, OAuth 2.0
Note: OAuth 1 does not support POSTrequests.
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}/responses{.format}
  • Retrieves a flattened list of all replies, from any level, below a specified post.
  • Can be filtered to the immediate replies only by using the depth query string parameter.
POST /courses/{courseId}/threadeddiscussions/{contentItemId}/topics/{topicId}/responses/{postId}/responses{.format}
  • Create a reply to any other post in a thread.

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. This is the post for which you are requesting the replies, or to which you are replying. 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
depth Use this parameter to only include the replies up to an including a certain level. For example, set this to 1 to include only the immediate replies to the specified posts. Any integer value
useSourceDomain Include a full URL for any linked resources in content (such as images stored in LearningStudio). true if specifying this parameter, otherwise false or don't include this parameter.

Request Body

For GET and DELETE Requests

None.

For POST Requests

{
  "response":{
    "title":"{postTitle}",
    "description":"{responseBody}"
  }
}

Property Descriptions

Name Description Valid Values
{postTitle} Title of the Post. String of characters.
{responseBody} Body of the response. String of characters. This may contain HTML.

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

{
  "responses":[{
    "id":{postId},
    "title":"{responseTitle}",
    "description":"{responseBody}",
    "author":{
       "links":[{
         "href":"{authorHref}",
         "rel":"self"
       },{
         "href":"{userHref}",
         "rel":"related"
       }]
    },
    "postedDate":"{postedDate}",
    "links": [{
        "href": "{attachmentsHref}",
        "rel": "https://api.learningstudio.com/courses/threadedDiscussions/topics/responses/attachments"
      }]
  }]
}

Property Descriptions

Name Description
{postId} LearningStudio Thread Post ID.
{responseTitle} Post title.
{responseBody} Body of the title. Note, this may contain HTML.
{authorHref} A link to retrieve the name and email address of the user that created the post.
{userHref} A link to retrieve the user detail object for the user that created the post.
{postedDate} Date and time response was posted.
{attachmentsHref} Link to the attachments for a post.

Example: Get Immediate Replies to a Post

Request

Endpoint

GET /courses/123456/threadeddiscussions/10012345678/topics/8000555/responses/800100400/responses?depth=1

Response

Body

{
  "responses":[{
    "id":8000150500,
    "title":"Re: Assignment 1",
    "description":"I'm not sure I understand what exactly you're talking about...",
    "author":{
      "links":[{
        "href":"https://api.learningstudio.com/courses/123456/threads/10012345678/topics/800055/responses/8000150500/responseAuthor",
        "rel":"self"
      },{
        "href":"https://api.learningstudio.com/users/1111111",
        "rel":"related"
      }]},
    "postedDate":"2010-02-09T15:29:55.88",
    "links": [{
        "href": "https://api.learningstudio.com/courses/123456/threads/10012345678/topics/800055/responses/8000150500/attachments",
        "rel": "https://api.learningstudio.com/courses/threadedDiscussions/topics/responses/attachments"
      }]
  },{
    "id":8000150505,
    "title":"Re: Assignment 1",
    "description":"I think you misinterpreted that chapter ... ",
    "author":{
        "links":[{
        "href":"https://api.learningstudio.com/courses/123456/threads/10012345678/topics/800055/responses/8000150505/responseAuthor",
        "rel":"self"
      },{
        "href":"https://api.learningstudio.com/users/2222222",
        "rel":"related"
      }]},
    "postedDate":"2010-02-10T17:03:34.18",
    "links": [{
        "href": "https://api.learningstudio.com/courses/123456/threads/10012345678/topics/800055/responses/8000150505/attachments",
        "rel": "https://api.learningstudio.com/courses/threadedDiscussions/topics/responses/attachments"
      }]
  }]
}

Example: Get Immediate Replies to a Post using useSourceDomain for a CMS course

Request

Endpoint

GET /courses/123456/threadeddiscussions/10012345678/topics/8000555/responses/800100400/responses?depth=1&useSourceDomain=true

Response

Body

{
  "responses":[{
    "id":8000150500,
    "title":"Re: Assignment 1",
    "description":"I'm not sure I understand what exactly you're talking about..."
	                 <img src="https://api.learningstudio.com/courses/123456/files/img1.jpg?cmsContentId=2372beff-33fe-4533-a47e-cc003fa22e35" alt="test" title="test" />",
    "author":{
      "links":[{
        "href":"https://api.learningstudio.com/courses/123456/threads/10012345678/topics/800055/responses/8000150500/responseAuthor",
        "rel":"self"
      },{
        "href":"https://api.learningstudio.com/users/1111111",
        "rel":"related"
      }]},
    "postedDate":"2010-02-09T15:29:55.88",
    "links": [{
        "href": "https://api.learningstudio.com/courses/123456/threads/10012345678/topics/800055/responses/8000150500/attachments",
        "rel": "https://api.learningstudio.com/courses/threadedDiscussions/topics/responses/attachments"
      }]
  },{
    "id":8000150505,
    "title":"Re: Assignment 1",
    "description":"I think you misinterpreted that chapter ... ",
    "author":{
        "links":[{
        "href":"https://api.learningstudio.com/courses/123456/threads/10012345678/topics/800055/responses/8000150505/responseAuthor",
        "rel":"self"
      },{
        "href":"https://api.learningstudio.com/users/2222222",
        "rel":"related"
      }]},
    "postedDate":"2010-02-10T17:03:34.18",
    "links": [{
        "href": "https://api.learningstudio.com/courses/123456/threads/10012345678/topics/800055/responses/8000150505/attachments",
        "rel": "https://api.learningstudio.com/courses/threadedDiscussions/topics/responses/attachments"
      }]
  }]
}

Example: Create a Reply to a Post

Request

Endpoint

POST /courses/123456/threadeddiscussions/10012345678/topics/8000555/responses/8000150505/responses

Body

{
  "response":{
    "title":"Re: Assignment 1",
    "description":"Oh, you're right, I did totally confuse that point."
  }
}

Response

Body

{
  "responses":[{
    "id":8000150515,
    "title":"Re: Assignment 1",
    "description":"Oh, you're right, I did totally confuse that point.",
    "author":{
        "links":[{
        "href":"https://api.learningstudio.com/courses/123456/threads/10012345678/topics/800055/responses/8000150515/responseAuthor",
        "rel":"self"
      },{
        "href":"https://api.learningstudio.com/users/555555",
        "rel":"related"
      }]},
    "postedDate":"2010-02-10T17:03:34.18",
    "links": [{
        "href": "https://api.learningstudio.com/courses/123456/threads/10012345678/topics/800055/responses/8000150515/attachments",
        "rel": "https://api.learningstudio.com/courses/threadedDiscussions/topics/responses/attachments"
      }]
  }]
}
4176 reads
Always Learning
Pearson