Skip to content
This repository has been archived by the owner on Jul 23, 2020. It is now read-only.

Cannot get licensing information for addon #243

Open
dasheck0 opened this issue Mar 23, 2020 · 1 comment
Open

Cannot get licensing information for addon #243

dasheck0 opened this issue Mar 23, 2020 · 1 comment

Comments

@dasheck0
Copy link

Hi,

I try to get my head around how to retrieve licensing information for a jira cloud plugin. In the atlassian reference I see that I can GET /rest/atlassian-connect/1/addons/{appKey} (see https://developer.atlassian.com/platform/marketplace/license-api-for-cloud-apps/).

However, I cannot find a suitable class or client for that request. Am I missing something? Thanks in advance for a reply.

Best regards!

@dasheck0
Copy link
Author

Fixed it myself. See the following code:

async getLicense(key: string): Promise<any> {
    // client is the jira client, which is initialized earlies with a valid jwt and secret
    return new Promise((resolve, reject) => {
      const uri = this.client.buildAbstractURL(`atlassian-connect/1/addons/${key}`);

      this.client.makeRequest({
        uri,
        method: 'GET',
        json: true,
        followAllRedirects: true
      }, (error, response) => {
        if (error) {
          reject(error);
        } else {
          resolve(response);
        }
      });
    });
  }

Should be easy to add it to the code. Do you accept pull requests?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant