Pearson
Always Learning

This API retrieves the most recent thread post that the specified user posted within the given course.

Combined with APIs like Number of Replies to a Post or List of Replies to a Post, this API offers a streamlined way to check for user-specific updates in a threaded discussion content item.

Note: If the user is active in multiple threaded discussion content items, this API only retrieves the most recent post from across all of them. For more granular status updates, you should consider using Thread Events.



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 /users/{userId}/courses/{courseId}/threadeddiscussions/lastResponse{.format}
  • Retrieves the most recent thread post by a user in the course.

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}
{.format} Desired format of response data. See Response Formats. .json , .xml , or Blank

Query String Parameters

Query Parameter Name Description Valid Values
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

{
  "response":{
    "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} ID of the thread post.
{responseTitle} Post title.
{responseBody} Body of the post.
{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

Request

Endpoint

GET /users/888888/courses/123456/threadeddiscussions/lastresponse

Response

Body

{
  "response":{
    "id":8000150510,
    "title":"This is my first post",
    "description":"I'm <b>so</b> excited for this class.",
    "author":{
      "links":[{
        "href":"https://api.learningstudio.com/courses/123456/threads/10012345678/topics/800055/responses/8000150510/responseAuthor",
        "rel":"self"
      },{
        "href":"https://api.learningstudio.com/users/3333333",
        "rel":"related"
      }]},
    "postedDate":"2010-02-09T15:29:55.88",
    "links": [{
        "href": "https://api.learningstudio.com/courses/123456/threads/10012345678/topics/800055/responses/8000150510/attachments",
        "rel": "https://api.learningstudio.com/courses/threadedDiscussions/topics/responses/attachments"
      }]
  }
}

Example - For a CMS course using useSourceDomain

Request

Endpoint

GET /users/888888/courses/123456/threadeddiscussions/lastresponse?useSourceDomain=true

Response

Body

{
  "response":{
    "id":8000150510,
    "title":"This is my first post",
    "description":"I'm <b>so</b> excited for this class.
		<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/8000150510/responseAuthor",
        "rel":"self"
      },{
        "href":"https://api.learningstudio.com/users/3333333",
        "rel":"related"
      }]},
    "postedDate":"2010-02-09T15:29:55.88",
    "links": [{
        "href": "https://api.learningstudio.com/courses/123456/threads/10012345678/topics/800055/responses/8000150510/attachments",
        "rel": "https://api.learningstudio.com/courses/threadedDiscussions/topics/responses/attachments"
      }]
  }
}
2851 reads
Always Learning
Pearson