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.

App login

post

Login the app to get the JWT according to the app_id and app_secret

Body
app_idstringRequired
app_secretstringRequired
Responses
200
auth token
application/json
post
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"
}
Name
Meaning
Param Type
Data Type
Required

app_id

The id of the app

body

string

app_secret

The secret of the app

body

string

Note: Each JWT is valid to call open APIs for one hour. Once the JWT is expired, users have to call Refresh JWT to get the new JWT.

Refresh JWT

Refresh JWT API helps users to get a new JWT of the specified app.

Refresh JWT

get

Obtain a new JWT

Header parameters
AuthorizationstringRequired

Bearer openapi_token

Responses
200
refreshed auth token
application/json
get
GET /v1/refresh_token HTTP/1.1
Host: api.nftrainbow.cn
Authorization: text
Accept: */*
{
  "expire": "text",
  "token": "text"
}
Name
Meaning
Param Type
Data Type

Authorization

Bearer Token

Header

string

Note: Each JWT is valid to call Refresh JWT for five hours. Once the JWT is expired, users have to call App Login to get JWT agian.

Last updated