Skip to main content

Hello,

I’m Pierre, data engineer at Cognite. I’ll be posting, on a regular basis, some useful tips about Cognite Data Fusion and its use. If you have any questions or remarks (technical or not), don’t hesitate to reach out to me or to create a new topic in Cognite Hub.

 

 

Some of the features of the Cognite API are not available in the Python SDK. You can still use those features by making a call to the desired endpoint. The SDK facilitates this process thanks to the get, post, put and delete methods of the Cognite client (see: https://cognite-docs.readthedocs-hosted.com/projects/cognite-sdk-python/en/latest/cognite.html#cogniteclient). Once your client is set up, all the auth process is taken care of by itself, it is very straight forward.

 

Example:

payload = {...}

endpoint_url = “/api/v1/projects/my-project/context/diagram/detect/”

response = client.post(endpoint_url, payload)

 

When a payload is needed, you can refer to the documentation to get insights on its structure. (Cognite API documentation: https://docs.cognite.com/api/v1/)

 

This tip could broaden your experience with Cognite Data Fusion and facilitate the use of the API. The SDK provides you the ability to make requests to the API in a really straight-forward way. This could help you tackle some challenges, using diagram contextualisation, Cognite functions, and other great features.

 

If you have any questions, don't hesitate to reach out to in this thread or in a new post.

Correction on this:

You don’t need the host URL in the endpoint

endpoint_url = '/api/v1/projects/slb-stic/assets?limit=100'

response = client.get(endpoint_url)

 


Thank you @HanishSharma, I edited the post. 


Reply