Trigger HTTP request after creating a device through the web interface

Greetings everyone, I hope you all are doing great.

I’ve recently configured ChirpStack using the Docker installation method. I require that, each time a device is registered via the web interface, it initiates an HTTP request to an external API. This request should include the device’s AppEUI and DevEUI in the body.

I was checking the documentation and I couldn’t see any topic related to that. There isn’t anything like “system events” (there is the logs that I can see in the terminal, but that’s it) that tell when a device or any other entity was created.

Is it possible to achieve this?

Best regards

–Juan David

Please take a look at:

I believe this might do what you need. This exposes the API requests + some additional meta-data (in case of device create the DevEUI).

Greetings. @brocaar Thanks for the quick response.

I have a little question. Aside from the devEUI, I also require to have the appEUI in the meta-data. Is there a way to get said info?

It is not exposed, but the JoinEUI (if configured) + any other data that you are interested in can be retrieved by making a gRPC API call using the DevEUI as identifier.

Greetings @brocaar I hope you are doing great.

I’d like to ask you a quick question:

In order to implement what I initially asked in this post, I’m using the chirpstack python API.

In the past the following code worked correctly:

from chirpstack_api import api

def process_messages(self, resp: List[Tuple[str,dict]], action: Callable):
        control = True
        for _, messages in resp:
            for message in messages:
                last_id = message[0]
                for field, value in message[1].items():
                    if field == "request":
                        request_log = api.RequestLog()
                        request_log.ParseFromString(value.encode())
                        obj = json.loads(MessageToJson(request_log))
                        control = action(obj)
        return last_id, control

However, Today I was performing some testing and I found myself with this error:

  File "/home/ubuntu/redis_handler.py", line 98, in process_messages
    request_log = api.RequestLog()
                  ^^^^^^^^^^^^^^
AttributeError: module 'chirpstack_api.api' has no attribute 'RequestLog'

So, my question is:

Was the chirpstack api updated recently, was the RequestLog object removed from the chirpstack class?

I’ll be attentive to your response. Thanks a lot

The notes from the 4.6.0 release today, there is a mention of the changing location of request log:

It is likely that your Python package was updated. You will want to update your running ChirpStack instance and your own code, or pin the Python package to the version you were using previously.

1 Like