Addon Macro doesnt work in production! Authentication/Scope?

Hi!

I’ve built a Macro that works great in development mode but when on production it doesn’t work.

It is currently reduce to this:

addon
     .httpClient({
         clientKey: clientKey,
         userAccountId: userAccountId,
         appKey: addon.key,
     })
     .get('/rest/api/content' + pageId + '/history/' + pageVersion + '/macro/id/' + macroId, function(
         err,
         response,
         contents
     ) {
         console.log('--------------------------------');
         console.log(contents);
        console.log("pageId:"+ pageId);
        console.log("MacroId:"+ macroId);
        console.log("pageVersion:"+ pageVersion);
console.log('--------------------------------');
     });

which returns HTTP Status 403 – Forbidden <b>Message</b> Request not in an authorized API scope

The Macro uses user input to print a table.

Thanks
Joao

Make sure your addon has "scopes": ["READ"] in atlassian-connect.json, like this:
https://atlassianlabs.bitbucket.io/confluence-roadmap-plugin/atlassian-connect.json

Try reinstalling your addon in Confluence.

Just to leave the response here I figured what the problem was. The addon was using the confluence-users group, and I have multiple clients on that space so it was producing this error.
I ended up changing to user based permissions instead of addon and now it works great.

Thank you for your support!

Joao