iFormBuilder API Code Samples
What is a JWT?
A JWT, or JSON Web Token, is a JSON-based open standard (RFC 7519) for creating access tokens that assert some number of claims.
What is a simple way to create a JWT?
If you are having trouble creating a JWT, the example below can help you get started quickly.
STEP 1. Click on this link http://jwt.io/
STEP 2. Copy the JSON in bold below into the blue "Decoded" section.
- Replace "iss" with your client key from the API Apps section.
- Replace (company name) in the "aud" parameter with your private server URL.
- Replace "exp" with current unix time +5 minutes
- Replace "iat" with current unix time
STEP 3. Copy the Secret from the API Apps into the Secret section in the interface below.
STEP 4. Copy the Encoded value from the screenshot below and use this for your assertion parameter.
STEP 5. Using a REST client like POSTman, you need to send a request like the one below. Replace the "XXXXX" in the URL with your private DB name. The following two parameters are also required.
Grant type will always be equal to "urn:ietf:params:oauth:grant-type:jwt-bearer", and your assertion is the value you copied from step 4.
PLEASE NOTE: Double check to ensure there are no spaces at the end or the beginning of your assertion.
Set your for request type to POST, and make sure the parameters are "www-form-urlencoded" and hit send. If everything has been setup correctly you will get an access token returned in the response.
PLEASE NOTE: The most common mistake is switching the IAT and EXP values or waiting too long and the time window expires.