Hi!
We are making a product and using the Two-Legged Auth method.
Here are the steps I’ve followed so far, following this guide:
-
Creating OAuth Client Credientials – I did this on console.particle.io, choosing Two-Legged (Server) –no problems so far
-
I added OAuth Credentials to my server. We have a rails application, so the client credentials live in the deployed server environment
-
I have tried to create a Customer. I used my client credentials to do this, following this guide:
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/products/widget-v1/customers
I received a bearer token in response:
{"token_type":"bearer","access_token":"3e4cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","expires_in":7776000,"refresh_token":"0550xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}
I then tried to verify that the customer exists:
curl -X GET https://api.particle.io/v1/products/widget-v1/customers\?access_token="9xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
I receive this:
{"customers":[],"devices":[],"meta":{"total_pages":0}}
When I check console.particle.io in the product tab, no customers exist, so this checks out. But, not so quick, because if I try to create a customer again using the same command as before, I get this error:
{"ok":false,"code":400,"error":"customer_exists"}
And, to make matters more confusing, if I query my product devices with the following command, it shows that I have multiple devices:
curl -X GET https://api.particle.io/v1/products/widget-v1/devices\?access_token="9xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
What am I missing here? Why am I unable to create customers?