# I am getting a 403 response after Api request

**URL:** <https://community.auth0.com/t/i-am-getting-a-403-response-after-api-request/70438>\
**Category:** Get Help\
**Created:** [September 28, 2021, 7:41pm UTC](https://community.auth0.com/t/i-am-getting-a-403-response-after-api-request/70438 "2021-09-28T19:41:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![othmanenaamani](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/othmanenaamani/32/32002_2.png) [@othmanenaamani](https://community.auth0.com/u/othmanenaamani)\
**Post date:** [September 28, 2021, 7:41pm UTC](https://community.auth0.com/t/i-am-getting-a-403-response-after-api-request/70438/1 "2021-09-28T19:41:03Z")

</div>

I am trying to retrieve users from API using Axios to localhost/3000 like this

```auto
...
const accessToken = await getAccessTokenSilently({
      audience: `https://${domain}/api/v2/`,
      scope: "read:users",
 });

...

const options = {
      method: "GET",
      url: `${api}/users`,
        params: {
          q: '',
          search_engine: 'v3',
       },
      headers: {
        Authorization: `Bearer ${accessToken}`,
        'Content-Type': 'application/json',
      },
    };

...
return axios(options)
    .then((response) => response.data)
    .catch((error) => {
      console.error(error);
    });
...

```

I got the token successfully but always getting an error message:

```auto
Error: Request failed with status code 403

```

I know it is an access token issue, but I don’t know how to fix it, Please Help!

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [September 29, 2021, 10:18pm UTC](https://community.auth0.com/t/i-am-getting-a-403-response-after-api-request/70438/3 "2021-09-29T22:18:47Z")

</div>

Hi @othmanenaamani,

Welcome to the Auth0 Community!

You cannot get a token with the `read:users` scope for the management API in a SPA. You need to make this request from a secure server like a backend API.

> **[Get Management API Access Tokens for Single-Page Applications](https://auth0.com/docs/secure/tokens/access-tokens/get-management-api-tokens-for-single-page-applications)**
>
> Learn about available scopes and endpoints for Management API tokens for Single-page Applications (SPAs).

---

<div class="post-metadata">

**Author:** ![othmanenaamani](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/othmanenaamani/32/32002_2.png) [@othmanenaamani](https://community.auth0.com/u/othmanenaamani)\
**Post date:** [September 30, 2021, 7:30pm UTC](https://community.auth0.com/t/i-am-getting-a-403-response-after-api-request/70438/4 "2021-09-30T19:30:18Z")

</div>

Oh yeah! that wasn’t permitted.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [September 30, 2021, 7:56pm UTC](https://community.auth0.com/t/i-am-getting-a-403-response-after-api-request/70438/5 "2021-09-30T19:56:01Z")

</div>

Let us know if you have any other questions!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [October 15, 2021, 7:56pm UTC](https://community.auth0.com/t/i-am-getting-a-403-response-after-api-request/70438/6 "2021-10-15T19:56:56Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
