Hi, I am trying to get my app working with App Server API, but the general queries (applications, gateways, devices) always return empty arrays.
Example:
curl -X GET --header ‘Accept: application/json’
–header ‘Grpc-Metadata-Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJsb3JhLWFwcC1zZXJ2ZXIiLCJleHAiOjE1NzQ0MTU0NTEsImlzcyI6ImxvcmEtYXBwLXNlcnZlciIsIm5iZiI6MTU3NDMyOTA1MSwic3ViIjoidXNlciIsInVzZXJuYW1lIjoiYWRtaW4ifQ.dba-W430I83dw6T_I3BMupKLSfysY80uXcbvV6E9K_4’
‘http://10.2.1.24:8080/api/organizations’
Result:
{“totalCount”:“1”,“result”:[]}
Thank you for any feedback.
@Jan_Rozhon,
You need to pass "limit" query parameter
Example:
'http://localhost:8080/api/organizations?limit=1'
Result:
{ "totalCount": "1", "result": [ { "id": "1", "name": "loraserver", "displayName": "loraserver", "canHaveGateways": true, "createdAt": "2018-10-15T05:53:46.444804Z", "updatedAt": "2018-10-15T05:53:46.444804Z" } ] }
Thank you very much. I have not seen any doc saying limit is mandatory. I just hope I have not overlooked it.
Thank you
bconway
#4
Technically it isn’t mandatory, but it defaults to 0. I agree this is counter-intuitive (and unusual) and am frequently caught by it.