API Routes

Jump to:

POST /users/{publicAddress}/nonce

Get the Bloq API authentication nonce for the given user.

This nonce has to be signed with the private key corresponding to the Ethereum 1.0 address representing the user and sent in the request.

The signature must be then sent by calling POST /auth to get the authentication token and complete the authentication flow.

Parameters

Sample request

curl -X POST https://api.bloq.com/users/0x0000000000000000000000000000000000000000/nonce

Response

Sample response

{
  "nonce": "Qd4b6cs9OUOEoXiSx"
}

POST /auth

Authenticate to the Bloq API and obtain the token required to call the rest of the API routes.

After obtaining the nonce by calling GET /users/{publicAddress}/nonce, that nonce has to be signed with the private key corresponding to the user's Ethereum 1.0 address and sent back to the API to complete the authentication flow.

Once validated, the API will issue a short-lived JWT to be used as proof of authentication with the rest of the API routes.

Parameters

Sample request

curl -X POST https://api.bloq.com/auth \
  -H 'Content-Type: application/json' \
  -d '{
    "address": "0x0000000000000000000000000000000000000000"
    "service": "stake",
    "signature": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "signedAt: "2022-07-11T18:23:22.513Z"
  }'

Response

Sample response

{
  "token": "xxxxxx.xxxxxxxxxx.xxxxxx"
}

Last updated