Chirpstack-rest-api problem?

Hi,
I installed the chirpstack v4 and it is working OK. In order to enqueue a downlink to a device, if I use the grpc python example (Python examples - ChirpStack open-source LoRaWAN® Network Server documentation) with the proper values, it works like a charm. But I’m trying to use the REST API (REST - ChirpStack open-source LoRaWAN® Network Server documentation) in order to queue a downlink to a device and it doesn’t work. I adapted this example (HTTP examples - ChirpStack open-source LoRaWAN<sup>®</sup> Network Server), which worked very well in the past with chirpstack v3, but not on v4. The chirpstack v4 web-interface presents in the queue tab always a entry with FPort 0, without Data, as soon as I execute de curl from the http-example above.

Any ideas ? Is there a new example to use the chirpstack v4 REST API ?

Doublecheck the API.
APIs for CSv3 and v4 are different in endpoints and parameters.

Hi datnus, i’ve realized that, the enqueue API doesn’t change enough (API queue definition for POST starts at line 846 - chirpstack-rest-api/device.swagger.json at master · chirpstack/chirpstack-rest-api · GitHub).

If I enqueue a payload with MQTT and execute the GET method with curl to this chirpstack-rest-api: curl -X GET --header ‘Content-Type: application/json’ --header ‘Grpc-Metadata-Authorization: Bearer my_API_KEY’ --header ‘Accept: application/json’ ‘http://<IP_chirp_stack_rest_api>:8090/api/devices/xxxxxxxxxxxxxxxx/queue’ , it results something like this: {“id”:“aaaaaaa-aaaa-aaaaa-aaaaaaaa”,“devEui”:“xxxxxxxxxxxxxxxx”,“confirmed”:false,“fPort”:5,“data”:“MQ==”,“object”:null,“isPending”:false,“fCntDown”:0}. So, It works OK.

Now If I use the chirpstack-rest-api in order to enqueue executing this curl command: curl -X POST --header ‘Content-Type: application/json’ --header ‘Grpc-Metadata-Authorization: Bearer my_API_KEY’ --header ‘Accept: application/json’ -d ‘{“deviceQueueItem”:{“confirmed”:false,“fPort”:5,“data”:“EA==”}}’ ‘http://<IP_chirp_stack_rest_api>:8090/api/devices/xxxxxxxxxxxxxxxx/queue’ , it shows the ID and and entry is showed. If I execute the GET method with curl it returns the new entry with this behavior of fPort:0 and data:"" :

{“id”:“bbbbbbb-bbbb-bbbbb-bbbbbbbb”,“devEui”:“xxxxxxxxxxxxxxxx”,“confirmed”:false,“fPort”:0,“data”:"",“object”:null,“isPending”:false,“fCntDown”:0},
{“id”:“aaaaaaa-aaaa-aaaaa-aaaaaaaa”,“devEui”:“xxxxxxxxxxxxxxxx”,“confirmed”:false,“fPort”:5,“data”:“MQ==”,“object”:null,“isPending”:false,“fCntDown”:0}

Any ideas ?