Authentication
Last updated
Last updated
All endpoints under the Nebula Block API require user authentication to validate a user's identity and to know whose resources to access/create/alter/delete. For authentication, there are two options:
Regardless of the method, Bearer authentication is used and requires the following header be specified in an HTTP request:
Access tokens are obtained by logging in with a username and password via the , and retrieving the jwtToken
field in the response body. Once obtained, the following authorization header can be specified in each request:
For example:
NOTE: Access tokens expire after 2 hours, in which case you need to log in again to get a new access token
API keys can also be used to authenticate requests. The benefit of using an API key is that there is no expiration date, so you can use them without authenticating often. To learn how to create and manage API keys, see the . Once an API key is obtained, the following authorization header can be specified in each request:
For example:
INFO: API keys are always prefixed with
ak_
. The prefix is how they are differentiated from access tokens.
POST
{API_URL}/login
username
Required
string
Login username/email
password
Required
string
Login password
dict
A dictionary that contains the access token (jwtToken
)
string
Indicates the result of the request to log in. success
signifies success, while failed
indicates an error.
string
A description of the status of the request.