Leap Events v1.0

Status

This page represents version 1.0 of the Leap Event specification. New versions of Leap Events will always be backward compatible; using a never remove, only add strategy.

Leap supports both Leap Event structures as well as plain JSON events. However, only Leap Event structures are supported for retry strategies and EAS integrations.

To request changes to the specification or report an error please contact support.

Data Format

Leap Events are defined in JavaScript Object Notation (JSON). Conventions related to this document and definitions of publisher/subscriber responsibilities related to Leap Events are discussed in the Leap JSON introduction document.

Unless otherwise noted, objects defined by this specification should not contain any additional members. Client and server implementations must ignore members not recognized by this specification.

EAS Data Format

A distinction needs to be made between a regular Leap Event and an EAS (Event Activity Streams) event.

A square is a rectangle, but, a rectangle is not a square

The same is true when it comes to Leap Events and EAS events. An EAS event IS a Leap Event, but, not all Leap events are EAS events.

The EAS event format is more expressive and therefore requires additional fields. In the table below, notice the column “EAS” that indicates whether a particular attribute is required for LEAF (Leap Elastic Activity Feature).

Top-level Reserved Property Names

A document MAY include the following attributes:

NameTypeEASExtra
idStringYA publisher-supplied identifier, regardless of whether it is successful or unsuccessful.  id is used to identify events, manage retry strategies and server logs. (Required)
actorObjectYContainer object for data and metadata specific to the source of the event. (Optional)
objectObjectYContainer for the subject of the event and metadata associated with the subject. (Optional)
activityTypeStringYClassifies the event for consumers. Many Leap functions rely on this field. Used by EAS to organize and route events. (Optional, but, strongly suggested)
activityTagsString [ ]NServes as a guide to event consumers by providing context as to the intent of the event. Often used in combination with other event data for querying events from long-term storage. (Optional)
updatedDatetimeYA timestamp that can be issued by the publisher or consumer based on the last event interaction. Although this is optional, it’s a good practice to update the event when it passes through any processing. (Optional)
snapshotObjectNContainer for data related to any piece of the event. This could be data side-loaded by an event consumer or a copy of a previous event state. (Optional)
metadataObjectYContainer for data that aids in the description or transportation of an event. Common examples of metadata are JWT, language, API keys, etc…(Optional)

If metadata.accountId and metadata.siteId are not present, Leap will apply the default site and account

{
    "id": "UsKdi7ZA",
    "object": {
        "id": "SV2Mxk0A",
        "content": {
            "data": {
                "apiVersion": "apiVersion",
                "data": {
                    "eventDTM": "2021-09-29 06:09:32.133",
                    "kind": "CONDUCTED",
                    "conducted": {
                        "internalId": "88",
                        "assignedDestination": "21",
                        "confirmData3": "",
                        "confirmData2": "",
                        "actualDestination": "21",
                        "confirmReason": "0",
                        "confirmData1": "SCN_Q2",
                        "id": "00000814921746425108",
                        "divertResponseLogTime": 112
                    }
                }
            },
            "contentType": "application/vnd.leap+json"
        },
        "objectType": "conducted"
    }
}
{
    "actor": {
        "actortype": "ELASTIC_WCS",
        "name": "SCN_Q2",
        "link": "",
        "id": "SCN_Q2",
        "content": {
            "data": "",
            "contentType": ""
        }
    },
    "id": "UsKdi7ZA",
    "metadata": {
        "accountId": "ALL",
        "siteId": "all"
    },
    "activityType": "conducted",
    "activityTags": [
        "WCSPLCClient",
        "SUCCESS"
    ],
    "updated": "2021-10-27T02:09:32.113",
    "snapshot": {
        "metaData": {
            "data": "",
            "contentType": ""
        },
        "content": {
            "data": "",
            "contentType": ""
        }
    },
    "object": {
        "metaData": {
            "data": "",
            "contentType": ""
        },
        "processMetaData": {
            "requestvalidation": "2021-10-27T02:09:32.186",
            "consumedFromEASTopicAndQueue": "2021-10-27T02:09:32.185",
            "persisted": "2021-10-27T02:09:32.186",
            "sent": "2021-10-27T02:09:32.113",
            "updated": "2021-10-27T02:09:32.186"
        },
        "id": "SV2Mxk0A",
        "content": {
            "data": {
                "apiVersion": "apiVersion",
                "data": {
                    "eventDTM": "2021-10-27 06:09:32.133",
                    "kind": "CONDUCTED",
                    "conducted": {
                        "internalId": "88",
                        "assignedDestination": "21",
                        "confirmData3": "",
                        "confirmData2": "",
                        "actualDestination": "21",
                        "confirmReason": "0",
                        "confirmData1": "SCN_Q2",
                        "id": "00000814921746425108",
                        "divertResponseLogTime": 112
                    }
                }
            },
            "contentType": "application/vnd.leap+json"
        },
        "objectType": "conducted"
    }
}

actor Object Reserved Property Names

NameTypeExtra
actorTypeStringClassifies the actor or event source as belonging to a specific group. This could be used to group actors by platform, e.g. WCS, WMS, Picker, etc… (Optional)
nameStringThe human-readable identifier for the event source. (Optional)
linkStringREST URL to access the Actor resource for this specific event source. (Optional)
idStringUnique identifier for the Actor. (Required)
contentObjectContainer for any additional data associated with the Actor (Optional)
{
    // ...
    "actor": {
        "actortype": "ELASTIC_WCS",
        "name": "SCN_Q2",
        "link": "https://someURL:8080/actors/SCN_Q2",
        "id": "SCN_Q2",
        "content": {
            "data": "<actor>ELASTIC_WCS</actor>",
            "contentType": "application/xml"
        }
    },
    / ...
}

event object Reserved Property Names

NameTypeExtra
idStringUnique identifier for the Object (Required)
objectTypeStringClassifies the event content as belonging to a specific group. This could be used to group data by type. (Optional)
contentObjectContainer for data that is the main portion of the Event. Usually, this will be the ‘thing’ that is involved in the event. (Optional)
processMetadataObjectPopulated by EAS, includes timestamps specific to event routing and persistence. (Optional)
metadataObjectContainer for data that aids in the description of the object being processed in the event. (optional)
{
    // ...
    "object": {
        "metaData": {
            "data": {
                "location":"DC_Austin"
            },
            "contentType": "application/json"
        },
        "processMetaData": {
            "requestvalidation": "2021-10-27T02:09:32.186",
            "consumedFromEASTopicAndQueue": "2021-10-27T02:09:32.185",
            "persisted": "2021-10-27T02:09:32.186",
            "sent": "2021-10-27T02:09:32.113",
            "updated": "2021-10-27T02:09:32.186"
        },
        "id": "SV2Mxk0A",
        "content": {
            "data": {
                "apiVersion": "apiVersion",
                "data": {
                    "eventDTM": "2021-10-27 06:09:32.133",
                    "kind": "CONDUCTED",
                    "conducted": {
                        "internalId": "88",
                        "assignedDestination": "21",
                        "confirmData3": "",
                        "confirmData2": "",
                        "actualDestination": "21",
                        "confirmReason": "0",
                        "confirmData1": "SCN_Q2",
                        "id": "00000814921746425108",
                        "divertResponseLogTime": 112
                    }
                }
            },
            "contentType": "application/vnd.leap+json"
        },
        "objectType": "conducted"
    }
    // ...
}

content Object Reserved Property Names

The content object pattern re-occurs in the Event Structure, it can be found in the Actor, Object, and Snapshot. This object is designed to be flexible so that most of the common data types are supported – although the event wrapper is JSON, the content of the events does not have to be, this could increase usability by removing barriers to accepting raw data as events.

NameTypeExtra
dataAnyAny value that is embedded within an Event Structure. This is usually JSON or vnd.leap+json. However, this could be a number or String.

Note: If you want to send XML data, transform it into a String. (Required)
contentTypeStringClassifies the type of the “data” field. This is equivalent to an HTTP Content-Type header. (Required)
Updated on November 15, 2021

Was this article helpful?

Related Articles