远程数据
远程数据模块支持两类数据:远程变量(RemoteVar) 和 远程数据(RemoteData),均由开发者在控制台配置,客户端按 key 读取或操作。
GET /api/v1/af/remote_var — 获取远程变量
按 key 读取远程变量值。若变量设置了"需要登录",则必须传 token 和 card 参数。
请求参数(Query)
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
app_key | string | 是 | 软件 App Key |
key | string | 是 | 远程变量的 key |
card | string | 条件 | 变量要求登录时必填 |
token | string | 条件 | 变量要求登录时必填 |
nonce | string | 是 | 随机字符串 |
timestamp | number | 是 | Unix 时间戳(秒) |
sign | string | 是 | 请求签名 |
返回数据(result)
| 字段名 | 类型 | 说明 |
|---|---|---|
value | string | 远程变量的值 |
GET /api/v1/af/remote_data — 获取远程数据
按 key 读取远程数据内容。
请求参数(Query)
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
app_key | string | 是 | 软件 App Key |
key | string | 是 | 数据的 key |
nonce | string | 是 | 随机字符串 |
timestamp | number | 是 | Unix 时间戳(秒) |
sign | string | 是 | 请求签名 |
返回数据(result)
| 字段名 | 类型 | 说明 |
|---|---|---|
value | string | 数据内容 |
POST /api/v1/af/remote_data — 增/改/删远程数据
通过 action 参数指定操作类型:create(新建)/ update(修改)/ delete(删除)。
请求参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
app_key | string | 是 | 软件 App Key |
action | string | 是 | 操作类型:create / update / delete |
key | string | 是 | 数据的 key |
value | string | 条件 | action 为 create/update 时必填 |
nonce | string | 是 | 随机字符串 |
timestamp | number | 是 | Unix 时间戳(秒) |
sign | string | 是 | 请求签名 |
成功时 result 字段不存在。