initialization - Events API

This is a lower-level API. Lower-level APIs are not recommended for most projects, and may not be available on all plans.

See our page on recommended deployment patterns for more information.

Initialization Options

This article covers all configuration options available for the Events API

The Initialization JSON object contains attributes that configure the Events API when passed to the init method.

Initialization Object example

var initOptions = {

The security object handles authentication and security in communication with the API.

The signature is the result of applying a SHA-256 hash algorithm on the attributes of the security object and string representation of the request object.

A guide on how to accomplish this can be found on our Security & Authentication page, as well as Learnosity SDK in PHP, JAVA or ASP.NET.

Security Object example

    "security" : {
        "consumer_key" : "INSERT_CONSUMER_KEY_HERE",
        "domain" : "",
        "timestamp" : "20141008-1234",
        "signature" : "SHA256-HASH - See Security",
        "user_id": "INSERT_USER_ID"

The config object is where all attributes that configure the API are placed.

Config Object example

    "config" : {

A user_id and hash mapping object that is required for subscribing to Learnosity Event Bus for events from these users.

The hash is a 64 character long string, resulting from applying the SHA256 hashing algorithm to the concatenation of the following parameters in order:

  1. user_id
  2. consumer_secret

type object

users example

        "users": {
            "brianmoser": "7224f1cd26c7eaac4f30c16ccf8e143005734089724affe0dd9cbf008b941e2d",
            "hankschrader": "1e94cba9c43295121a8c93c476601f4f54ce1ee93ddc7f6fb681729c90979b7f",
            "jessepinkman": "ca2d79d6e1c6c926f2b49f3d6052c060bed6b45e42786ff6c5293b9f3c723bdf",
            "walterwhite": "fd1888ffc8cf87efb4ab620401130c76fc8dff5ca04f139e23a7437c56f8f310"
description Determines whether to ignore events that happened before initialization.
default false
type boolean

ignore_past_events example

       "ignore_past_events": false,



    var eventsApp = LearnosityEvents.init(initOptions);

Was this article helpful?

Did you arrive here by accident? If so, learn more about Learnosity.