I’m using the losant api from my intranet server to grab all devices from an application.
(https://api.losant.com/applications/".$appId."/devices)
For some reason it will only return 99 devices of 134.
Any suggestions ?
Hey @Lars_Andersson,
I assume you are using the GET Endpoint for Devices. In that documentation, you can see that the default perPage
is 100 devices. You can change this value to a maximum of 1,000.
Let me know if this helps!
Thank you,
Heath
Yes I am.
So I need to use the “query” option to change that?
I’m a bit weak on this.
I’m using php to prepare a curl statement for the api.
Do I need to add the query parameters to the HTTP headers?
It’s just a query parameter that goes on the end of the API URL. So, your request URL would be:
GET https://api.losant.com/applications/APPLICATION_ID/devices?perPage=200
Let me know if this doesn’t work for you.
Thank you,
Heath
Aah, that easy !.
Thanks
1 Like