Retrieve an event by id
- async AsyncCogniteClient.events.retrieve(
- id: int | None = None,
- external_id: str | None = None,
Retrieve a single event by id.
- Parameters:
id (int | None) – ID
external_id (str | None) – External ID
- Returns:
Requested event or None if it does not exist.
- Return type:
Event | None
Examples
Get event by id:
>>> from cognite.client import CogniteClient, AsyncCogniteClient >>> client = CogniteClient() >>> # async_client = AsyncCogniteClient() # another option >>> res = client.events.retrieve(id=1)
Get event by external id:
>>> res = client.events.retrieve(external_id="1")