we are trying to get our backend to send private events to devices using the product endpoint API, something like this:
curl "https://api.particle.io/v1/products/:productIdOrSlug/events" \ -d "name=myevent" \ -d "data=Hello World" \ -d "private=true" \ -d "ttl=60" \ -d access_token=1234
My backend’s O-Auth client is a
Two-Legged Auth (Server) client, and I get the token for this client with:
curl https://api.particle.io/oauth/token \ -u <client_id>:<client_pwd> \ -d grant_type=client_credentials
The devices subscribe to the event with:
Particle.subscribe("myevent", theHandler, MY_DEVICES);
Can someone clarify why this doesn’t work and suggest the recommended way for sending private events from the backend to the devices?