Claiming a Photon from the command line

OK, hold that, based on @ScruffR post https://community.particle.io/t/where-can-i-find-the-device-claim-code/20011/2 I worked through the API calls required.

Wow, you can do a lot via the API …

For reference:

# Claim an online device
curl -d access_token=<access token> -d id=<device id> https://api.particle.io/v1/devices/

# Unclaim a device
curl -d access_token=<access_token>  -X DELETE https://api.particle.io/v1/devices/<device id>

# With access token taken from settings tab in https://build.particle.io 
# and device ID from particle serial identify
2 Likes