Our company's devices live in a product owned by our particle org, and we use a ClientID/Secret scoped to that product to claim devices. The cloud API docs state that a product device may be claimed while offline, but so far, all our attempts to claim offline devices in our product result in a 404 response. I've confirmed it's not an authentication issue as re-claiming an online device of the same product in the exact same manner is successful. Can we please get some clarification on when offline claiming should work? Are we approaching this incorrectly? Thanks.
You can claim a device that is offline only if:
- The device has been added to a product
- The claiming account is a team member of that product
Because the account must be a team member, it cannot be an oAuth account (or API user) and must be a real account.
If the account is a regular developer account that does not meet these criteria, the device must be online for claiming.
In general we recommend using unclaimed product devices for production devices. Only claim a device if used for development.
Ok thanks. So the issue is that the claim request authenticates with an API user instead of a "real" account? Are any other request types gated this way?
Claiming is a weird legacy function from before there were products and behaves uniquely. The problem is that the claiming account needs to be a real account for historical reasons. An API user allows fine-grained API access to a product device, but since the claiming API claims to authenticated user, it can't take an API user because it's not associated with a user account. Because unclaimed product devices are the recommended path, claiming was left as a special case.