Sending X-ExperimentalApi: true through AP.request

Hi Team,

I’m testing some JSD experimental methods. JSD requires the header X-ExperimentalApi: opt-in to be set.

I’m trying to send the header when calling from my js cloud addon to JIRA using AP.request but I cannot. It seems that the headers: parameter is restricted to ‘Accept’, ‘If-Match’ and ‘If-None-Match’ for some reason?

https://developer.atlassian.com/cloud/jira/platform/jsapi/request/

How can I send the X-ExperimentalApi? I’m trying something like this:

AP.require('request', function (request) {
                                request({
                                    url: url,         
                                    dataType: 'json',
                                    headers: {'X-ExperimentalApi': 'opt-in'}, <-- doesn't work
                                    success: function (data, message, xhr) {
                                        ...
                                    },
                                    error: function (xhr) {
                                       ...
                                    }
                                })
                            });

Cheers
Fernando

Hi @fboucquez,

the AP.require API docs mention a boolean option for an “experimental” parameter you can set (it’s located at the bottom of the table on the site you linked to). Is that maybe what you’re looking for?

Cheers,
Tobi

1 Like

Thanks Tobi!! I missed that.

1 Like