How to generate the JWT token
More details about JWT tokens can be found here.
JWT (or JSON Web Token) is a token that you can generate from your payload and that provides an easy way to transmit information between parties securely.
You can generate one by using jwt libraries https://jwt.io/libraries. Then, pass a header value that contains information on how to encode the data, as well as a payload that contains your data.
The token header should contain the following information:
alg: this is the signing algorithm to use. For your request to Coda, always use HS256
typ: this is the type of token you want to generate. For your request to Coda, always use “JWT”.
The token payload should contain the following information:
partner_id: This is the partner id provided to you by Coda
iat: Token creation Time on UTC timezone
Please note that the generated token should be available for 5 minutes.
Note: This is the token header that will be used to generate the authorization, not the header of your request to Coda. Do not expose the partnerId in the header of your request to Coda.
Example
Header: Algorithm and Secret
{
"alg":"HS256",
"typ":"JWT",
}JWT token: Payload: data
The payload is also used to generate JWT tokens.
To generate a JWT, you can first encode the token header and the payload, then generate a signature from your Client Secret and assemble them:
Last updated
Was this helpful?