2

Webhook Data

 

Webhooks integrated with OpenLearning institutions via either the Webhook Connector or the Microsoft Power Automate Connector are sent with the following data:

{
  "action": "{actionName}",
  "actor": { ... },
  "context": {
    "courseId": "{courseId}",
    "classId": "{classId}",
    "ipAddress": "{ipAddress}"
  },
  "timestamp": "{iso8601_timestamp}",

  ... additional fields specific to the event
}

The "actor" object is as follows:

{
  "name": "Harry Potter",
  "id": "{user_id}",
  "enrolmentId": "{cohort_enrolment_id}",
  "externalId": "{institution_external_id}",
  "institutionEmail": "{institution_email}",
  "userEmail": "{user_email}"
}

institutionEmail corresponds to the email on record for the user for this institution/cohort. e.g. recorded when the user was invited to a course, or provisioned via the API. If this field is not available, it is omitted.

userEmail corresponds to the primary email on record for the user's account. This is only provided if the user has given email sharing consent for the course from which the event was generated. It is otherwise omitted.

 

Events are sent to webhooks with the following "action" names:

Triggered when a user visits a course page.

Actor: the user who viewed the page.

{
  "action": "pageViewed",
  "actor": {...},
  "page": {
    "title": "Page Title",
    "id": "{object_id}",
    "url": "https://www.openlearning.com/.../page_url"
  },
  "context": {
    "courseId": "{course_id}",
    "classId": "{class_id}",
    "ipAddress": "{user_ip_address}"
  },
  "timestamp": "{iso8601_timestamp}"
}

Triggered when a user has completed all the requirements of a course page.

Actor: the user who completed the page.

{
  "action": "pageCompleted",
  "actor": {...},
  "page": {
    "title": "Page Title",
    "id": "{page_id}",
    "url": "https://www.openlearning.com/.../page_url"
  },
  "context": {
    "courseId": "{course_id}",
    "classId": "{class_id}",
    "ipAddress": "{user_ip_address}"
  },
  "timestamp": "{iso8601_timestamp}"
}

Triggered when a user comments on a course page.

Actor: the user who commented on the page.

{
  "action": "pageCommented",
  "actor": {...},
  "page": {
    "title": "Page Title",
    "id": "{page_id}",
    "url": "https://www.openlearning.com/.../page_url"
  },
  "comment": {
    "id": "{comment_id}",
    "content": "{comment_content}"
  },
  "context": {
    "courseId": "{course_id}",
    "classId": "{class_id}",
    "ipAddress": "{user_ip_address}"
  },
  "timestamp": "{iso8601_timestamp}"
}

Triggers when a user has completed all the requirements of an activity section on a course page.

Actor: the user who completed the activity.

{
  "action": "activityCompleted",
  "actor": {...},
  "activity": {
    "id": "{block_id}"
  },
  "page": {
    "id": "{page_id}",
    "title": "Page Title",
    "url": "https://www.openlearning.com/.../page_url"
  },
  "context": {
    "courseId": "{course_id}",
    "classId": "{class_id}",
    "ipAddress": "{user_ip_address}"
  },
  "timestamp": "{iso8601_timestamp}"
}

Triggers when a user submits an answer to an activity section on a course page.

Actor: the user who submitted to an activity.

{
  "action": "activitySubmitted",
  "actor": {...},
  "activity": {
    "id": "{block_id}"
  },
  "page": {
    "id": "{page_id}",
    "title": "Page Title",
    "url": "https://www.openlearning.com/.../page_url"
  },
  "context": {
    "courseId": "{course_id}",
    "classId": "{class_id}",
    "ipAddress": "{user_ip_address}"
  },
  "submission": {
    ... submission data (widget specific)
  },
  "timestamp": "{iso8601_timestamp}"
}

Triggers when a user publishes a post to an activity section on a course page.

Actor: the user who published a post.

{
  "action": "postPublished",
  "actor": {...},
  "post": {
    "id": "{post_id}",
    "text": "{post_text}",
    "data": { ... post data (widget specific) }
  },
  "activity": {
    "id": "{block_id}"
  },
  "page": {
    "id": "{page_id}",
    "title": "Page Title",
    "url": "https://www.openlearning.com/.../page_url"
  },
  "context": {
    "courseId": "{course_id}",
    "classId": "{class_id}",
    "ipAddress": "{user_ip_address}"
  },
  "timestamp": "{iso8601_timestamp}"
}

Triggers when a user comments on a post.

Actor: the user who commented on the post.

{
  "action": "postCommented",
  "actor": {...},
  "post": {
    "id": "{post_id}"
  },
  "activity": {
    "id": "{block_id} that generated the post"
  },
  "page": {
    "id": "{page_id} of block id above",
    "title": "Page Title",
    "url": "https://www.openlearning.com/.../page_url"
  },
  "comment": {
    "id": "{comment_id}",
    "content": "{comment_content}"
  },
  "context": {
    "courseId": "{course_id}",
    "classId": "{class_id}",
    "ipAddress": "{user_ip_address}"
  },
  "timestamp": "{iso8601_timestamp}"
}

Triggers when a user joins (enrols in) a class.

Actor: the user who joined a class.

{
  "action": "classProgressed",
  "actor": {...},
  "class": {
    "title": "Class Title",
    "courseTitle": "Course Title",
    "id": "{class_id}"
  },
  "context": {
    "courseId": "{course_id}",
    "classId": "{class_id}",
    "ipAddress": "{user_ip_address}"
  },
  "progress": {
    "completed": 40,
    "total": 80
  },
  "timestamp": "{iso8601_timestamp}"
}

Triggers when a user's class progress changes.

Actor: the user who progressed in a course.

{
  "action": "classJoined",
  "actor": {...},
  "class": {
    "title": "Class Title",
    "courseTitle": "Course Title",
    "id": "{class_id}"
  },
  "context": {
    "courseId": "{course_id}",
    "classId": "{class_id}",
    "ipAddress": "{user_ip_address}"
  },
  "timestamp": "{iso8601_timestamp}"
}

Triggers when a class is created

Actor: the user that creates the class

{
  "action": "classCreated",
  "actor": {...},
  "class": {
    "title": "Class Title",
    "courseTitle": "Course Title",
    "id": "{class_id}"
  },
  "context": {
    "courseId": "{course_id}",
    "classId": "{class_id}",
    "ipAddress": "{user_ip_address}"
  },
  "timestamp": "{iso8601_timestamp}"
}

Triggers when a class is deleted

Actor: the user that deletes the class

{
  "action": "classDeleted",
  "actor": {...},
  "class": {
    "title": "Class Title",
    "courseTitle": "Course Title",
    "id": "{class_id}"
  },
  "context": {
    "courseId": "{course_id}",
    "classId": "{class_id}",
    "ipAddress": "{user_ip_address}"
  },
  "timestamp": "{iso8601_timestamp}"
}

Triggers when a user leaves the class. 

Actor: The user who left the class
Instigator: The user that initiated the actor to leave (eg. a staff member or course admin removing them from a class).

Example: 

  • removed by course admin/facilitator via UI (source: “ui”, user: the staff member)

  • learners removed themselves (source: “ui”, user: themselves)

  • removed by API (source: “api”, user: whose API key was used

{
  "action": "classDropped",
  "actor": {...},
  "class": {
    "title": "Class Title",
    "courseTitle": "Course Title",
    "id": "{class_id}"
  },
  "context": {
    "courseId": "{course_id}",
    "classId": "{class_id}",
    "ipAddress": "{user_ip_address}",
    "instigator": {
      "source": "api" | "ui",
      "user": { ... user data (who caused this user to drop from the class) }
    }
  },
  "timestamp": "{iso8601_timestamp}"
}

Triggers when a user has completed all the requirements of a course.

Actor: the user who completed the course.

{
  "action": "courseCompleted",
  "actor": {...},
  "course": {
    "title": "Course Title",
    "id": "{course_id}"
  },
  "context": {
    "courseId": "{course_id}",
    "classId": "{class_id}",
    "enrolDate": "{iso8601_timestamp}",
    "ipAddress": "{user_ip_address}"
  },
  "score": {
    "max": 80,
    "min": 0,
    "raw": 40,
    "scaled": 0.5
  },
  "timestamp": "{iso8601_timestamp}"
}

Triggers when a user is issued a certificate.

Actor: the user who is issued a certificate.

{
  "action": "certificateIssued",
  "actor": {...},
  "certificate": {
    "id": "{certificate_id}",
    "url": "{certificate_url}"
  },
  "context": {
    "courseId": "{course_id}",
    "classId": "{class_id}",
    "ipAddress": "{user_ip_address}"
  },
  "timestamp": "{iso8601_timestamp}"
}

Triggered whenever a report is released.

Actor: the user who released the grades

{
  "action": "reportReleased",
  "actor": {...},
  "report": {
    "id": "{reportRevisionId}",
    "title": string,
    "type": "outcomes",
    "maxScore": Number,
    "created": "{iso8601_timestamp}"
  },
  "context": {
    "courseId": "{course_id}",
    "classId": "{class_id}",
    "ipAddress": "{user_ip_address}"
  },
  "timestamp": "{iso8601_timestamp}"
}

 

Triggered when a report result is changed for a particular user.

Actor: the user who changed the grade.

Recipient: the user whose result was changed.

{
  "action": "reportResultChanged",
  "actor": {...},
  "recipient": {... (same as actor, only the user whose result was changed)},
  "report": {
    "id": "{reportRevisionId}",
    "title": string,
    "type": "outcomes",
    "maxScore": Number,
    "created": "{iso8601_timestamp}"
  },
  "result": {
    "id": "{resultId}",
    "score": Number,
    "scaled": Number
  },
  "class": {
    "title": "Class Title",
    "courseTitle": "Course Title",
    "id": "{class_id}"
  },
  "context": {
    "courseId": "{course_id}",
    "classId": "{class_id}",
    "ipAddress": "{user_ip_address}"
  },
  "timestamp": "{iso8601_timestamp}"
}

 

Triggered when a report is modified.

Actor: the user who modified the report.

{
  "action": "reportModified",
  "actor": {...},
  "report": {
    "id": "{reportRevisionId}",
    "title": string,
    "type": "outcomes",
    "maxScore": Number,
    "created": "{iso8601_timestamp}"
  },
  "context": {
    "courseId": "{course_id}",
    "enrolDate": "{iso8601_timestamp}",
    "ipAddress": "{user_ip_address}"
  },
  "timestamp": "{iso8601_timestamp}"
}

 

Triggered when a user’s course grade changes.

Actor: the user whose grade changed.

{
  "action": "courseScoreChanged",
  "actor": {...},
  "score": {
    "max": 80,
    "min": 0,
    "raw": 40,
    "scaled": 0.5
  },
  "course": {
    "title": "Course Title",
    "id": "{course_id}"
  }
  "class": {
    "title": "Class Title",
    "courseTitle": "Course Title",
    "id": "{class_id}"
  },
  "context": {
    "courseId": "{course_id}",
    "classId": "{class_id}",
    "ipAddress": "{user_ip_address}"
  },
  "timestamp": "{iso8601_timestamp}"
}

Reply

null

Content aside

  • 2 Likes
  • 8 mths agoLast active
  • 147Views
  • 3 Following