# Getting 401 error for v2 identity request with all tokens except for mine

**URL:** <https://www.patreondevelopers.com/t/getting-401-error-for-v2-identity-request-with-all-tokens-except-for-mine/1475>\
**Category:** Friendly Help\
**Created:** [February 2, 2019, 10:57pm UTC](https://www.patreondevelopers.com/t/getting-401-error-for-v2-identity-request-with-all-tokens-except-for-mine/1475 "2019-02-02T22:57:49Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![lcontant](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/lcontant/32/798_2.png) [@lcontant](https://www.patreondevelopers.com/u/lcontant)\
**Post date:** [February 2, 2019, 10:57pm UTC](https://www.patreondevelopers.com/t/getting-401-error-for-v2-identity-request-with-all-tokens-except-for-mine/1475/1 "2019-02-02T22:57:49Z")

</div>

I’m helping someone with their Patreon integration, and I’m trying to see if a user on our website is patron of the creator I’m helping  
I’m using this request

```
GET /api/oauth2/v2/identity HTTP/1.1
Host: www.patreon.com
Authorization: Bearer <token here>
cache-control: no-cache

```

The request throws 401’s on every requests except for requests on my own account (the one that owns the client registered with the API)

I’m using the scopes identity.memberships

Am I using the API wrong?

---

<div class="post-metadata">

**Author:** ![phildini](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/phildini/32/112_2.png) [@phildini](https://www.patreondevelopers.com/u/phildini)\
**Post date:** [February 4, 2019, 6:57pm UTC](https://www.patreondevelopers.com/t/getting-401-error-for-v2-identity-request-with-all-tokens-except-for-mine/1475/2 "2019-02-04T18:57:36Z")

</div>

Hi can I get the request id for the request you’re making? It’ll be the `id` field in the response.

---

<div class="post-metadata">

**Author:** ![lcontant](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/lcontant/32/798_2.png) [@lcontant](https://www.patreondevelopers.com/u/lcontant)\
**Post date:** [February 5, 2019, 2:46pm UTC](https://www.patreondevelopers.com/t/getting-401-error-for-v2-identity-request-with-all-tokens-except-for-mine/1475/3 "2019-02-05T14:46:24Z")

</div>

Here is the id field  
`b3e66089-cc7c-407d-b8f0-c6edfc02fd2a`

---

<div class="post-metadata">

**Author:** ![lcontant](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/lcontant/32/798_2.png) [@lcontant](https://www.patreondevelopers.com/u/lcontant)\
**Post date:** [February 24, 2019, 5:40pm UTC](https://www.patreondevelopers.com/t/getting-401-error-for-v2-identity-request-with-all-tokens-except-for-mine/1475/4 "2019-02-24T17:40:31Z")

</div>

Hi,

Did you get a chance to look at the request from the id?

---

<div class="post-metadata">

**Author:** ![maty](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@maty](https://www.patreondevelopers.com/u/maty)\
**Post date:** [February 25, 2019, 1:18pm UTC](https://www.patreondevelopers.com/t/getting-401-error-for-v2-identity-request-with-all-tokens-except-for-mine/1475/5 "2019-02-25T13:18:16Z")

</div>

I am also having this issue. I can log in successfully only if I use my personal account. If I use another account, someone that also Pledges, I get invalid\_grant. I’m using PHP API v2.

---

<div class="post-metadata">

**Author:** ![evy](https://avatars.discourse-cdn.com/v4/letter/e/9d8465/32.png) [@evy](https://www.patreondevelopers.com/u/evy)\
**Post date:** [February 26, 2019, 7:05pm UTC](https://www.patreondevelopers.com/t/getting-401-error-for-v2-identity-request-with-all-tokens-except-for-mine/1475/6 "2019-02-26T19:05:54Z")

</div>

Hi @lcontant,

Thanks for your patience. I looked into the request - you’re requesting for user 13092443, but the token is for user 880399090.

For every user you want to request information for, you have to have that user go through the OAuth flow and get a token specific to them. Then you should be able to make requests for their information.

@maty if you can send me your `id`, I can look into what’s going on for you as well.

Hope this helps! Let me know if you have any further questions 🙂

Evy  
Platform Engineer

---

<div class="post-metadata">

**Author:** ![lcontant](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/lcontant/32/798_2.png) [@lcontant](https://www.patreondevelopers.com/u/lcontant)\
**Post date:** [February 26, 2019, 10:15pm UTC](https://www.patreondevelopers.com/t/getting-401-error-for-v2-identity-request-with-all-tokens-except-for-mine/1475/7 "2019-02-26T22:15:16Z")

</div>

Hi @evy,

The token used for the API was obtained with the AOuth flow. The identity request doesn’t explicitly specify a user. From my understanding, the token supplied determines the user for which the information is requested. As a result, I don’t understand what you mean by requesting the for the wrong user.  
Can you explain a bit further?

---

<div class="post-metadata">

**Author:** ![evy](https://avatars.discourse-cdn.com/v4/letter/e/9d8465/32.png) [@evy](https://www.patreondevelopers.com/u/evy)\
**Post date:** [March 1, 2019, 11:51pm UTC](https://www.patreondevelopers.com/t/getting-401-error-for-v2-identity-request-with-all-tokens-except-for-mine/1475/8 "2019-03-01T23:51:31Z")

</div>

Hi @lcontant,

Sorry yes that is correct (I’m new on the platform team, learning more about our API as well! 😅)

What I have learned is you need the `identity` scope. `identity.memberships` is specifically for memberships things and if you wanted to see memberships you’d need both `identity` and `identity.memberships`. Let me know if that works!

Thanks for your patience and hope that helps,  
Evy
