Skip to content

Retrieve an event.

Request

Security
oauth2
Path
eventIdstring, (uuid)required

Id of the event.

GET
/events/{eventId}
const eventId = 'YOUR_eventId_PARAMETER';
const instance = 'YOUR_instance_PARAMETER';
const resp = await fetch(
  `https://${instance}.app.willowinc.com/api/v3/events/${eventId}`,
  {
    method: 'GET',
    headers: {
      Authorization: 'Bearer <YOUR_TOKEN_HERE>'
    }
  }
);

const data = await resp.text();
console.log(data);

Responses

OK

Body
idstring, (uuid)

Gets the event id which acts as the primary key in the database.

namenull or stringrequired

Gets or sets the event name.

descriptionnull or string

Gets or sets the event description.

startTimestring, (date-time)required

Gets or sets the event start time.

endTimenull or string, (date-time)

Gets or sets the event end time.

eventTypeIdinteger, (int32)required

Gets the event type id which is defined by Willow, e.g. CalendarEvent, WeatherForecast, UtilityBill, ….

typeinteger(EventType)

Gets the strongly-typed event type, or null when int Event.EventTypeId does not correspond to a known EventType.

subTypeIdnull or integer, (int32)

Gets or sets the event sub type id, which further qualifies the int Event.EventTypeId.

categorynull or integer, (int32)

Gets or sets the event category — the id of a user-defined EventCategory. Independent of the event type and sub type — any event may carry any category. Null or 0 means "no category". On update, null preserves the existing category and 0 explicitly clears it, so clients that don't yet send the field can't clear data they don't know about.

eventSourceIdnull or string

Gets the name of the source system, which is for informational purposes.

externalIdnull or string

Gets an Id linking it to the source system, facilitating updates and deletes.

payloadnull or stringrequired

Gets or sets a JSON string containing type-specific values.

payloadVersionnull or stringrequired

Gets or sets a version for the payload to assist in the deserialization of the payload.

scalarValuenull or number, (double)

Gets or sets a double value that may be stored to complement the Payload value.

twinIdnull or stringrequired

Gets the id of the twin that is a reference to to an existing space, or equipment twin.

locationsnull or string

Gets or sets a JSON string with the expanded location ancestors for the twinId.

createdDatestring, (date-time)required

Gets or sets the date the event was created in the system.

lastModifiedDatestring, (date-time)required

Gets or sets the date the event was last modified in the system.

Response
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "name": null,
  "description": null,
  "startTime": "2019-08-24T14:15:22Z",
  "endTime": null,
  "eventTypeId": 0,
  "type": 0,
  "subTypeId": null,
  "category": null,
  "eventSourceId": null,
  "externalId": null,
  "payload": null,
  "payloadVersion": null,
  "scalarValue": null,
  "twinId": null,
  "locations": null,
  "createdDate": "2019-08-24T14:15:22Z",
  "lastModifiedDate": "2019-08-24T14:15:22Z"
}