Getting filter results in addon

Hi, I’m trying to get a filter’s results (the issues) using an HTTP request from my addon. I know that the filter is only visible to the user who created it by default. So I tried to do this by using filter’s search URL (e.g. https://testinstance.atlassian.net/rest/api/3/search?jql=project+%3D+TP+ORDER+BY+created+DESC). I’m using java and spring boot so I created a rest template by using atlassianHostRestClients.authenticatedAsAddon() method. But I’m getting HttpClientErrorException: 400 when I send a get request. I thought it may be due to authentication, and set filter permission as public but nothing has changed. What am I doing wrong? Thanks…

EDIT
I guess this was really about authentication. Because when I used user impersonation by creating an OAuth token manually as in this example, I was able to make a request successfully.