App can't show restricted data to users

Hello all!
I am trying to create an app that will pull data from a restricted file and then display some of that data to users. I am running into the problem where only admins can run the app.
Here is the api call.

response = await api.asApp().requestConfluence(route`/wiki/api/v2/pages/${pageId}?body-format=storage`, {
        headers: {
          'Accept': 'application/json'

and here is my scopes

    - storage:app
    - write:confluence-content
    - write:page:confluence
    - read:content:confluence	
    - read:page:confluence
    - read:confluence-user
    - read:content-details:confluence

Couple of questions…
When you’re saying that only admin can run the app - what happens? As in they’re only able to access the ui?

Can you explain what is a “restricted file”? What makes it restricted (the permissions of the page? )

You might want to use api.asUser() instead of api.asApp()


Any user can run the App, when run it throws “Cannot read property ‘0’ of null” or “Cannot read property ‘storage’ of undefined.”
Restricted file as in only certain confluence users can view and edit.
I have tried asUser() and run into the same issue.
I have given the Confluence UI system user for the app access to the file and it still doesn’t function.
Thanks for taking the time to respond.

It really sounds like you need to be using asUser() (so that you’re not the app user - that will require the suer to have access to the space/pages). However that will more than likely require the user to accept the forge confirmation screen.

Can you post an errors/exceptions that you receive back?


Here is the Error when asUser is used.

There is no forge confirmation screen.