Introduction
Authentication
Authenticating with the Localize API is done using signed JSON Web Tokens (JWT). You can generate a JWT using your app secret and your app identifier. Your app identifier and your app secret can be generated by yourself in the API Integrations page(left sidebar in your customer page). As soon as you hit Create a secret you will receive both values, but please note that the secret will be hidden after you leave this page or press the Conceal button. Make sure to save it somewhere safe ⚠️ You can create several secrets, for example one per application.
If you have trouble with this, please contact our support
Create your access token
To authenticate to the Localize API you need the following:
- Your app identifier
iss - Your app secret
secret
Use your app secret to sign a JSON Web Token (JWT) with HS256, with your app identifier as the issuer (iss) and an expiration time (exp) in the payload.
1# Example in ruby
2
3require 'jwt'
4
5YOUR_APP_ID = "** Your app identifier **"
6YOUR_APP_SECRET = "** Your app secret **"
7
8payload = {
9 # JWT expiration time (keep it short, e.g. 10 minutes)
10 exp: 10.minutes.from_now.to_i,
11 # App identifier
12 iss: YOUR_APP_ID
13}
14
15jwt_token = JWT.encode(payload, YOUR_APP_SECRET, 'HS256')Then add it to your request header:
Authorization: jwt <JWT_TOKEN>