Create an event associated with a device. Provide a device ID or name.
Security
ApiKey(Required scopes: events.create)
An object with user-defined string keys and string values; key order is not preserved
A key-value map, where each key is one of your pre-defined event custom property keys. Keys which are not recognized as custom properties will be ignored.
- Productionhttps://api.foxglove.dev/v1/events
from foxglove.client import Client
from datetime import datetime, timedelta
token = "<YOUR API TOKEN HERE>"
client = Client(token=token)
event_time = datetime.now()
client.create_event(
device_id=device_id,
start=event_time,
end=event_time,
metadata={"message": "Hi from python!"}
)
The created event
A key-value map of the custom properties associated with this event.
Response
{ "id": "string", "start": "2019-08-24T14:15:22Z", "end": "2019-08-24T14:15:22Z", "deviceId": "string", "device": { "id": "string", "name": "string" }, "metadata": {}, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "eventTypeId": "string", "properties": { "property1": "string", "property2": "string" } }