Device integration

I want to automatically integrate a large number of devices. For this I tried to use the method based on a request.
I deliberately masked the sensitive data but I checked them all one by one and they are correct.

curl -v -X POST
http://127.0.0.1:8080/api/devices
-H ‘Grpc-Metadata-Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx’
-H ‘Content-Type: application/json’
-d ‘{
“device”: {
“applicationID”: “xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx”,
“devEUI”: “0095xxxxxxxxxxxx”,
“deviceProfileID”: “xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx”,
“skipFCntCheck”: false,
“referenceAltitude”: 0,
“name”: “CS-TEST”,
“description”: “load”,
“tags”: {},
“variables”: {},
“isDisabled”: false,
“skipFrameCounterValidation”: false,
“aDRInterval”: 0,
“aDREnabled”: true,
“maxSupportedDR”: 5,
“rxDelay”: 0,
“rx1DROffset”: 0,
“rx2DR”: 0,
“rx2Frequency”: 869525000,
“factoryPresetFreqs”: ,
“pingSlotFrequency”: 0,
“pingSlotDR”: 0,
“nwkSKey”: “xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”,
“appSKey”: “xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”,
“fCntUp”: 0,
“fCntDown”: 0,
“lastDevStatusRequested”: 0,
“lastDevStatusAnswer”: 0,
“lastDownlinkTX”: 0,
“referenceLocation”: {
“latitude”: 0,
“longitude”: 0,
“altitude”: 0,
“source”: “source-of-location”
}
}
}’ -o response_log.txt --no-sessionid --silent

My request fails systematically with the following return

  • Trying 127.0.0.1:8080…
  • Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)

POST /api/devices HTTP/1.1
Host: 127.0.0.1:8080
User-Agent: curl/7.81.0
Accept: /
Grpc-Metadata-Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Content-Type: application/json
Content-Length: 1059

} [1059 bytes data]

  • Mark bundle as not supporting multiuse
    < HTTP/1.1 400 Bad Request
    < content-length: 0
    < date: Thu, 11 Jan 2024 12:51:14 GMT
    <
  • Connection #0 to host 127.0.0.1 left intact

Can you tell me the reason for this error or give me another way to achieve this integration?

ChirpStack v4 does not provide a RESTful API out of the box, you need to use the gRPC API interface (or install the ChirpStack REST API bridge). Please see:
https://www.chirpstack.io/docs/chirpstack/api/grpc.html