Authentication

via API Key

post

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.

Body
jwtstringRequired

A JWT token encoded using your Accounts API Key Shared Secret.

Example: asd8asd9f87ass...asdf9
Responses
200

A JSON object which contains the access_token to use in all subsequent calls to the API

application/json
post
/api/v1/auth/token

via User Credentials

post

Obtain an access_token via User Credentials

Body
usernamestringRequiredExample: [email protected]
passwordstring · passwordRequired
Responses
200

A JSON object which contains the access_token to use in all subsequent calls to the API

application/json
post
/api/auth/bearer/token

via Refresh Token

post

Obtain a new access_token via a refresh_token

Body
refresh_tokenstringRequiredExample: eyJhbGciOiJIUzI1NiIsInR5c...jUZ8Ud9wGCYilcqEML2fRkWZU
Responses
200

A JSON object which contains the access_token to use in all subsequent calls to the API

application/json
post
/api/auth/bearer/refresh

Last updated