NFTRainbow
NFTRainbow 控制台GithubWhat's an NFT?
  • NFTRainbow - NFT 彩虹桥 🌈🌉🦄
  • Tutorials
    • Mints
      • 铸造NFT快速指南
    • Interactive Flowchart
    • By Community
      • NFTRainbow 使用教程
    • Account Solutions
    • Guides
      • 控制台合约代付设置
      • 元数据管理
      • Rainbow 铸造工具简介
  • Docs
    • FAQs
    • Changelog
    • RoadMap
    • Conflux Sponsor
    • Terminology
    • Prices
  • Products
    • Conflux RPC Bridge
    • ERC-6551
    • Web3 Services
  • API Reference
    • Open-API
      • Login
      • Files
      • Metadata
      • Contract
      • Mints
      • Transfers
      • Transaction
      • NFT
      • Burns
    • Swagger-Doc
    • Postman Collection
    • SDKs
      • Go-SDK
    • Common Errors
  • ABOUT THE APIs
    • Authentication
    • Error codes
    • Quotas and rate limits
Powered by GitBook
On this page
  1. API Reference
  2. Open-API

Login

Rainbow-APIs is based on JWT. In order to use the open APIs, login APIs provide us entries to get the JWT.

PreviousOpen-APINextFiles

Last updated 1 year ago

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.

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

{
    "app_id": "qUUcdueA",
    "app_secret": "zGCaP8kAFEmwanqo"
}

The returned result can be used to access other OPEN-APIs

Name
Meaning
Type

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.

Name
Meaning
Param Type
Data Type

Authorization

Bearer Token

Header

string

Name
Meaning
Type

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'

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

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

Refresh JWT
Refresh JWT
App Login

Refresh JWT

get

Obtain a new JWT

Header parameters
AuthorizationstringRequired

Bearer openapi_token

Responses
200
refreshed auth token
application/json
401
Unauthorized
application/json
get
GET /v1/refresh_token HTTP/1.1
Host: api.nftrainbow.cn
Authorization: text
Accept: */*
{
  "expire": "text",
  "token": "text"
}
  • Login actions
  • App Login
  • POSTApp login
  • Refresh JWT
  • GETRefresh JWT

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
401
Unauthorized
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"
}