Pearson
Always Learning

This API is a composite of the Detail of a Single Post and the Post Author Detail APIs, combining the title, body, and date of a specified post with the name, ID, and email of the post's author. This can be used for all posts in a topic, similar to the Flattened List of All Posts in a Topic API, or for a single post.

When requesting all posts in a thread, the list is flattened 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.

Note:
Response bodies of these rest routes are forbidden (403) for students when isHiddenTopic property is set to true for a topic.
Response bodies of these rest routes are forbidden (403) for students when isPostFirstEnabled property is set to true for a topic. Student can view the response body after posting a respond to the particular topic.



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}/responseAndAuthorComps{.format}
  • Retrieves the combined post detail and author detail for all posts in a topic, with no hierarchy.
  • The depth query string parameter can be used to limit the depth of posts returned.
GET /courses/{courseId}/threadedDiscussions/{contentItemId}/topics/{topicId}/responses/{postId}/responseAndAuthorComps{.format}
  • Retrieves the combined post detail and author detail for all replies to the specified post, with no hierarchy.
  • The depth query string parameter can be used to limit the depth of posts returned.
GET /courses/{courseId}/threadedDiscussions/{contentItemId}/topics/{topicId}/responseAndAuthorComps/{postId}{.format}
  • Retrieves the combined post detail and author detail for a single 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

Query Parameter Name Description Valid Values
depth Use this parameter to only include the responses up to an including a certain level. For example, set this to 1 to include only the top-level posts or only the immediate replies to a post. This parameter is useful for the first two endpoints specified above. Any integer value

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

{
  "responseAndAuthorComps": [{
    "response": {
      "id": {postId},
      "title": "{responseTitle}",
      "description": "{responseBody}",
      "author": {
        "links": [{
          "href": "{authorHref}",
          "rel": "self"
        },
        {
          "href": "{userHref}",
          "rel": "related"
        }]
      },
      "postedDate": "{postedDate}",
      "links": [{
        "href": "{selfHref}",
        "rel": "self"
      }]
    },
  "authorRosterMember": {
    "id": {userId},
    "firstName": "{firstName}",
    "lastName": "{lastName}",
    "roleType": "{roleType}",
    "links": [{
      "href": "{rosterHref}",
      "rel": "self"
    }]
  }]
}

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.
{selfHref} A link to primary post detail object (the non-composite version).
{postedDate} Date and time response was posted.
{userId} ID of the user.
{firstName} First name of the user.
{lastName} Last name of the user.
{roleType} Type of the role the user has in the course. Values will be:

  • PROF - Professor.
  • TAST - Teaching Assistant.
  • STUD - Student.
{rosterHref} A link to retrieve the roster detail object for the user that created the post.

Example: Composite Request for a Single Post

Request

Endpoint

GET /courses/123456/threadedDiscussions/10012345678/topics/800055/responseAndAuthorComps/8001002322

Response

Body

{
  "responseAndAuthorComps": [{
    "response": {
      "id": 8001002322,
      "title": "This is my response",
      "description": "My response is very terse.<br />\r\n",
      "author": {
        "links": [{
          "href": "http://api.learningstudio.com/courses/123456/threadedDiscussions/10012345678/topics/800055/responses/8001002322/responseAuthor",
          "rel": "self"
        },
        {
          "href": "http://api.learningstudio.com/users/888888888",
          "rel": "related"
        }]
      },
      "postedDate": "2010-12-17T17:30:05Z",
      "links": [{
        "href": "http://api.learningstudio.com/courses/123456/threadedDiscussions/10012345678/topics/800055/responses/8001002322",
        "rel": "self"
      }]
    },
  "authorRosterMember": {
    "id": 888888888,
    "firstName": "Joey",
    "lastName": "McStudent",
    "roleType": "STUD",
    "links": [{
      "href": "http://api.learningstudio.com/courses/123456/roster/888888888",
      "rel": "self"
    }]
  }
  }]
}
2723 reads
Always Learning
Pearson