User impersonation in Atlassian connect get 500 Internal Server Error on Confluence API

Hi, I’m developing Jira Cloud Connect Application. Wanted to call the rest API from Jira Connect backend (in my case is Java) and get some data from Confluence, I’ve red a lot of documentation and I think this is the right one:

I’ve implemented service to create new JWT and then I send it to this Rest API and I receive new access token. (The response:
image )

Then I get the access token from the response and I’m trying to call Jira Rest API and Confluence API with it.

When I call Jira API it’s fine and it’s working.

  • https://{cloudName}{issuesKey} - WORKS!
    When I call Confluence API it’s not working. No matter what Rest API I’m using I always get error 500.
  • https://{cloudName} - DOESN’T WORK!
    "error": "No value present"