Clarification on REST API vs gRPC for ChirpStack v4 Integration

Viewed 18

Hello,

We are integrating ChirpStack v4 into our custom IoT management platform and we want to confirm whether our understanding of the REST API situation is correct.

From our tests and from previous replies, it seems that:

The REST API in ChirpStack v4 is automatically generated by gRPC-gateway

It is not actively maintained

It may not fully match the protobuf definitions

Several endpoints (e.g. /api/applications, /api/tenants/{id}/applications) are not implemented or return errors

Some required fields in the OpenAPI specification may be inaccurate

The recommended way to interact with ChirpStack is via gRPC instead of REST

Could you please confirm whether this interpretation is correct?

Additionally, what would be your official recommendation for a server-side integration that needs to:

Create tenants

Create applications

Create and manage devices

Retrieve lists of applications / devices

Handle downlinks

Monitor gateway activity

Is the intended and supported approach to generate client code directly from the .proto files and use the gRPC API exclusively?

Any guidance or best-practice recommendations for stable long-term integration would be highly appreciated.

Thank you!

1 Answers

In general, I would always recommend using gRPC over the REST API. Using gRPC has the advantage that the structs are already created for you and all fields in the structs already have the correct types (depending the language you are using for your integration).

As ChirpStack v3 provided both a gRPC and REST API (based on the same gRPC gateway project) and some users migrating from ChirpStack v3 to ChirpStack v4 already implemented their integration on top of the REST API, I am providing the same gRPC <> REST proxy based on the ChirpStack v4 API interface.

The REST API endpoints are automatically generated based on option (google.api.http) and should therefore be equal to the gRPC interface (e.g. /api/applications is provided by https://github.com/chirpstack/chirpstack/blob/master/api/proto/api/application.proto#L53). The behavior should be exactly the same.

There was a report that the gRPC gateway had some naming inconsistencies. I have not had the time to look into this (I would welcome a PR in case somebody confirmed this issue and found the fix).

Is the intended and supported approach to generate client code directly from the .proto files and use the gRPC API exclusively?

Please note that for some languages, gRPC client code is already provided. The need to generate code from the .proto files depends on the language you are going to use.


(The reason why the REST interface was added in the past was the web-interface, as by then gRPC-web did not exist. The ChirpStack v4 web-interface is implemented directly on top of the gRPC API using gRPC-web).