REST APIs

This page is about OKR for Jira Cloud. Using Data Center? Click here.

REST API provides a convenient way to integrate your OKR data with external tools and workflows. This documentation outlines the process for generating an API token, authenticating requests, and using the available methods to interact with your OKR data.

Generating an API token

  1. From the Jira top bar, navigate to Apps > OKR for Jira.

  2. From the app side menu, click Settings > API.

    image-20240215-163711.png
  3. Click the Generate new token button in the top right corner of the page.

  4. Give the token a name and click Create.

  5. Copy the generated API token and store it securely, as you won't be able to retrieve it later.

Authentication

All requests made to the OKR for Jira API require authentication using your generated API token. This is achieved by including an API-Token header in your requests. If the header is not present, you will receive a “400 Bad Request” response.

Please make sure you use API-Token header, not the Authentication header.

API administrator table

OKR for Jira enables you to oversee all API tokens created within your organization. Users with the API_ADMIN_TABLE_ACCESS permission have access to an expanded view on the API settings page. The API administrator table allows you to see, rename, or revoke any token within your organization.

image-20240215-164943.png

API response

All API fetch methods return the same JSON object structure. The presented data depends on your query parameter.

{ "okrs": [ { "id": "5fda249d289742000406b3e4", "key": "O-2", "name": "Become more mature company", "description": "<p>This quarter we will be focusing on improving our performance.</p><p></p>", "parentObjectiveId": null, "ownerAccountId": "5c12ad9fd3af3b1ccfecbf55", "collaboratorAccountIds": [], "percentDone": 8.333333333333332, "created": "2020-12-16T15:15:41+0000", "startDate": "2021-01-01T00:00:00+0000", "deadline": "2021-03-31T23:59:59+0000", "labelIds": [], "teamIds": [], "krIds": [ "605480b190c42b0003385170", "6061e921e2f4470003bc3210" ], "childObjectiveIds": [ "5fdb72c63d2cf000035ceb37", "60743135b347480003dc6a9c", "61f9367df9aa7f0e4024a6fe" ], "latestUpdate": { "entityId": "5fda249d289742000406b3e4", "status": "ON_TRACK", "created": "2021-05-05T12:15:14+0000", "value": null, "description": "" }, "periodAliasId": "602a6a2717378700039f342a", "weight": 0 } ], "krs": [ { "id": "5fda249d289742000406b3e5", "key": "KR-2", "name": "adda", "description": null, "parentObjectiveId": "5fdb72c63d2cf000035ceb37", "issueIds": [ "10003" ], "ownerAccountId": "5c12ad9fd3af3b1ccfecbf55", "collaboratorAccountIds": [], "percentDone": 0.0, "created": "2020-12-16T15:15:41+0000", "startDate": "2021-01-05T00:00:00+0000", "deadline": "2021-03-28T00:59:59+0000", "labelIds": [], "teamIds": [], "periodAliasId": null, "latestUpdate": { "entityId": "61c993aaa0fd9b768a0fb47d", "status": "AT_RISK", "created": "2021-12-27T10:21:30+0000", "value": 0.0, "description": null }, "unit": null, "currentProgressDefinition": { "type": "STANDARD", "startValue": 0.0, "desiredValue": 22.0, "jql": null }, "weight": 1 } ], "teams": [ { "id": "605df77c6e53750003068c7d", "name": "lets go!" } ], "periods": [ { "id": "602a6a2717378700039f342a", "name": "Q1 Y2021", "startDate": "2021-01-01T00:00:00+0000", "deadline": "2021-03-31T23:59:59+0000" } ], "labels": [ { "id": "611a18f6c385f85c13ac860a", "name": "Research" } ] }

API methods

The OKR for Jira API provides several methods for retrieving, updating, and managing your OKR data. These methods are categorized into: