Skip to content

Commit

Permalink
Don't use deprecated endpoint for documents.retrieve_content (#2076)
Browse files Browse the repository at this point in the history
  • Loading branch information
erlendvollset authored Jan 2, 2025
1 parent f8f2287 commit 89849d2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cognite/client/_api/documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 89849d2

Please sign in to comment.