Login
Rainbow-APIs is based on JWT. In order to use the open APIs, login APIs provide us entries to get the JWT.
Login actions
Login actions provide users the entries to call the open APIs including Metadata, Mints, Contract, Files.
App Login
APP login API helps users to get the JWT according to app_id and app_secret. JWT can be used to access other open APIs.
Login the app to get the JWT according to the app_id and app_secret
auth token
Unauthorized
POST /v1/login HTTP/1.1
Host: api.nftrainbow.cn
Content-Type: application/json
Accept: */*
Content-Length: 37
{
  "app_id": "text",
  "app_secret": "text"
}{
  "expire": "text",
  "token": "text"
}app_id
The id of the app
body
string
app_secret
The secret of the app
body
string
{
    "app_id": "qUUcdueA",
    "app_secret": "zGCaP8kAFEmwanqo"
}The returned result can be used to access other OPEN-APIs
token
JWT token
String
expire
The expired time
String
{
    "expire": "2022-08-31T15:54:04.2046805+08:00",
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2NjE5MzI0NDQsImlkIjozLCJvcmlnX2lhdCI6MTY1OTM0MDQ0NH0.BLkzyiQzxlljYLj5Gjjqjnd4fFm1GdoEduaVrVlU_Tw"
}curl --request POST \
  --url https://api.nftrainbow.cn/v1/login \
  --header 'Content-Type: application/json' \
  --data-raw `{
    "app_id": "qUUcdueA",
    "app_secret": "zGCaP8kAFEmwanqo"
}`Refresh JWT
Refresh JWT API helps users to get a new JWT of the specified app.
Obtain a new JWT
Bearer openapi_token
refreshed auth token
Unauthorized
GET /v1/refresh_token HTTP/1.1
Host: api.nftrainbow.cn
Authorization: text
Accept: */*
{
  "expire": "text",
  "token": "text"
}Authorization
Bearer Token
Header
string
token
JWT token
String
expire
The expired time
String
{
    "expire": "2022-08-31T15:54:04.2046805+08:00",
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2NjE5MzI0NDQsImlkIjozLCJvcmlnX2lhdCI6MTY1OTM0MDQ0NH0.BLkzyiQzxlljYLj5Gjjqjnd4fFm1GdoEduaVrVlU_Tw"
}curl --request GET \
  --url https://api.nftrainbow.cn/v1/refresh_token \
  --header 'Authorization: Bearer {JWT}' \
  --header 'Content-Type: application/json'Last updated