curl https://api.particle.io/v1/devices/events?access_token=<redacted>
While running a Photon, I see there is a way to get the command line command from the Events page of my device. Where is this access token generated from? I ask this because it is not the same as the token noted in the IDE>Settings.
I am not sure, I guess it is the syntax of curl, because if I see the documentation using the Particle.publish () -> for events do not use devices…
or if you need to use device you are not identifying your device, normally this is like/devices/DEVICEID/somethingelsehere
https://api.particle.io/v1/devices/0123456789abcdef/brew -d access_token=123412341234 -d “args=coffee”
EXAMPLE REQUEST
curl -H “Authorization: Bearer {ACCESS_TOKEN_GOES_HERE}”
https://api.particle.io/v1/events/motion-detected.
The Events page in the console generates its own short-lived token when you use the view in terminal. If you log out of the console, this token will be invalidated as well.
1 Like