Brewskey / spark-server

An API compatible open source server for interacting with devices speaking the spark-protocol
https://www.particle.io/
GNU Affero General Public License v3.0
54 stars 27 forks source link

fix endpoint payloads inconsistency with particle api #257

Open AntonPuko opened 7 years ago

jlkalberer commented 7 years ago

Can you add more description? What is inconsistent?

AntonPuko commented 7 years ago

From what I remember: 1 error payloads format: our:

{
    "error": "Could not get device for ID",
    "ok": false
}

they : in some cases:

{
    "error": "Permission Denied",
    "info": "I didn't recognize that device name or ID, try opening https://api.particle.io/v1/devices?access_token=3c9f4349104ae651e75aa7b5312f0575fc52bd87"
}

in another:

{
    "ok": false,
    "errors": [
        {
            "code": 401
        }
    ]
}

in another :

{
    "ok": false,
    "error": "Webhook not found"
}

(lol, for these examples I clicked some of their endpoints and they have different error formats everywhere...pffff) 2 device status: we have connected they have online and we don't have status field in products devices at all

So, I didn't check all endpoints, but I think we have such differences in the most payloads(somewhere missed field, somewhere different prop name, etc)