Using HTTP Basic Authentication to provide username (ID or email) and password, this resource retrieves an Account Access Token to be passed to other Accounts API functions, for their authentication. The token expires after 12 hours and a new token may be generated at any time.
Responses
Status
Meaning
Description
Schema
200
Successful operation
Inline
Example responses
200 Response
{
"accessToken": "xxxxxx.xxxxxxxxxx.xxxxxx"
}
Code sample
# Using user email
curl -u email@example.com:password -X POST https://accounts.bloq.cloud/auth
# Using user ID
curl -u user-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx:password -X POST https://accounts.bloq.cloud/auth
POST /auth/token
This endpoint provides a Client Access Token and a Client Refresh Token, these tokens are used to interact with cloud services like Nodes.
The Client Access Token expires after one hour and the Client Refresh Token expires after one year. The refresh access token is used to create new client access tokens.
Body parameter to create an Access and Refresh token using clientCredentials as grant type
# Using Client Credentials Grant Type
curl -X POST https://accounts.bloq.cloud/auth/token \
-H 'Content-Type: application/json' \
-d '{
"grantType": "clientCredentials",
"clientId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"clientSecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}'
# Using Refresh Token Grant Type
curl -X POST https://accounts.bloq.cloud/auth/token \
-H 'Content-Type: application/json' \
-d '{
"grantType": "refreshToken",
"refreshToken": "xxxxxx.xxxxxxxxxx.xxxxxx"
}'
POST /users/me/client-keys
This resource creates a new client key pair. The key pair is used to generate a Client Access Token, these access token are used to interact with cloud services like Nodes API. To access this endpoint an Account Access Token must be provided as Bearer token in the authorization header.