Post API get Filter and search filter returns code 403

Hello
I’m trying to get the details of a filter using rest api but I get 403 code back all the time.
Earlier in the same script I’m doing following calls:

  • ‘/rest/api/3/project/search/?orderBy=-name’
  • ‘/rest/api/3/search?jql=project%20%3D%20’ + projectKey+ ‘&fields=id,key,summary,status’
    Then I’m getting boards for project by:
  • ‘/rest/agile/1.0/board?projectKeyOrId=’ + projectKey
    For the first board in project I’m getting configuration:
  • boardAPI + ‘/configuration’
    From that configuration, I’m getting the filter data and I’m trying to call
    -‘rest/api/2/filter/’ + filterID
    But I can’t get the filter, I always get back the code 403.
    I’ve also tried:
  • ‘rest/api/2/filter/search?filterName=TEST’
    But again code 403.
    403 means lack of permision, but I don’t know what permissions are missing.

I’m admin for the project in which I’m testing this.

Any idea what I’m doing wrong?

I’ve just noticed, that my query looks like this:
AP.request({
url: ‘rest/api/3/filter/10000’,
success: function(responseText){
var data = JSON.parse(responseText);
var page = document.getElementById(“page”);
p4 = document.createElement(“h3”)
var ftext = document.createTextNode(“Filter search worked”)
p4.appendChild(ftext)
page.appendChild(p4)
}});
But the error I get is:
GET https://kanbanboards.atlassian.net/projects/rest/api/3/filter/10000?_r=1608717770311 403
There is additional word projects added. If I remove it and paste the url to browser it works as it should.
Any idea where the projects word comes from?