登录认证

POST /api/v1/auth

  • 说明: 通过"addressAuthToken" 换取 “unifiedAuthToken",unifiedAuthToken的有效期为7天。

  • Header

Field
Type
Remarks

ApiKey

String

I-Authorization

String

Bearer ${addressAuthToken},其中addressAuthToken通过JS-SDK请求签名认证获取

  • Request Parameters

Field
Type
Remarks

inviteCode

String

邀请码或邀请人的relationId

  • Request Example

POST /api/v1/auth
curl  POST 'https://api.relationlabs.ai/api/v1/auth' \
--header 'I-Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ9.eyJleHAiOjE2NzA4ODk0NDEsImlhdCI6MTY2MDgwOTQ0MSwiaXNzIjoicmVsYXRpb25sYWJzLmFpIiwic3ViIjoiMHgxZTU2MmFhYzRiZWFjNDUwYWI5OGQzNzlhYjBkMWQxYjQ0YzMyNWIzIi1id2FsbGV0TmFtZSI6Im1ldGFtYXNrIiwiY2hhaW5OYW1lIjoiZXRoIn0.2wFJmR2D3inHMItBugoaVE3MOSLnG1ylJEyU38WU0GgLIqajhzvcYYHC5ah3r7-FFBhbWGk9WW3KxN_h5K1zZA' \
--header 'ApiKey: <ApiKey>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "inviteCode":"d4swz-zaaaa-aaaaj-at5fa-cai"
}'
  • Response Parameters

Field
Type
Remarks

code

String

返回码

desc

String

返回信息

data

T

数据

The Data field consists of the following subfields:

Field
Type
Remarks

token

String

unifiedAuthToken, 其他接口的Authorization= Bearer ${unifiedAuthToken}

  • Response Example

{
  "code": "0",
  "desc": "success",
  "data": {
    "token": "eyJhbGciOiJFUzI1NiJ9.eyJqdGkiOiJiOTE5N1Y1OGJmYTY0NDRlYmU2ODA1OTc2MmViNzdlZSIsImlzcyI6InJlbGF0aW9ubGFicy5haSIsImlhdCI6MTY2MDgyNDM0MSwic3ViIjoiYmFmMzQta2lhYWEtYWFhYWstYWNnamEtY2FpIiwiZXhwIjoxNjYxNDI5MTQxfQ.Y_1NR0N3NgQCzaR1owS6Ga4AbOIfvH7ucZJJ9-HUK_FrXBtG_WjTa3XNDfmHZIwCFDOzAjSHNcRdDaR0NZGUIw"
  }
}
  • Return Code

code
desc
Remarks

0

success

接口调用成功

Last updated