Get auth token
POST
/authenticate/userpasshmac
const url = 'https://api.colourbox.com/authenticate/userpasshmac';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"username":"example","password":"example","key":"example","ts":1,"hmac":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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
Request Bodyrequired
Section titled “Request Bodyrequired”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"}Responses
Section titled “Responses”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}