[Solved] Problem generating access token for a customer

I’ve created a customer (doing it again to show you it exists):

curl -u client_id:client_secret -d email=myCustomer@email.com -d no_password=true -d expires_in=0 https://api.particle.io/v1/orgs/productIdOrSlug/customers

{
  "ok": false,
  "code": 400,
  "error": "customer_exists"
}

Now trying to get their access token:

curl -u client_id:client_secret -d grant_type=client_credentials -d scope=customer=myCustomer@email.com -d expires_in=0 https://api.particle.io/oauth/token

{
  "error": "invalid_scope",
  "error_description": "Requested customer scope doesn't exist"
}

What am I doing wrong?

@chap, this may be related:

2 Likes

Just received a helpful response from @jeiden, the problem was due to customer email addresses containing capital letters.

Currently some of the API endpoints are case sensitive and some are not.

The quick fix is to downcase email addresses before creating or doing other operations with customer records.

3 Likes

This topic was automatically closed after 2 days. New replies are no longer allowed.