User management

Since all requests need to be authenticated, you’ll need to get a user token for each of your users.

Authentication token

The user’s authentication token will be returned for both register and login endpoints.

It has an expiration of 12 hours.

Register new user

Allow you to create new users.

HTTP request:

POST /register

Format: JSON

Body:

name type description
email string User’s email address
password string User’s password

Example:

curl -H "Content-Type: application/json" \
     -H "SB-PUBLIC-KEY: your-pub-key" \
     -X POST \
     -d '{"email": "new@user.com", "password": "userpw"}' \
     https://na1.staticbackend.com/register

Response:

"user's JWT"

Login user

Validate user by email and password to receive their id and session token.

HTTP request:

POST /login

Format: JSON

Body:

name type description
email string User’s email address
password string User’s password

Example:

curl -H "Content-Type: application/json" \
     -H "SB-PUBLIC-KEY: your-pub-key" \
     -X POST \
     -d '{"email": "new@user.com", "password": "userpw"}' \
     https://na1.staticbackend.com/login

Response:

"user's JWT"

In both examples, the user’s authentication token we would use for subsequent requests would be as follow:

HTTP header:

Authorization: Bearer user's JWT

This token will be valid for 12 hours.

Focus Centric inc. terms of service | privacy policy