Retrieve multiple assets by id
- async AsyncCogniteClient.assets.retrieve_multiple(
- ids: Sequence[int] | None = None,
- external_ids: SequenceNotStr[str] | None = None,
- ignore_unknown_ids: bool = False,
Retrieve multiple assets by id.
- Parameters:
ids (Sequence[int] | None) – IDs
external_ids (SequenceNotStr[str] | None) – External IDs
ignore_unknown_ids (bool) – Ignore IDs and external IDs that are not found rather than throw an exception.
- Returns:
The requested assets.
- Return type:
Examples
Get assets by id:
>>> from cognite.client import CogniteClient, AsyncCogniteClient >>> client = CogniteClient() >>> # async_client = AsyncCogniteClient() # another option >>> res = client.assets.retrieve_multiple(ids=[1, 2, 3])
Get assets by external id:
>>> res = client.assets.retrieve_multiple( ... external_ids=["abc", "def"], ignore_unknown_ids=True ... )