Forge app to show the current page revision has invalid scope

I want to create an app that shows the current version of the page it is on. I adjusted the hello world tutorial to call the /wiki/api/v2/pages/{id}/versions REST url and changed the scope to read:page:confluence. I did the forge lint --fix, forge deploy and forge install --upgrade commands, but it keeps complaining that the scope is invalid.

What am I missing?

code:

import ForgeUI, { render, Fragment, Macro, Text, useProductContext, useState } from "@forge/ui";
import api, { route } from "@forge/api";

const getLatestVersionForContent = async (contentId) => {
  const res = await api
    .asUser()
    .requestConfluence(route`/wiki/api/v2/pages/${contentId}/versions?body-format=storage`);

  console.log(`Response: ${res.status} ${res.statusText}`);

  const data = await res.json();
  return data.results;
}

const App = () => {
  const context = useProductContext();

  console.log(`ContentIds: ${context.contentId}`);

  const [versions] = useState(async () => await getLatestVersionForContent(context.contentId));

  return (
    <Fragment>
      <Text>Hello world with revisions!</Text>
    </Fragment>
  );
};

export const run = render(
  <Macro
    app={<App />}
  />
);

and

manifest scopes:

permissions:
  scopes:
    - read:page:confluence
    - read:confluence-props

Welcome to the Atlassian developer community, @GerbenHeinen!

I created a new app from scratch via forge create and then copied both the code snippet and the scopes you provided and it worked as expected on my end. Are you still encountering the same issue? If so, are there any other REST APIs you’ve been calling other than the one in your code snippet?

Cheers,
Ian

Hi Iragudo,

I called the get comment api as described in the rest api. Could it be that the scope of that call got tangled up somehow with the new scope?