Hi,
when I try using the API to detail an application, it works :
curl -i -X GET
-H "Authorization:Bearer eyJ(...)bIg"
-H "Content-Type:application/json"
'https://api.resin.io/v1/application(520176)'
I’m getting a HTTP 200 answer with a body corresponding to my request.
But when I try to list the devices related to this application, I can get only “internal server error (HTTP 500)” or “bad request (HTTP 400)” depending on my syntax :
curl -i -X GET
-H "Authorization:Bearer eyJ(...)bIg"
-H "Content-Type:application/json"
'https://api.resin.io/v1/application(520176)?\$expand=device'
After a few tries, I notice the curl request generated by my chrome extension (Restlet client) is generating single quotes around the endpoint URL which was causing the problem.
After getting a valid answer, it’s not listing any informations about the devices :
{
"d": [
{
"id": 520176,
"user": {
"__deferred": {
"uri": "/resin/user(18630)"
},
"__id": 18630
},
"application": null,
"actor": 1564413,
"app_name": "FleetManagement",
"git_repository": "tristan_robet/fleetmanagement",
"commit": "0ce78cbc9483811171047785d93d8a9f10df6b73",
"device_type": "raspberrypi3",
"version": 1,
"should_track_latest_release": true,
"support_expiry_date": null,
"__metadata": {
"uri": "/resin/application(520176)",
"type": ""
}
}
]
}
By the way, is there a plan to normalize your API to respect RESTful API good practices ?
For example :
https://api.resin.io/v1/application(520176)?$expand=device
would become :
https://api.resin.io/v1/applications/520176/devices
and
https://api.resin.io/v1/device?$filter=name%20eq%20’[name]’
would become
https://api.resin.io/v1/devices?name=[name]
The structure of your API would be much more visible, easy to discover and memorize, and there would be less problem related to unusual url caracters.