使用须知
1. Base Url
| 环境 | 地址 |
|---|---|
| 开发环境 | https://openapi.test.fastmoss.com |
| 生产环境 | https://openapi.fastmoss.com |
2. request method
所有接口请求方式均为:POST
3. 公共参数
除了获取、刷新access_token外,其他接口都需要通过URL传递以下参数:
| 参数名 | 类型 | 说明 |
|---|---|---|
client_id | string | 客户端id |
access_token | string | access_token |
timestamp | timestamp[integer] | 时间戳 |
sign | string | 签名 |
signature_version | string | 签名 |
example
bash
curl 'https://openapi.test.fastmoss.com/test?client_id=xxx&access_token=xxx×tamp=xxx&sign=xxx&signature_version=2'4. 返回结果
所有接口返回结果均为json object格式。data字段为具体数据,是json object。
| 参数名 | 类型 | 说明 |
|---|---|---|
code | integer | 状态码 |
msg | string | 信息 |
data | object | 数据 |
request_id | string | 请求id |
timestamp | timestamp[integer] | 服务器时间戳 |
example
json
{
"code": 0,
"msg": "success",
"data": {
"xxx": "xxx"
},
"request_id": "xxxx",
"timestamp": 1690351112
}5. Http Status Code 和 code的关系
http status code和code不冲突code是具体业务的状态码- 应首先检查
http status code, 再检查code http status code为200时 且code为0时, 表示成功
code错误码说明
| 状态码 | 类型 | 描述 |
|---|---|---|
0 | 无异常 | 成功 |
10001 | 参数异常 | 参数不符合要求 |
20001 | 数据异常 | 资源不存在 |
30001 | 权限异常 | 无访问权限 |
30002 | 权限异常 | 数据条数限制 |
30003 | 权限异常 | 访问次数限制 |
40001 | 服务异常 | 服务异常 |