From 89849d20eecfb3528f9566915c7a35c918672293 Mon Sep 17 00:00:00 2001 From: Erlend vollset Date: Thu, 2 Jan 2025 15:21:02 +0100 Subject: [PATCH] Don't use deprecated endpoint for documents.retrieve_content (#2076) --- cognite/client/_api/documents.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cognite/client/_api/documents.py b/cognite/client/_api/documents.py index 92dc53c971..1c367c5c3f 100644 --- a/cognite/client/_api/documents.py +++ b/cognite/client/_api/documents.py @@ -491,7 +491,9 @@ def retrieve_content(self, id: int) -> bytes: >>> client = CogniteClient() >>> content = client.documents.retrieve_content(id=123) """ - response = self._do_request("GET", f"{self._RESOURCE_PATH}/{id}/content", accept="text/plain") + + body = {"id": id} + response = self._do_request("POST", f"{self._RESOURCE_PATH}/content", accept="text/plain", json=body) return response.content def retrieve_content_buffer(self, id: int, buffer: BinaryIO) -> None: