# \[Solved\] Problem generating access token for a customer

**URL:** <https://community.particle.io/t/solved-problem-generating-access-token-for-a-customer/25529>\
**Category:** Cloud\
**Created:** [September 1, 2016, 4:17pm UTC](https://community.particle.io/t/solved-problem-generating-access-token-for-a-customer/25529 "2016-09-01T16:17:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chap](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/chap/32/2783_2.png) [@chap](https://community.particle.io/u/chap)\
**Post date:** [September 1, 2016, 4:17pm UTC](https://community.particle.io/t/solved-problem-generating-access-token-for-a-customer/25529/1 "2016-09-01T16:17:57Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![peekay123](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peekay123/32/810_2.png) [@peekay123](https://community.particle.io/u/peekay123)\
**Post date:** [September 1, 2016, 4:19pm UTC](https://community.particle.io/t/solved-problem-generating-access-token-for-a-customer/25529/2 "2016-09-01T16:19:17Z")

</div>

@chap, this may be related:

> [@No Access Tokens Causing Apps to Fail \[SOLVED\]](https://community.particle.io/t/no-access-tokens-causing-apps-to-fail/25500/4):
>
> Hi @Ric, I’m sorry about the slow response. Our team deployed some code yesterday, and this appears to have introduced the bug you hit. They’re deploying some different updates today, and I’ve asked them to fix this asap. If all else fails, @KyleG feel free to ping me slight_smile Thanks, David

---

<div class="post-metadata">

**Author:** ![chap](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/chap/32/2783_2.png) [@chap](https://community.particle.io/u/chap)\
**Post date:** [September 1, 2016, 4:57pm UTC](https://community.particle.io/t/solved-problem-generating-access-token-for-a-customer/25529/3 "2016-09-01T16:57:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![KyleG](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/kyleg/32/11077_2.png) [@KyleG](https://community.particle.io/u/KyleG)\
**Post date:** [September 5, 2016, 7:00am UTC](https://community.particle.io/t/solved-problem-generating-access-token-for-a-customer/25529/4 "2016-09-05T07:00:46Z")

</div>

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