Nikolai Golub
Nikolai Golub

Reputation: 3567

Check JIRA REST API version?

How to check, that rest api is enabled in JIRA and it has appropriate version?

I know, that it is possible to request 'api/latest', but if latest installed version isn't compatible with methods, that i call?

Upvotes: 9

Views: 9420

Answers (3)

kenorb
kenorb

Reputation: 166919

Use the /rest/serverInfo endpoint, e.g. /rest/api/2/serverInfo.

This should return a JSON string with JIRA version, e.g.

{
...
    "version": "8.x.x",
...
}

Upvotes: 2

user17048789
user17048789

Reputation: 1

View page source of Jira page and search version.

Sample output:

<meta name="application-name" content="JIRA" data-name="jira" data-version="7.9.2"><meta name="ajs-server-scheme" content="http">

Upvotes: 0

Kuf
Kuf

Reputation: 17846

To check that it is enabled, (and to disable it if you wish), then you will need to go to the Administration panel of your instance and enable/disable it there. Specifically you need to go to:

Administration > General Configuration > Set Accept remote API calls to either On/Off

To check if REST api is enabled, just go to (change the URL to your own)

https://jira.atlassian.com/rest/api/2/user

and see if the page loads.

I don't think there is a way using the API to get the API version, but you can make the API calls and fallback in case of an error. The coding depends on what you are trying to achieve.

You can find more info about the REST API at:

Upvotes: 6

Related Questions