RE:DREAMER
Search
K

Auth

Requirement You are required to show empowered by RE:DREAMER if you used our protocol in any part of your product.
empowered white
empowered black

Domain

  • Mainnet: mainnet-api.redreamer.io
  • Testnet: testnet-api.redreamer.io

GET /api/v1/auth/nonce

Get a nonce by given address.

Request Parameters

  • [Required] address: the address of user.

Response

200

{
"nonce": "72452fa3-dbc6-44ae-8108-1dfb7edc1582"
}

400, 500

{
"code": "ERROR_CODE"
}

Error Code

POST /api/v1/auth/login

Login to get JWT.

Request Body

{
"address": "0xb88b0776c6147d4da3056a16b20c2ddbdfb37275",
"signature": "0x8217b11a64c4f8ee2ef01cd46fea87bf5ea65a4c6907e303f6c11d5e5fd2441a6e5daf05e8a98af42efafd6824010d7dd6bdfe9bb35c128636f1db9ded35ddda1c"
}
  • signature: using ${address} ${nonce} to sign message.

Response

200

{
"refresh_token": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhZGRyZXNzIjoiMHg4NWI3Y2ExNjFjMzExZDlhNWYwMDc3ZDUwNDhjYWRmYWNlODlhMjY3IiwiZXhwIjoxNjUwNDMzNzY4LCJpYXQiOjE2NTAzNDczNjgsImlzcyI6InJlZHJlYW1lciIsInNjb3BlcyI6IiJ9.sMMuM0bCJjHs7DedWZd8w-2BWzovuBuCxgZwMW20TIwKSkrkue2T-9ecgW-8_TCsGoleiQa6DSDbQKq3_kQmjA",
"token": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhZGRyZXNzIjoiMHg4NWI3Y2ExNjFjMzExZDlhNWYwMDc3ZDUwNDhjYWRmYWNlODlhMjY3IiwiZXhwIjoxNjUwMzUwOTY4LCJpYXQiOjE2NTAzNDczNjgsImlzcyI6InJlZHJlYW1lciIsInNjb3BlcyI6IiJ9.WWjCMbpWkpbzQulgqOQz5JqnC1lTEFG2_CTeFW21A8q7AKeEI_l2_ptqiG7lpcOCmojFW_3Zi3VAimO1k214cw"
}
  • token: It will be expired after 1 hour.
  • refresh_token: If token is expired, you can use this to refresh without signature.

400, 500

{
"code": "ERROR_CODE"
}

Error Code

POST /api/v1/auth/refresh

Refresh JWT.

Request Body

{
"refresh_token": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhZGRyZXNzIjoiMHg4NWI3Y2ExNjFjMzExZDlhNWYwMDc3ZDUwNDhjYWRmYWNlODlhMjY3IiwiZXhwIjoxNjUwNDMzNzY4LCJpYXQiOjE2NTAzNDczNjgsImlzcyI6InJlZHJlYW1lciIsInNjb3BlcyI6IiJ9.sMMuM0bCJjHs7DedWZd8w-2BWzovuBuCxgZwMW20TIwKSkrkue2T-9ecgW-8_TCsGoleiQa6DSDbQKq3_kQmjA"
}

Response

200

{
"refresh_token": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhZGRyZXNzIjoiMHg4NWI3Y2ExNjFjMzExZDlhNWYwMDc3ZDUwNDhjYWRmYWNlODlhMjY3IiwiZXhwIjoxNjUwNDMzNzY4LCJpYXQiOjE2NTAzNDczNjgsImlzcyI6InJlZHJlYW1lciIsInNjb3BlcyI6IiJ9.sMMuM0bCJjHs7DedWZd8w-2BWzovuBuCxgZwMW20TIwKSkrkue2T-9ecgW-8_TCsGoleiQa6DSDbQKq3_kQmjA",
"token": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhZGRyZXNzIjoiMHg4NWI3Y2ExNjFjMzExZDlhNWYwMDc3ZDUwNDhjYWRmYWNlODlhMjY3IiwiZXhwIjoxNjUwMzUwOTY4LCJpYXQiOjE2NTAzNDczNjgsImlzcyI6InJlZHJlYW1lciIsInNjb3BlcyI6IiJ9.WWjCMbpWkpbzQulgqOQz5JqnC1lTEFG2_CTeFW21A8q7AKeEI_l2_ptqiG7lpcOCmojFW_3Zi3VAimO1k214cw"
}
  • token: It will be expired after 1 hour.
  • refresh_token: If token is expired, you can use this to refresh without signature.

400, 500

{
"code": "ERROR_CODE"
}

Error Code

Information

Posted: Apr 20, 2022