Sample - Create JWT Token for a ZAPI Cloud API

December 20, 2016

Problem

How to Generate a JWT Token

Solution

Sample code is provided for reference

  1. Code uses the ZAPI CLOUD Url shared via email for a JIRA cloud instance , Access Key and Secret Key of a Jira user.
  2. ZAPI CLOUD API to which the JWT token has to be generated and Jira userName
  3. Initializes the ZFJCloudRestClient . ZFJCloudRestClient sample is provided here.
  4. Gets the JwtGenerator from the client
  5. Generate JWT token using the generateJWT method
  6. Prints the final URL and JWT token which can be used with any browser REST client to make request.

Refer the link to download the sample 

ZAPI Cloud Interactive documentation: http://docs.zfjcloud.apiary.io/

Products: