# Forge Async API 401 Confluence REST API

**URL:** <https://community.developer.atlassian.com/t/forge-async-api-401-confluence-rest-api/86645>\
**Category:** Forge\
**Tags:** async-events-api, confluence-cloud, rest-api\
**Created:** [November 26, 2024, 7:23pm UTC](https://community.developer.atlassian.com/t/forge-async-api-401-confluence-rest-api/86645 "2024-11-26T19:23:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nahi](https://avatars.discourse-cdn.com/v4/letter/n/c37758/32.png) [@Nahi](https://community.developer.atlassian.com/u/Nahi)\
**Post date:** [November 26, 2024, 7:23pm UTC](https://community.developer.atlassian.com/t/forge-async-api-401-confluence-rest-api/86645/1 "2024-11-26T19:23:39Z")

</div>

When I query the Confluence REST API it returns a 401 response

```auto
const response = await api.asUser().requestConfluence(route`/wiki/api/v2/spaces`, {
        headers: {
            'Accept': 'application/json'
        }
    });

```

I know I have the correct scopes set as this works in the backend function, however in the consumer function it doesn’t seem to be sending the oauth token as a parameter.

Does anyone know if this is possible in a queue consumer?

---

<div class="post-metadata">

**Author:** ![AlexeyKotlyarov](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/alexeykotlyarov/32/45643_2.png) [@AlexeyKotlyarov](https://community.developer.atlassian.com/u/AlexeyKotlyarov)\
**Post date:** [November 26, 2024, 9:58pm UTC](https://community.developer.atlassian.com/t/forge-async-api-401-confluence-rest-api/86645/2 "2024-11-26T21:58:34Z")

</div>

Hello Nahi!

When you are processing an [async event](https://developer.atlassian.com/platform/forge/runtime-reference/async-events-api/), there is no user associated with the request, even if the event was pushed from a user-driven interaction.

Therefore you should use `asApp` instead of `asUser` when calling Confluence.
