This page explains how to generate a JWT authentication token that is required to make requests to Zephyr for Jira Cloud REST API.
1. Generate an access and secret key.
Navigate to any project in Jira.
Navigate to the Zephyr section and click on “API keys” option.
Click on the Generate button and then copy both the access and secret key.
2. Get the AccountID for the user that is going to be authenticating.
The easiest way to retrieve the AccountID is to click on the icon on the left-hand menu and then click the Profile link. Within the URL, you can find your AccountID after the last “/”.
Another way to get your AccountID is to utilize the following URL in your browser.
3. Get the zephyrBaseURL (end point) for your instance.
Once all the above information is generated and gathered, you can provide the details in the code and generate the JWT token using the steps in the next section.
Generate a JWT token
1. Navigate to your GitHub URL and clone the project to your local machine.
2. Create a folder and the run the “git clone
https://github.com/zephyrdeveloper/zapi-cloud.git” from the command prompt to download the project.
3. Afterwards, import the project into Eclipse (or anything similar).
4. Once the project is configured in Eclipse, download the far file from the link below and add it to your project.
5. Right click on the Project(s), select Build Path, and then select Configure Build Path.
6. Select the Libraries tab, and then click on the Add External Jars button. Select and add the jar file that was just downloaded. Afterwards, click Apply and close.
7. Navigate to the sampleJwtGenerate.java file to generate the JWT token.
8. Fill in the information for the zephyrBase URL, accessKey, secretKey, accountID within the code for the java file and then run it to generate your JWT token.
How to use the JWT token and execute an API call in Postman
Provide the details in the Postman call.
1. Setup the API Call by change the type of API method and by providing the API URL.
2. Enable Authorization and then provide the JWT token that you generated from the previous section.
3. Enable zapiAccessKey and then provide the access key that you generated from the previous section.
4. Enter the contents for the body of the Postman API call.
5. Afterwards, click on send to execute the API call.