跳到主要内容

用户信息

POSThttps://open.debox.pro/openapi/user/info

获取某个用户基础信息,POST请求方式,用access_token做鉴权
该接口配合登录授权使用、授权完成后,用获得的access_token和user_id请求本接口获取用户的基础信息,如昵称、头像、钱包地址等。
使用示例:

curl --location --request POST 'https://open.debox.pro/openapi/user/info?user_id=lx....' \
--header 'access_token: eyJhxxCJ9.eyxxJ9.hWxxQ'

Parameters

Query

user_id : String 在登录授权获得的user_id

access_token : String 登录授权阶段获得的用户access_token

Responses

200: OK
{
"code": 1,
"data": {
"name": "ltx", // 用户昵称
"wallet_address": "0xsadf......34df", // 钱包地址
"avatar": "https://data.debox.space/nfts/0x67a7f09c/699-1.png",// 头像地址
"uid": "fxidfef4" // 用户id和 user_id一样
"level": 3, // 用户等级
"level_icon": "https://data.debox.space/nfts/0x67a7f09c/699-1.png", // 用户等级图片

},
"message": "成功",
"success": true
}

GEThttps://open.debox.pro/openapi/user/info

获取某个用户基础信息,GET请求方式,用X-API-KEY做鉴权,是POST方式的简化版,此接口未来会废弃,使用示例:

curl -X GET -H "X-API-KEY: t2XAlEF6......" \
"https://open.debox.pro/openapi/user/info?user_id=uvg2p6ho"

Parameters

Header

app_id : String 应用唯一标识,在DeBox开放平台申请

X-API-KEY : String 开发者 API Key,在DeBox开放平台获取

nonce : String 随机数字,长度 8 位

timestamp : String 时间戳,精确到毫秒

signature : String 签名,需严格按照下方的签名计算规则计算

  • 签名计算规则:
    // 顺序必须必须严格按:appsecret -> nonce -> timestamp
    signature = SHA1({appsecret}{nonce}{timestamp})
  • 签名计算需要用与 X-API-KEY 对应的开发者 App Secret 对随机数和时间戳进行签名
  • appsecret: 开发者 App Secret,在DeBox开放平台获取
Query

user_id : String 用户的userid。在登录授权时可以获得授权用户的userid

Responses

200: OK
{
"code": 1,
"data": {
"name": "ltx", // 用户昵称
"wallet_address": "0xsadf......34df", // 钱包地址
"avatar": "https://data.debox.space/nfts/0x67a7f09c/699-1.png",// 头像地址
"uid": "fxidfef4" // 用户id和 user_id一样
"level": 3, // 用户等级
"level_icon": "https://data.debox.space/nfts/0x67a7f09c/699-1.png", // 用户等级图片

},
"message": "成功",
"success": true
}

GEThttps://open.debox.pro/openapi/user/followers

被关注列表。获取开发者账号绑定的DeBox用户的被关注列表,即关注开发者的用户列表:

curl -X GET -H "X-API-KEY: t2XAlEF6......" \
"https://open.debox.pro/openapi/user/followers?page=1&size=20"

Parameters

Header

app_id : String 应用唯一标识,在DeBox开放平台申请

X-API-KEY : String 开发者 API Key,在DeBox开放平台获取

nonce : String 随机数字,长度 8 位

timestamp : String 时间戳,精确到毫秒

signature : String 签名,需严格按照下方的签名计算规则计算

  • 签名计算规则:
    // 顺序必须必须严格按:appsecret -> nonce -> timestamp
    signature = SHA1({appsecret}{nonce}{timestamp})
  • 签名计算需要用与 X-API-KEY 对应的开发者 App Secret 对随机数和时间戳进行签名
  • appsecret: 开发者 App Secret,在DeBox开放平台获取
Query

page : Numeric 分页查询的页数

size : Numeric 分页查询每页的大小

Responses

200: OK
{
"code": 1,
"data": [
{
"name": "zhang3",
"wallet_address": "0x22b15300cf8...2562bea2",
"avatar": "https://data.debox.pro/.../headimg.png",
"uid": "0mb...bc"
},
{
"name": "Lee4",
"wallet_address": "0xb63219a8e0d3...f2cd459f",
"avatar": "https://data.debox.pro/.../headimg.png",
"uid": "xq6...pg"
}
],
"message": "success",
"success": true
}

POST https://open.debox.pro/openapi/user/followers

被关注列表。即授权用户的粉丝,POST请求方式,用access_token做鉴权
使用示例:

curl --location --request POST 'https://open.debox.pro/openapi/user/followers?user_id=lx...' \
--header 'access_token: eyJhbGciOi...'

Parameters

Query

user_id : String 在登录授权获得的user_id

page : Numeric 分页查询的页数

size : Numeric 分页查询每页的大小

Header

access_token : String 登录授权阶段获得的用户access_token

Responses

200: OK
{
"code": 1,
"data": [
{
"name": "zhang3",
"wallet_address": "0x22b15300cf8...2562bea2",
"avatar": "https://data.debox.pro/.../headimg.png",
"uid": "0mb...bc"
},
{
"name": "Lee4",
"wallet_address": "0xb63219a8e0d3...f2cd459f",
"avatar": "https://data.debox.pro/.../headimg.png",
"uid": "xq6...pg"
}
],
"message": "success",
"success": true
}

GEThttps://open.debox.pro/openapi/user/is_follow

查询某用户是否关注另一个用户,使用示例:

curl -X GET -H "X-API-KEY: t2XAlEF6......" \
"https://open.debox.pro/openapi/user/is_follow?\
walletAddress=0x2267......&chain_id=1&followAddress=0xB63219a8E0D367d87BA1c8B0736CbfDbf2cD459F"

Parameters

Header

app_id : String 应用唯一标识,在DeBox开放平台申请

X-API-KEY : String 开发者 API Key,在DeBox开放平台获取

nonce : String 随机数字,长度 8 位

timestamp : String 时间戳,精确到毫秒

signature : String 签名,需严格按照下方的签名计算规则计算

  • 签名计算规则:

    // 顺序必须必须严格按:appsecret -> nonce -> timestamp
    signature = SHA1({appsecret}{nonce}{timestamp})
  • 签名计算需要用与 X-API-KEY 对应的开发者 App Secret 对随机数和时间戳进行签名

  • appsecret: 开发者 App Secret,在DeBox开放平台获取

    Query

    walletAddress : 关注者的钱包地址

    followAddress : 被关注者的钱包地址

    Responses

    200: OK
    {"case3702":false}
    400: Bad Request
    {"error":"Bad Request","code":400,"message":"You X-API-KEY is not available"}
    401: Unauthorized
    {"error":"Bad Request","code":401,"message":"Param error"}