Authentication
To authenticate to the API, a JWT request token is encoded and sent as the jwt param in a POST to /auth/token. The access_token in the response is the JWT bearer token that is included as the Authorization value in the Header of all subsequent API calls.
If you do not have the 4 fields below available, see Create a Netography API Key.
Generating a JWT request token in code
[block:tutorial-tile] { "backgroundColor": "#018FF4", "emoji": "🦉", "id": "657c52c3a5434c00493811e0", "link": "https://docs.netography.com/v1.0/recipes/create-a-jwt-request-token", "slug": "create-a-jwt-request-token", "title": "Create a JWT request token" } [/block]
Generating a JWT request token in browser
To use API via the API reference pages here, you can create a JWT request token here, and then copy it to the jwt params field below.
[block:embed] { "html": false, "url": "https://jsfiddle.net/netography/rex57sb6/12/embedded/result,js,html", "provider": "jsfiddle.net", "href": "https://jsfiddle.net/netography/rex57sb6/12/embedded/result,js,html", "typeOfEmbed": "iframe", "height": "400px", "width": "100%", "iframe": true } [/block]
↕️ Copy and Paste the JWT request token string
To authenticate to the API on this page, you need to copy the token string from the JWT Request Token field directly above, and paste it into the jwt field directly below.
A JWT token encoded using your Accounts API Key Shared Secret.
asd8asd9f87ass...asdf9A JSON object which contains the access_token to use in all subsequent calls to the API
Access Token (JWT)
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI....KpQXk3fiwnSbREHlvfdi7weWuMSeconds until the Access Token expires
86400Seconds until the Refresh Token expires
86400Refresh Token (JWT)
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI....KpQXk3fiwnSbREHlvfdi7weWuMType of JWT token. Will always be "bearer"
bearerID Token (JWT)
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI....KpQXk3fiwnSbREHlvfdi7weWuMSeconds until the Token will be considered valid. Will always be 0 (now).
0Unique Session ID
9b4b13d7-c7a6-4f68-a419-cf1bf5aef94fApplication Scopes
openid email app_metadata user_metadata profileMissing or invalid credentials
Not Found
Unknown Error Occurred
POST /api/v1/auth/token HTTP/1.1
Host: api.netography.com
Content-Type: application/json
Accept: */*
Content-Length: 32
{
"jwt": "asd8asd9f87ass...asdf9"
}{
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI....KpQXk3fiwnSbREHlvfdi7weWuM",
"expires_in": 86400,
"refresh_expires_in": 86400,
"refresh_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI....KpQXk3fiwnSbREHlvfdi7weWuM",
"token_type": "bearer",
"id_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI....KpQXk3fiwnSbREHlvfdi7weWuM",
"not-before-policy": 0,
"session-state": "9b4b13d7-c7a6-4f68-a419-cf1bf5aef94f",
"scope": "openid email app_metadata user_metadata profile"
}Obtain an access_token via User Credentials
me@email.comA JSON object which contains the access_token to use in all subsequent calls to the API
Access Token (JWT)
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI....KpQXk3fiwnSbREHlvfdi7weWuMSeconds until the Access Token expires
86400Seconds until the Refresh Token expires
86400Refresh Token (JWT)
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI....KpQXk3fiwnSbREHlvfdi7weWuMType of JWT token. Will always be "bearer"
bearerID Token (JWT)
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI....KpQXk3fiwnSbREHlvfdi7weWuMSeconds until the Token will be considered valid. Will always be 0 (now).
0Unique Session ID
9b4b13d7-c7a6-4f68-a419-cf1bf5aef94fApplication Scopes
openid email app_metadata user_metadata profileMissing or invalid credentials
Unknown Error Occurred
POST /api/auth/bearer/token HTTP/1.1
Host: api.netography.com
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 49
"username='me@email.com'&password='password'"{
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI....KpQXk3fiwnSbREHlvfdi7weWuM",
"expires_in": 86400,
"refresh_expires_in": 86400,
"refresh_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI....KpQXk3fiwnSbREHlvfdi7weWuM",
"token_type": "bearer",
"id_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI....KpQXk3fiwnSbREHlvfdi7weWuM",
"not-before-policy": 0,
"session-state": "9b4b13d7-c7a6-4f68-a419-cf1bf5aef94f",
"scope": "openid email app_metadata user_metadata profile"
}Obtain a new access_token via a refresh_token
eyJhbGciOiJIUzI1NiIsInR5c...jUZ8Ud9wGCYilcqEML2fRkWZUA JSON object which contains the access_token to use in all subsequent calls to the API
Access Token (JWT)
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI....KpQXk3fiwnSbREHlvfdi7weWuMSeconds until the Access Token expires
86400Seconds until the Refresh Token expires
86400Refresh Token (JWT)
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI....KpQXk3fiwnSbREHlvfdi7weWuMType of JWT token. Will always be "bearer"
bearerID Token (JWT)
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI....KpQXk3fiwnSbREHlvfdi7weWuMSeconds until the Token will be considered valid. Will always be 0 (now).
0Unique Session ID
9b4b13d7-c7a6-4f68-a419-cf1bf5aef94fApplication Scopes
openid email app_metadata user_metadata profileWrong or expired refresh token, or user/api-key removed
Unknown Error Occurred
POST /api/auth/bearer/refresh HTTP/1.1
Host: api.netography.com
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 73
"refresh_token='eyJhbGciOiJIUzI1NiIsInR5c...jUZ8Ud9wGCYilcqEML2fRkWZU'"{
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI....KpQXk3fiwnSbREHlvfdi7weWuM",
"expires_in": 86400,
"refresh_expires_in": 86400,
"refresh_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI....KpQXk3fiwnSbREHlvfdi7weWuM",
"token_type": "bearer",
"id_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI....KpQXk3fiwnSbREHlvfdi7weWuM",
"not-before-policy": 0,
"session-state": "9b4b13d7-c7a6-4f68-a419-cf1bf5aef94f",
"scope": "openid email app_metadata user_metadata profile"
}Last updated