Pearson
Always Learning

This API is a composite of the Detail of a Single Post and the User's Read/Unread Status for a Post APIs, combining the title, body, and date of a specified post with the status of whether a particular user has read the post. 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.



Supported Roles and Authentication Protocols

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

API Request

API Endpoints

HTTP Verbs and URIs

GET /users/{userId}/courses/{courseId}/threadeddiscussions/{contentItemId}/topics/{topicId}/userViewResponses{.format}
  • Retrieves the combined post detail with a status flag for whether the user has read the post.
  • The depth query string parameter can be used to limit the depth of responses returned.
GET /users/{userId}/courses/{courseId}/threadeddiscussions/{contentItemId}/topics/{topicId}/userViewResponses/{postId}{.format}
  • Retrieves the combined post detail and author detail for a single post.

Parameters

Parameter Description Valid Values
{userId} LearningStudio User ID or relevant user overload.
  • Numeric ID issued by LearningStudio
  • loginid={clientString}|{username}
  • or replace /users/{userId} with /me
    (OAuth 2 only)
{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
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

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

{
  "userViewResponses":[{
    "markedAsRead":{markedAsReadFlag},
    "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
{markedAsReadFlag} Boolean that indicates whether the specified user has read the response.
{postId} LearningStudio Thread Post ID.
{responseTitle} Response title.
{responseBody} Body of the response.
{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 updated.
{attachmentsHref} Link to the attachments for a post.

Example: Composite Request for a Single Post

Request

Endpoint

GET /users/555555/courses/123456/threadeddiscussions/10012345678/topics/8000055/userviewresponses/800100222

Response

Body

{
  "userViewResponses":[{
    "markedAsRead":true,
    "id":197,
    "title":"Question 1",
    "description":"This is the prof's first response<br />",
    "author":{
      "links":[{
        "href":"https://api.learningstudio.com/courses/123456/threadeddiscussions/10012345678/topics/8000055/responses/800100222/responseAuthor",
        "rel":"self"
      },{
        "href":"https://api.learningstudio.com/users/2114380",
        "rel":"related"
      }]},
    "postedDate":"2010-02-09T15:29:55.88",
    "links": [
      {
        "href": "https://api.learningstudio.com/courses/123456/threadeddiscussions/10012345678/topics/8000055/responses/800100222/attachments",
        "rel": "https://api.learningstudio.com/courses/threadedDiscussions/topics/responses/attachments"
      }
    ]
  }]
}

Example: Composite Request for a Single Post for a CMS Course using useSourceDomain

Request

Endpoint

GET /users/555555/courses/123456/threadeddiscussions/10012345678/topics/8000055/userviewresponses/800100222?useSourceDomain=true

Response

Body

{
  "userViewResponses":[{
    "markedAsRead":true,
    "id":197,
    "title":"Question 1",
    "description":"This is the prof's first response<br />"
		<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/threadeddiscussions/10012345678/topics/8000055/responses/800100222/responseAuthor",
        "rel":"self"
      },{
        "href":"https://api.learningstudio.com/users/2114380",
        "rel":"related"
      }]},
    "postedDate":"2010-02-09T15:29:55.88",
    "links": [
      {
        "href": "https://api.learningstudio.com/courses/123456/threadeddiscussions/10012345678/topics/8000055/responses/800100222/attachments",
        "rel": "https://api.learningstudio.com/courses/threadedDiscussions/topics/responses/attachments"
      }
    ]
  }]
}
2800 reads
Always Learning
Pearson