Authentication


The most basic form of authentication is to perform a user login HTTPS request and receive a token in the response.

Send that token as a bearer token in the Authorization header on every request to the Nextspace API:

Authorization: Bearer <token>

The same header accepts a session token from a user login and a long-lived access token, so code that authenticates a request does not need to know which kind of token it holds.


Login

Request body
interface IPostBody {
    // Client Account ID.
    // This is your organization's ID.
    account: string;
    // Logic can be either your User ID, username, or email address.
    login: string;
    // Your user's password.
    password: string;
}
Response
interface IResponse {
    // This is your token.
    // Send it as "Authorization: Bearer <token>" on any request you make to the Nextspace API.
    ID: string;
    // User record associated with the login.
    User: {
        // The user's ID.
        ID: string;
        // The user's username.
        Login?: string;
        // The user's email address.
        Email?: string;
        // The user's full name.
        Fullname?: string;
    }
}
Javascript example

To invalidate the token, perform a logout HTTPS request authenticated with that same token.

Logout