chirpstack / chirpstack-rest-api

ChirpStack gRPC API to REST proxy.
MIT License
17 stars 14 forks source link

Trying to Enqueue Downlink #18

Closed offizium-berndstorath closed 1 month ago

offizium-berndstorath commented 3 months ago

Request URL: {{baseUrl}}/api/devices/04b6480450061804/queue Request Body:

{
  "queueItem": {
    "confirmed": true,
    "data": "EA==",
    "fPort": 1,
    "id": "{{$randomUUID}}"
  }
}

Response Body:

{
    "code": 13,
    "message": "Odd number of digits",
    "details": []
}

If I add something to data (e.g. EEA==) I get this

{
    "code": 3,
    "message": "proto: (line 4:13): invalid value for bytes type: \"EEA==\"",
    "details": []
}

Maybe updating grpc-gateway fixes this

VladislavGatsenko commented 1 month ago

The description to the fields states that: "id - string - ID (UUID). This is automatically generated on enqueue."

Which means you don't need to specify it.

offizium-berndstorath commented 1 month ago

This is not related to the problem in any way

VladislavGatsenko commented 1 month ago

Everything you need to send Downlink in the example below:

{ "queueItem": { "confirmed": false, "data": "SGVsbG8gZnJvbSBHaUh1YiA6KQ==", "fPort": 123 } }

Swagger UI Downlink

offizium-berndstorath commented 1 month ago

I wouldn't have created this issue if it worked.

{
    "queueItem": {
        "confirmed": false,
        "data": "SGVsbG8gZnJvbSBHaUh1YiA6KQ==",
        "fPort": 123
    }
}

results in

{
    "code": 13,
    "message": "Odd number of digits",
    "details": []
}
VladislavGatsenko commented 1 month ago

It's weird because it's supposed to work. I checked that such an error occurs when specifying an incorrect DevEUI: I added an extra space after it and as a result I got the same error as yours.

offizium-berndstorath commented 1 month ago

The problem was that the generated OpenAPI is invalid or Postman interprets it wrong