Problem with getting Custom Field Options via API (AP.request)

Hi,

Refers to:
https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-custom-field-options/#api-rest-api-2-field-fieldid-context-contextid-option-get

I have a problem with getting the options available for a given customfiedls using the API:
Every time I get HTTP 403 error even though my contextId and customfieldId are correct.
By executing the request directly in the browser, I’m getting the following data:

{
"maxResults": 100,
"startAt": 0,
"total": 5,
"isLast": true,
"values": [
{
"id": "10082",
"value": "opt1",
"disabled": false
},
{
"id": "10083",
"value": "opt2",
"disabled": false
},
{
"id": "10084",
"value": "opt3",
"disabled": false
},
{
"id": "10085",
"value": "opt4",
"disabled": false
},
{
"id": "10086",
"value": "opt5",
"disabled": false
}
]
}

Unfortunately when I do it with AP.request it gets HTTP 403.
I checked Administer Jira global permission and I have it set correctly.

What else can I check?
Regards and thanks for all your help.
Mik.

Have you tried to check the endpoint that your is actually called by the browser when you use your app?
In my case, there was additional word ‘projects’ added. I still don’t know why…

Or maybe paste more of your code and the response then someone can better help you.