Learning Hub: Nightly synchronization for Subscribers

This is a LearningBuilder-specific feature that supports LearningBuilder Subscribers.

Overview

API that is called from LearningBuilder to initiate a nightly sync with the Learning Hub.

LearningBuilder can perform a daily “sync” with the Learning Hub. The process is:

  • A scheduled task is set up for the LearningBuilder client that hits a Learning Hub API every night

  • The Hub keeps track of the last date that a sync was performed and identifies all new Events that were created since that time

  • The Hub converts those Events into a Workflow Import Queue API payload and sends it to LearningBuilder

  • LearningBuilder processes the imported data on a background queue, just like when a CSV file is uploaded

Calling the API

API Hostnames

See https://heuristicsolutions.atlassian.net/wiki/spaces/DOCS/pages/3697770890/Learning+Hub#API-Hostnames

Authentication

See https://heuristicsolutions.atlassian.net/wiki/spaces/DOCS/pages/3697770890/Learning+Hub#Authentication

POST /api/processEvents

Initiates a process in which the Hub identifies new Events (from Publishers that the caller is subscribed to) and then posts those events to the caller’s LearningBuilder instance using https://heuristicsolutions.atlassian.net/wiki/spaces/DOCS/pages/3814817793.

Requires that the Event Subscription record contains a translation template that maps the Publisher’s Activity Type to the Workflow Import Queue process that should be performed.

The “Events” in DynamoDb are retrieved thru the GSI “GSI_EventsByDate”

The GSI is retrieving data using “Events” “EventDateBucket” field as a Partition Key,

Then using the “Events” “CreatedUtc” field as the Sort key, queries between the Subscriptions “LastSyncTime” to the current date time.

Querystring parameters

Parameter

Description

Parameter

Description

programId

The Program to sync.

Responses

Response Code

Headers and Body

Response Code

Headers and Body

200 (Ok)

A Workflow Import Queue batch was successfully created on the Subscriber’s LearningBuilder instance.

This does NOT mean that the data is valid, just that the batch was accepted and will begin processing in the background.

Postman Collection for this Endpoint