Skip to main content
Solved

Functions with .NET

  • 24 May 2024
  • 1 reply
  • 22 views

Dear community,

We have been working with Python SDK developing functions and everything works fine, as expected.

Now we have an IP development that has C# as base language. We need to call some of the Cognite Functions utilizing the .net SDK (https://github.com/cognitedata/cognite-sdk-dotnet)  but we are having troubles to call the functions trough .net.
Has anyone been able to utilize Cognite Functions trough the .net SDK?
Thank you all.

Here is a snippet of the code:
 

1 reply

Userlevel 4

Hi Francisco!

I replied to your question in the SLB community, but let me copy the answer here as well for the wider developer audience.

The .NET SDK, as stated in our documentation, is a community SDK, which means it is provided as-is without any official support or warranties from Cognite. 

Moreover, features under the Playground section of the SDK, including function calls, are experimental and shouldn’t be used by consumers. Cognite Engineers prioritise adding features that are needed for Cognite Product components which utilize the Cognite API endpoints and today we don't have any .NET client that interacts with Cognite Functions.

Since the SDK is open source, you are encouraged to open an issue on the GitHub repository with a feature request. While we cannot provide a timeline for implementing such features, we welcome contributions from the community to add missing functionalities with Pull Requests (by checking old Pull Requests, it’s easy to figure out how to contribute).

If you were to implement the functionality to call a Cognite Function from .NET, you would need to implement the function call endpoint (/functions/{functionId}/call) and also the sessions create endpoint (/sessions), which is a prerequisite for function calls. You can refer to the respective API documentation here:

Function Call Endpoint

Sessions Create Endpoint

Reply