Skip to content

查询余额接口 ​

接口概述 ​

用于查询当前用户的账户余额。

网络协议请求地址请求方法鉴权方式请求格式响应格式
HTTP/open-api/v1/balanceGETBearerapplication/jsonapplication/json

请求头(Headers) ​

参数名称值描述
Content-Typeapplication/json数据交换格式
AuthorizationBearer将{accessToken}替换为您上面接口获取的accessToken
json
Authorization: Bearer <accessToken>
Content-Type: application/json

请求参数(HTTP GET) ​

无

响应体(Response) ​

参数名称子字段类型描述
code-String错误码,具体见错误码表
datatotalBalanceDecimal总余额
msg-String具体错误信息
json
{
    "code": 200,
    "msg": "success",
    "data": {
        "totalBalance": 14.00
    }
}

错误码(Error Code) ​

错误码按照JSON structure返回,包括code和msg字段;随着版本更新,我们会扩展对应字段的值

json
{
    "code": 401,
    "data": {},
    "msg": "Unauthorized"
}

请求示例(Shell & Python) ​

Shell

shell
curl --location --request GET 'https://api.hitem3d.ai/open-api/v1/balance' \
--header 'Authorization: Bearer <accessToken>' \
--header 'Content-Type: application/json'

Python

python
import requests

url = "https://api.hitem3d.ai/open-api/v1/balance"

payload={}
headers = {
   'Authorization': 'Bearer <accessToken>',
   'Content-Type': 'application/json'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)