Skip to content

REST SDK

This API is intended to be used by those who are familiar with and prefer to use a RESTful solution and have a good understanding of JSON. This API allows the deployed application to be more fully integrated with core HCC2 functions, compared to the Modbus solution.

Additional Components

  • Integrated Development Environment (IDE). Use your favorite IDE. The choice may depend on the programming language selected to build the application. For the purpose of this document, Visual Studio Code (vscode) is the IDE.

  • RESTful language. The API RESTful gives you more freedom in choosing a language to implement your application.

You may install these components on a standard, development-grade laptop or computer (refer to the Development Environment section for the recommended specification). Although these components may be installed under Windows, Sensia recommends creating a virtual machine (using the selected virtualization application) running Linux-based OS. Ubuntu 22.04 is preferred, but any major standard Linux distro may be used.

Hardware

It is advisable to have an HCC2 device that is properly configured to be the final target for application development.

Libraries

The REST interface is implemented inside the HCC2 and ready for use without additional library installations. However, you will need to install new libraries and packages to allow your application to properly interface with the HCC2 REST interface using your selected programming language. Many packages are available for applications using a RESTful interface. For C# and Python, we recommend installing these libraries:

Python

  • Pydantic
  • Flask or FastAPI
  • requests or httpx

C#

  • .Net 8
  • HttpClient (built into .Net)
  • RestSharp (a long term favorite)
  • Refit (a more modern framework with a clean declarative style)

Install these libraries into the IDE of choice using recommended installation procedures. In the case of vscode, you can use the nuget command or install the libraries through Extensions.

More detailed information on the REST implementation can be found here.