Pearson
Always Learning

Overview

When a user creates posts in a threaded discussion, they can also attach a document (photo, PDF, etc) to their post. When they do, LearningStudio will send this event.

Message Type ID

Use this message type id to subscribe to this event and identify incoming instances of it: pearson.ls.threads.responseattachment.created

What Triggers This Event

This event is triggered when any user posts a response in a threaded discussion that includes an attachment. It is also triggered when an attachment is added to a post using this API call:

  • POST /courses/{courseId}/threadedDiscussions/{threadedDiscussionId}/topics/{topicId}/ responses/{responseId}/attachments

Note this event may be sent at the same time as the separate Thread Response Created event.

See Threads for the resources, use cases, and concepts for the Threads API resources.

Event Payload

Here is the structure of the event's payload. Text directly surrounded by curly brackets (e.g., {eventId}) are parameters that are defined in the table below.

{
  "eventId": "{eventId}",
  "eventDate": "{eventDate}",
  "eventType": "{eventType}",
  "object": {
    "id": "{objectId}",
    "type": "{parentEventType}",
    "responseattachmentvoid": {AttachmentID},
    "response_pk": {ResponsePk},
    "filemanager_pk": {FilemanagerPk},
    "filemanagerfilename": "{FilemanagerFilename}",
    "topic_id": {TopicId},
    "thread_id": {ThreadId}    
  },
  "actor": {
    "id": "{actorId}",
    "type": "{actorType}",
    "firstName": "{FirstName}",
    "lastName": "{LastName}",
    "emailAddress": "{EmailAddress}",
    "userName": "{Username}"
  },
  "contexts": {
    "course": {
      "id": "{courseId}",
      "title": "{courseTitle}",
      "displayCourseCode": "{displayCourseCode}",
      "callNumbers": [{courseCallNumbers}],
      "nodes": ["{courseNode}"]
    },
    "ep": {
      "id": "{epId}",
      "clientString": "{clientString}"
    }
  }
}

Event Payload Parameter Descriptions

Name Description Valid Values
{eventId} Unique ID assigned to the specific event.
{eventDate} Date and time when the event was published to the eventing message queue. Time is in UTC (no timezone offset). Format is
YYYY-MM-DDTHH:MM:SS.SSSZ
.
{eventType} Event type of the event object.
pearson.ls.threads.
↳ responseattachment.
↳ created
{objectId} Unique object ID for the specific event contract data.
pearson.ls.threads.
↳ responseattachment_
↳ {AttachmentId}
.
{parentEventType} An ID that represents the category of events, less specific than this event message type.
pearson.ls.threads.
↳ responseattachment
{AttachmentId} Attachment ID that was created.
{ResponsePk} ID of the response that is the parent of the created attachment.
{FilemanagerPk} File ID of the created attachment within the attachment file manager system.
{FilemanagerFilename} Filename of the created attachment within the attachment file manager system.
{TopicId} Topic ID that is the parent of the response ID.
{ThreadId} Thread ID that is the parent of the topic ID.
{actorId} LearningStudio user ID of user who created the response attachment.
{actorType} Designates the type of user that generated the event.
user
Event was generated by the user action of creating the attachment.
{FirstName} First name of user who created the attachment.
{LastName} Last name of the user who created the attachment.
{EmailAddress} Email address of the user who created the attachment.
{Username} LearningStudio username (login ID) of the user who created the attachment.
{courseId} LearningStudio course ID that contains the relevant threaded discussion.
{courseTitle} Title of the course that contains the relevant threaded discussion.
{displayCourseCode} Display code for the course that contains the relevant threaded discussion.
{courseCallNumbers} Array of institution's call numbers assigned to the course that contains the relevant threaded discussion. Zero or more IDs written as strings.
{courseNode} Array of IDs of the nodes for which this course is associated. Zero or more IDs written as strings.
{epId} The numeric ID of the institution (the LearningStudio campus or instance).
{clientString} The institution's client string (primary identifier for campuses).

Example

{
  "eventId": "c331f5b4-34c0-4849-bb44-343be6e1a61d",
  "eventDate": "2013-01-12T14:55:12Z",
  "eventType": "pearson.ls.threads.responseattachment.created",
  "object": {
    "id": "pearson.ls.threads.responseattachment_25016",
    "type": "pearson.ls.threads.responseattachment",
    "responseattachmentvoid":25016,
    "response_pk":11111,
    "filemanager_pk":22222,
    "filemanagerfilename":"testfile.doc"
    "topic_id":333333,
    "thread_id":444444
    },
  "actor": {
    "id": "2116922",
    "type": "user",
    "firstName": "bob",
    "lastName": "prof1",
    "emailAddress": "bobs@domain.com",
    "userName": "bobprof1"
    },
  "contexts": {
    "course": {
    "id": "2022425",
    "title": "What About Bob? 101",
    "displayCourseCode": "WAB - 101",
    "callNumbers": [],
    "nodes": ["402629"]
    },
  "ep": {
    "id": "987654",
    "clientString": "epsamplestring"
    }
  }
}
2649 reads
Always Learning
Pearson