Retrieve Download Urls

async AsyncCogniteClient.data_modeling.files.retrieve_download_urls(
node_ids: NodeId | tuple[str, str] | Sequence[NodeId | tuple[str, str]],
*,
extended_expiration: bool = False,
) dict[NodeId, str]

Get download URLs for one or more files by instance ID.

Note

If you pass instance IDs as tuple(s), the returned mapping will always use NodeIds as keys.

Parameters:
  • node_ids (NodeId | tuple[str, str] | Sequence[NodeId | tuple[str, str]]) – Instance ID or list of instance IDs.

  • extended_expiration (bool) – Extend expiration time of download URL to 1 hour. Defaults to False.

Returns:

Dictionary mapping each instance ID to its download URL.

Return type:

dict[NodeId, str]

Examples

Get a download URL for a single file:

>>> from cognite.client import CogniteClient
>>> from cognite.client.data_classes.data_modeling import NodeId
>>> client = CogniteClient()
>>> urls = client.data_modeling.files.retrieve_download_urls(
...     NodeId("my-space", "my-file")
... )

Get download URLs for multiple files:

>>> urls = client.data_modeling.files.retrieve_download_urls(
...     [("my-space", "file-1"), ("my-space", "file-2")]
... )