JWTs (auth tokens)
JSON web tokens are a signed JSON object sent in the Authorization header in all requests towards the API. Once users log in, they receive a JWT (referred to here as auth_token
s) allowing them to access APIs that are permitted with that token. The following example shows how an auth_token
is included in the Authorization
request header (the “Bearer” type) when creating a new user:
POST https://cdn.emnify.net/api/v1/user
Request header
Authorization: Bearer kNTktNTA1My00YzdhLT...
Request body
{
"username": "myuser@example.com",
"name": "New User"
}
Important: An auth_token
shouldn’t be confused with an application_token
. Application Tokens are long-lived tokens that are sent in a POST request body to retrieve an auth_token
instead of using a user and password combination.