Pearson
Always Learning

This API retrieves the list file attachments on a thread post and provides a URL to download the content of the file.

Note: At this time attachments can only be uploaded via the LearningStudio User Interface.



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/{contentItemId}/topics/{topicId}/responses/{postId}/attachments{.format}
  • Retrieves a list of the attachments for a thread post.
GET /users/{userId}/courses/{courseId}/threadeddiscussions/{contentItemId}/topics/{topicId}/responses/{postId}/attachments/{attachmentId}{.format}
  • Retrieves the detail of a single attachment.

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
{attachmentId} LearningStudio Attachment 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

{
  "attachments": [
    {
      "id": {attachmentId},
      "name": "{filename}",
      "content": {
        "location": "{contentHref}"
      }
    }
  ]
}

Note: If only a single attachment is requested (see Endpoints, above), the top-level property is called attachment and its value is an object rather than an array.

Property Descriptions

Name Description
{attachmentId} ID of the attachment.
{filename} Filename for the Attachment.
{contentHref} A URL that allows you to download the content of the attachment. This API will probably return binary content (though if the file was text-based, it will be text). You'll use what is returned here, with the filename, to reconstruct the file.

Example

Request

Endpoint

GET /courses/123456/threadeddiscussions/10012345678/topics/8000055/responses/800100222/attachments

Response

Body

{
  "attachments": [
    {
      "id": 8000000445588,
      "name": "Content Wishlist.docx",
      "content": {
        "location": "https://api.learningstudio.com/courses/123456/threadeddiscussions/10012345678/topics/8000055/responses/800100222/attachments/8000000445588/content"
      }
    }
  ]
}
2495 reads
Always Learning
Pearson