POST请求 #
url: /echart/dataset_api/
Content-Type: application/x-www-form-urlencoded
请求参数data #
{
"visitor":"xxx",
"token":"xxx",
"stamp":"xxxxx",
"type":"xxx",
"ds":[["A","B"],["a1","b1"],["a2","b2"]],
"update":0
}
参数说明 #
visitor: 用户名
type: 接口数据集ID
stamp: 时间戳(1970年1月1日到生成时间的毫秒数)
token: 采用sha1加密, token=SHA1(秘钥 + stamp + visitor + type)
update: 0表示新增, 1表示数据更新
ds: 二维数组 或 参考数据填报或数据更新的格式要求
“秘钥"即管理员在API服务设定中的"token”
返回格式 #
{
"status": 200,
"msg": "success"
}
接口配置 #
- 新建数据集
- 写入相关配置
dataset={
"table":"表名(字段1,字段2....)",
"preSql":["truncate table abc"],
"postSql":["insert into xxx select ...."]
}
- 相关权限管理参考“数据服务设定”