LogoLogo
  • Welcome to the MOOST platform user manual
  • Platform Manual
    • Login
      • Forgot Password
    • Notifications
    • Rules
      • Rule Configurator
        • Data graph
        • Datasets
        • Condition
        • Streak
        • Message
        • Settings
        • Rule Simulator
        • Early Adopter
        • Command
      • Rule Language
        • Syntax
        • Data Types
        • Data Structures
        • Functions
          • AVG
          • COUNT
          • DISTINCT
          • EVAL
          • FILTER
          • GROUP_BY_DEVICE
          • GROUP_BY_TIME
          • MAX
          • MIN
          • POSITION
          • REVERSE
          • SORT
          • SUBSET
          • SUM
        • Operations
          • Plus
          • Minus
          • Multiply
          • Divide
          • Negate
          • Less Than
          • Less or Equal
          • Equal
          • Not Equal
          • Greater or Equal
          • Greater
          • AND
          • OR
          • NOT
          • Format
          • Attribute Accessor
        • Examples
    • Events
    • Buildings
      • Household Profile
    • User Profile
    • Billing Portal
      • Payment Method
      • Update Payment Address
      • Invoices
      • Terminate Subscription
    • Context Services
      • Weather Forecast
      • Solar Production Forecast
      • Power Consumption Forecast
      • Power Generation Forecast
    • Support Center
  • Technical Integration
    • Cloud-to-Cloud Integration
      • Platform On-boarding
      • Configure Notification Settings
        • Receive Notifications
          • iOS Notification Handling
      • MOOST API Integration
        • Request Access Token
        • Synchronize Buildings and Devices
          • Device Types
        • Add Events
          • Event Types
            • Device Status
            • Charging Modes
            • Switch State
        • Notifications and Interactions
          • Return Notification Interaction
  • Best Practices
    • FAQ
    • User Acceptance Testing
  • Policies
    • Security Policy
    • Privacy Policy
Powered by GitBook

© 2025 MOOST AG

On this page
Export as PDF
  1. Technical Integration
  2. Cloud-to-Cloud Integration
  3. MOOST API Integration

Add Events

Add Event Data of Devices

Make sure that event data, which shall be taken into consideration by MOOST Recommender Platform, are forwarded to MOOST via MOOST API.

See Event Types to get an overview which events should be forwarded for which devices in which periodicity.

Event Data Structure

Following example depicts an event structure of a energy consumption event.

{
  "id": "6703cfa2fa7bfc35eb1f74d0",
  "customerId": "656730be2bc9719e6e5ed51d",
  "customerBuildingId": "99900000C048ADA6",
  "deviceId": "c8f09e83046c",
  "deviceName": "Sinemaa main meter",
  "source": "GATEWAY",
  "type": "ENERGY_CONSUMPTION",
  "value": 858.71,
  "timestamp": 1727992800000
}

Data Structure Attributes

Attribute Name
Description

id

The event ID on MOOST side (is generated when inserting a new event)

customerId

The ID of the customer (cannot be set or change)

customerBuildingId

The building ID on customer side

deviceId

deviceName

The name of the device which is producing this event. Remark: if devices have not an own name, the product name can be used.

source

type

value

The value of the event datapoint. Remark: must be a number

timestamp

Time of the event (Epoch Time in seconds (UTC))

Add an Event

For sending new Events to the MOOST Recommender Platform the below endpoint can be used.

Example with CURL

# make sure ACCESS_TOKEN is set and valid (see "Request Access Token")
curl -X POST "https://api.moost.io/events/v1" \
     -H  "Authorization: Bearer $ACCESS_TOKEN" \
     -H  "Content-Type: application/json" \
     -d "{\"timestamp\":1657029000,\"customerId\":\"656730be2bc9719e6e5ed51d\",\"customerBuildingId\":\"999000009C54AAAA\",\"deviceId\":\"17306deb97e0f94609f13e22\",\"deviceName\":\"Device Link Car\",\"value\":99.9,\"type\":\"STATE_OF_CHARGE_RATE\",\"source\":\"CAR\"}"

Add a batch of historical events

In case you want to add a batch of historical events, following endpoint can be used.

Remark: historical events will not be processed by the rule engine during insertion.

PreviousDevice TypesNextEvent Types

Last updated 3 days ago

The ID of the device which is producing this event (should refer to the device within the building, see

The device which is related to this event. See Remark: device type GATEWAY is used, when this is a data point for the whole household / building.

The event type of this event. This value also implies the data unit. See

Device Types
Event Types

Add an event to a building

post
Authorizations
Body
timestampinteger · int64Optional
customerIdstringRequiredPattern: ^[a-zA-Z0-9]{24}$
customerBuildingIdstringRequiredPattern: ^[a-zA-Z0-9:._-]{1,100}$
deviceIdstringRequiredPattern: ^[a-zA-Z0-9:._-]{3,64}$
deviceNamestringRequiredPattern: ^.{1,100}$
valuenumber · floatRequired
typestring · enumRequiredPossible values:
sourcestring · enumOptionalPossible values:
forecastTimestampinteger · int64Optional
ingestionTimestampinteger · int64Optional
Responses
201
Created
post
POST /events/v1 HTTP/1.1
Host: api.moost.io
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 200

{
  "timestamp": 1,
  "customerId": "text",
  "customerBuildingId": "text",
  "deviceId": "text",
  "deviceName": "text",
  "value": 1,
  "type": "CHARGING_MODE",
  "source": "APPLIANCE",
  "forecastTimestamp": 1,
  "ingestionTimestamp": 1
}
201

Created

No content

Building Data Structure
  • Add Event Data of Devices
  • Event Data Structure
  • Add an Event
  • POSTAdd an event to a building
  • Add a batch of historical events
  • POSTInserts historical events to the database. I.e. these events are not processed by the rule engine when receiving these events.Event customerId has to be in-line with customerId of the JWT).

Inserts historical events to the database. I.e. these events are not processed by the rule engine when receiving these events.Event customerId has to be in-line with customerId of the JWT).

post
Authorizations
Body
timestampinteger · int64Optional
customerIdstringRequiredPattern: ^[a-zA-Z0-9]{24}$
customerBuildingIdstringRequiredPattern: ^[a-zA-Z0-9:._-]{1,100}$
deviceIdstringRequiredPattern: ^[a-zA-Z0-9:._-]{3,64}$
deviceNamestringRequiredPattern: ^.{1,100}$
valuenumber · floatRequired
typestring · enumRequiredPossible values:
sourcestring · enumOptionalPossible values:
forecastTimestampinteger · int64Optional
ingestionTimestampinteger · int64Optional
Responses
200
Success. All events have been inserted.
400
Invalid event data.
*/*
500
Internal error. None or only part of the data could be written.
post
POST /events/historical/v1 HTTP/1.1
Host: api.moost.io
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 202

[
  {
    "timestamp": 1,
    "customerId": "text",
    "customerBuildingId": "text",
    "deviceId": "text",
    "deviceName": "text",
    "value": 1,
    "type": "CHARGING_MODE",
    "source": "APPLIANCE",
    "forecastTimestamp": 1,
    "ingestionTimestamp": 1
  }
]

No content