Getting License validation is not supported in Cloud error while accessing jira cloud rest api's

Below is my curl request. I generated an API token from my account settings.

curl --request POST \
  --user rahul.trehan@gliffy.com:<api_token> \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '
    "string"' \
  --url 'https://gliffy.atlassian.net/rest/api/2/licenseValidator'

Below is the error that I get when I do curl or use postman

<status>
 <status-code>500</status-code>
 <message>License validation is not supported in Cloud</message>
 <stack-trace>java.lang.UnsupportedOperationException: License validation is not supported in Cloud
 at com.atlassian.jira.bc.license.CloudLicenseService.validate(CloudLicenseService.java:54)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:498)
 at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26)
 at com.sun.proxy.$Proxy75.validate(Unknown Source)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:498)

Hi @rahul.trehan,

Thanks for letting us know about this! According to this you should be able to use this endpoint (but not as an app) for cloud as well.

Created JRACLOUD-69863 product bug.

Cheers,
Anne Calantog

This is expected behavior. This API is for validating the license of the Jira site itself, which is only applicable for Jira Server and Jira Data Center, where users need to manage license keys manually.

If your API token is valid then you should be able to test it with other APIs, like mypermissions.

Hi @dmeyer,

Thanks for letting us know! An omission in the Jira REST API docs should be done then? I’ll raise it then in the documentation.

Cheers,
Anne Calantog

Hi,
Is there a way we can get license details from an add-on using a rest API.

Thanks,
Rahul

Yes: https://developer.atlassian.com/platform/marketplace/license-api-for-cloud-apps/