What does the attribute OK mean in REST device ping?

I am currently developing an infrastructure to write apps that communicate with my Particle devices via the documented REST interface. One thing that I have written and tested is code to “ping” a selected device to see if it is on-line

(reference: https://docs.particle.io/reference/api/#ping-a-device)

The online documentation says that the Particle Cloud returns JSON as follows:

{
“online”: true,
“ok”: true
}

I have observed this to be correct, as well as “online”:false when the device is offline. But: what does the other attribute “ok”:true mean? Well, of course, if “ok” is true, it is pretty obvious what it means. But is “ok” ever false? If so, what, specifically, would cause this? I want my apps to correctly and fully respond to a device ping. However, the “ok” attribute is not documented and I was wondering if anyone has further information.

ok will be false if the request is invalid. For example, if you pass an invalid device ID or one you don’t have access to.

1 Like

I actually tried passing an invalid device ID and this is not what I got back. What I got back was a JSON structure that said {“error”: …} where … was a lengthy text massage saying that either the user access token or the device ID was not recognized and to try again, yadda yadda. I did not get back a response of {“online”:false,“ok”:false} which is what I expected and you suggested should happen. So perhaps the “ok”:false is what was originally intended but has been supplanted with a more meaningful response?