LightDB Stream API error response

Description

I’m trying to use the LightDB Stream API (as documented in Open API Docs | Golioth).

I’m able to query the list of devices for the project (/v1/projects/{projectId}/devices), but when I try to query the stream API using one of the device IDs I get the following error response:

{
  "code": 3,
  "message": "error parsing query parameters: invalid query format",
  "details": []
}

Here’s the query:

curl -X 'GET' \
  'https://api.golioth.io/v1/projects/cgnd-dev/devices/6840e324b09429a446b47f62/stream' \
  -H 'accept: application/json' \
  -H 'x-api-key: <redacted>'

I’m probably just missing something simple. Any idea what I’m doing wrong?

Expected Behavior

I expect that the query would return the LightDB stream data.

Actual Behavior

I’m getting the error described in the description above.

Environment

I’m using the default legacy LightDB stream pipeline.

Logs and Console Output

N/A

Hey @cdwilson! This API is not intuitive and we are planning to make some updates to it in the near future. In the meantime, when using the GET endpoint you must encode the query as a URL parameter. You can supply the query via the request body when using POST. More information can be found in this recent post on the Golioth blog.

Thanks @hasheddan! I think what initially confused me was the OpenAPI docs list projectId and deviceId as the only “required” parameters for the GET endpoint, so I incorrectly assumed it would just dump all the stream data for the device if I omitted all the optional ones.

POST works as expected with the query in the body.

2 Likes