Skip to content

Get auth token

POST
/authenticate/userpasshmac
curl --request POST \
--url https://api.colourbox.com/authenticate/userpasshmac \
--header 'Content-Type: application/json' \
--data '{ "username": "example", "password": "example", "key": "example", "ts": 1, "hmac": "example" }'

This resource lets you exchange the user’s username and password with a valid HMAC into an auth-token

Media typeapplication/json
object
username
required

Username

string
password
required

Password connected to the username

string
key
required

API Key

string
ts
required

Current UNIX timestamp

integer
hmac
required

HMAC hash

string

Example generated

{
"username": "example",
"password": "example",
"key": "example",
"ts": 1,
"hmac": "example"
}

The auth-token

Media typeapplication/json
object
token

An auth-token for request authorization

string
type

The type of token you have received. This will always be 1 for a user, meaning that the auth-token is bound to a specific user

integer
ownerIdentifier

The user-ID in Colourbox

integer
validUntil

The time to live for the auth-token (UNIX time stamp)

integer

Example generated

{
"token": "example",
"type": 1,
"ownerIdentifier": 1,
"validUntil": 1
}