Comment on page
Accounts API
This Accounts API reference guide describes the endpoints to access Bloq Accounts services.
Jump to:
This resource verifies a new created user by User Id and verification token.
Name | In | Type | Required | Description |
---|---|---|---|---|
userId | path | string | true | none |
token | path | string | true | verification token sent via email |
Status | Meaning | Description |
---|---|---|
200 | Successful operation |
curl -X PUT https://accounts.bloq.cloud/users/user-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/token/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
This resource fetches the user profile information.
Status | Meaning | Description | Schema |
---|---|---|---|
200 | Successful operation | Inline |
200 Response
{
"displayName": "Example User",
"entityType": "individual",
"verifiedAt": "2020-04-24T20:01:55.634Z",
"updatedAt": "2020-04-24T20:01:55.634Z",
"billingAddress": {
"country": "US",
"zipCode": "12345",
"address": "123 Abc Street",
"state": "CA"
},
"createdAt": "2020-04-24T19:57:48.878Z",
"email": "[email protected]",
"id": "user-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
curl -X GET https://accounts.bloq.cloud/users/me \
-H 'Authorization: Bearer <AUTH_TOKEN>'
This resource updates a user password.
Body parameter
{
"oldPassword": "Old Password...",
"newPassword": "New Password..."
}
Name | Type | In | Required | Description |
---|---|---|---|---|
body | object | body | true | none |
» oldPassword | string | body | true | none |
» newPassword | string | body | true | none |
Status | Meaning | Description | Schema |
---|---|---|---|
200 | Successful operation | Inline |
curl -X PUT https://accounts.bloq.cloud/users/me/password \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <AUTH_TOKEN>' \
-d '{
"oldPassword": "Old Password...",
"newPassword": "New Password..."
}'
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.Status | Meaning | Description | Schema |
---|---|---|---|
200 | Successful operation | Inline |
200 Response
{
"accessToken": "xxxxxx.xxxxxxxxxx.xxxxxx"
}
# Using user email
curl -u [email protected]: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
This endpoint provides a
Client Access Token
and a Client Refresh Token
, these tokens are used to interact with cloud services like Connect and 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 usingclientCredentials
as grant type
{
"grantType": "clientCredentials",
"clientId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"clientSecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
Body parameter to create an access token using refreshToken as grant type
{
"grantType": "refreshToken",
"refreshToken": "xxxxxx.xxxxxxxxxx.xxxxxx"
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | Successful operation | Inline |
200 Response
{
"accessToken": "xxxxxx.xxxxxxxxxx.xxxxxx",
"refreshToken": "xxxxxx.xxxxxxxxxx.xxxxxx"
}
# 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"
}'
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 Connect API and Nodes. To access this endpoint an Account Access Token
must be provided as Bearer token in the authorization header.Status | Meaning | Description | Schema |
---|---|---|---|
200 | Successful operation | Inline |
200 Response
{
"clientId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"clientSecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"createdAt": "2020-04-24T20:35:22.808Z"
}
curl -X POST https://accounts.bloq.cloud/users/me/client-keys \
-H 'Authorization: Bearer <AUTH_TOKEN>'
This resource fetches Client Keys
Status | Meaning | Description | Schema |
---|---|---|---|
200 | Successful operation | Inline |
200 Response
[
{
"id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"createdAt": "2019-03-11T13:58:53.151Z"
},
{
"id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"createdAt": "2019-03-08T19:28:00.538Z"
}
]
curl -X GET https://accounts.bloq.cloud/users/me/client-keys \
-H 'Authorization: Bearer <AUTH_TOKEN>'
This resource removes a Client Key by ID
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | string | true | Key ID |
Status | Meaning | Description | Schema |
---|---|---|---|
204 | Successful operation | Inline |
curl -X DELETE https://accounts.bloq.cloud/users/me/client-keys/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx \
-H 'Authorization: Bearer <AUTH_TOKEN>'
This resource fetches the user events
Status | Meaning | Description | Schema |
---|---|---|---|
200 | Successful operation | Inline |
200 Response
[
{
"service": "cloud-accounts",
"output": {
"startTime": "2020-04-24T19:57:48.988Z",
"endTime": "2020-04-24T19:57:49.065Z",
"httpStatusCode": 200,
"bytesOut": 385
},
"serviceData": {},
"user": "user-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"input": {},
"createdAt": "2020-04-24T19:57:49.093Z",
"id": "event-bfe91423-8b6b-44d1-a264-483aab8a7f0d"
},
{
"service": "cloud-accounts",
"output": {
"startTime": "2020-04-24T20:00:34.581Z",
"endTime": "2020-04-24T20:00:35.057Z",
"httpStatusCode": 401,
"bytesOut": 0
}
}
]
curl -X GET https://accounts.bloq.cloud/users/me/events \
-H 'Authorization: Bearer <AUTH_TOKEN>'
Last modified 4mo ago