Send event to an entity

PUT/projects/{projectId}/entities/{entityId}/event

Base URL: https://api.tinkermode.com

Send an event to the specified entity and propagate it to the relevant listeners.

Authentication

Send an Authorization header of the form ModeCloud <AUTH_CODE>.

Must contain a user API key of a user with permission to create entity event, a service account token with the same permission, or a project API key with permission to send events,

Path parameters

NameTypeRequiredConstraintsDescription
projectIdintegerYesThe unique ID for a specified project.
entityIdstringYesEntity ID (unique within project)

Request body

Content type: application/json

PropertyTypeRequiredConstraintsDescription
eventDataobjectYesEvent-specific data as a JSON hash. Opaque to the cloud service.
eventTypestringYespattern: ^[a-zA-Z](?:[\-_]?[a-zA-Z0-9]+)*$Event type ID. Must begin 1 or more alpha characters; dashes ('-') and underscores ('_') may be used after the first character but must be followed by 1+ alphanumeric characters.
homeIdintegerNoread-only (server-generated)ID of the home associated with this event. MODE adds this at event delivery to listeners. Devices don't need to add this.
originDeviceClassstringNoread-only (server-generated)If the event originates from a device, this property is the device's class ID. MODE adds this at event delivery to listener.
originDeviceIdintegerNoread-only (server-generated)MODE adds this at event delivery to listeners. This property is present if the event originates from a device.
originDeviceIpstringNoread-only (server-generated)IP address of device. This property is present if the event originates from a device. MODE adds this at event delivery to listeners.
originProjectKeyIdstringNoread-only (server-generated)If the event originates from a project API key, this property is the unique key ID. MODE adds this at event delivery to listener.
originProjectKeyNamestringNoread-only (server-generated)If the event originates from a project API key, this property is its display name. MODE adds this at event delivery to listener.
timestampstringNoread-only (server-generated); format: date-timeMoment when event was triggered. MODE adds this at event delivery to listeners. Devices don't need to add this.

Request example

{
  "eventData": {
    "appSerial": 14,
    "appTimestamp": 14243423423,
    "serial": 12,
    "timestamp": 1402313424,
    "zones": [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      1
    ]
  },
  "eventType": "sprinkler-status"
}

Responses

204 Event sent to entity successfully. There is no return body.

401 Authorization is required to access this resource.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

403 Request failed because of invalid data or denied permission.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

404 The requested event does not exist or is not accessible.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

429 Request failed because of rate limit.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

500 An unexpected error has occurred.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

503 The service is temporarily unavailable.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.