particle-iot / cloud

A place to discuss issues, enhancements, features for: API, Cloud Compiler, Web IDE (Build), Webhooks, Console, and Device Setup
2 stars 0 forks source link

Claim response different format if already claimed #53

Open incorvia opened 5 years ago

incorvia commented 5 years ago

Bug

Expected behavior

When claiming a device vs attempting to claim a device that is already claimed it should return the same or a similar response.

Observed behavior

With a device with NO claim running:

curl https://api.particle.io/v1/devices \       
       -d id=PARTICLE_ID \
       -d access_token=ACCESS_TOKEN -v

will return

{"user_id":"USER_ID","updated_at":"2018-09-17T17:44:36.841Z","id":"PARTICLE_ID","connected":true,"ok":true}

However when run immediately right after (a second time in a row claimed by myself) it returns:

{"deviceID":"PARTICLE_ID","connected":true,"ok":true}

Notes that one returns the particle id under the “ID” key while the other turns the id under the “deviceID” … this makes developing harder because we cannot rely on the response coming back the same…

Steps to reproduce

See previous ^

monkbroc commented 5 years ago

Thanks. We'll take a look.