Pardon me for being a bit grumpy about this, but seriously?? Particle can’t be bothered to provide actual implementation details for something that is absolutely fundamental to being able to build an actual product?? Really??
This whole idea, that of making a Photon, or Electron, the basis for an actual product is fundamental to their business model. So having developers be able to create a product, and have their customers/users easily and effortlessly set it up, is a pretty basic part of that.
https://docs.particle.io/guide/how-to-build-a-product/authentication/#device-setup-steps-4-5-amp-6-
That doc assumes you already have your server set up, and have completed the steps prior to it:
https://docs.particle.io/guide/how-to-build-a-product/authentication/#2-add-oauth-credentials-to-your-server
Which is the hand-waving step that states “Coming soon: example implementation of client credentials” That bit there seems like it’s pretty important. Far too important to just gloss over with a “coming soon” banner.
Further down, we get told how to create a customer:
curl -X POST -u “client-id-goes-here:client-secret-goes-here” -d email=abu@agrabahmonkeys.com
-d no_password=true https://api.particle.io/v1/orgs/particle/customers
But that requires an ‘organization’ which, of course, I don’t have, and can’t create. And
curl -X POST -u “my-client-id:my-secret” -d email=foo.bar@davidgs.com -d no_password=true -d access_token=“myAccessToken” https://api.particle.io/v1/mBox/customers
returns:
{“ok”:false,“error”:“Not Found”}
Probably because I don’t have an ‘org’ in my URL, but creating an organization is completely opaque. I can find absolutely zero documentation on it anywhere.
So yeah, I’m frustrated. The docs are falling way short at this point.
Oh, and I did download the Photon Setup file. It’s 55k lines long. I’m thinking digging through that is going to take some time. WAAAAY more time than it would take Particle to actually document how to do this stuff.