API Issue on nonspecific GETs


#1

I’m able to login using the API and get a JWT as expected. When I use the API to GET a specific network server, gateway profile, etc. (any of the properties saved on loraserver), I have no trouble getting correct data.

However, when I use the API to GET all network servers, gateway profiles, etc., I am not getting the detail that is shown in the API. For example, running the GET function on network servers gives:
{
“totalCount”: “1”,
“result”: []
}
The totalCount is correct, but the result array is empty. According to the example in the API, I should be getting something similar to this:
{
“result”: [
{
“createdAt”: “2018-11-26T13:03:59.635Z”,
“id”: “string”,
“name”: “string”,
“server”: “string”,
“updatedAt”: “2018-11-26T13:03:59.635Z”
}
],
“totalCount”: “string”
}

I have accessed it using the api via a browser and via a Javascript program (logging in correctly both times). There does not appear to be any object inside the result array, and as far as I can tell, there should be one containing the above information about my network server that I set up.

Is there a setting that I have overlooked to give this verbose information on an API GET call for the array of network servers, etc.?


#2

You are forgetting the ?limit=10 (for getting 10 items in this example)


#3

Thank you, that solves the problem completely. I assumed that if it were left blank, it would default to the max number instead of 0. Thinking about it, this makes more sense.