OkayAPI Docs
API Params
Parameter | Type | Required | Default | Note | Description |
---|---|---|---|---|---|
HTTP_APPKEY | String | Required | MIN: 32 | Common Put Your APPKEY | |
database | String | Optaion | super | 需要使用的数据库,super表示ntdata数据库 | |
table | String | Required | 需要批量插入哪张表,需要要传完整的表名,如,table=nt_fansdata | ||
query_field | String | Required | MIN: 1 | 需要根据哪个字段判断是否存在,必须要是表的唯一索引,或至少需要普通索引。如,query_field=fans_data | |
data | ArrayJSON Format | Required | MIN: 1;MAX: 1000 | 待批量插入或者更新的数据,格式为一个数组,使用JSON格式,每组的数据字段不一定需要相同,但query_field字段应包含在内。如,data=[待插入的数据1, 待插入的数据2, ……] |
API Debug
KEY | REQUIRED | VALUE |
---|---|---|
app_key | *Required | |
database | Option | |
table | *Required | |
query_field | *Required | |
data | *Required |
API Response
KEY | Type | Description |
---|---|---|
details | Array | 插入或更新的明细,方便开发调试查看。insert表示已插入,update表示已更新,error表示错误 |
stat.total | Int | 总条目数量 |
stat.insert | Int | 成功插入的数量 |
stat.update | Int | 成功更新的数量 |
stat.error | Int | 失败的数量 |
HTTP Response Code
HTTP Status Code | Description |
---|---|
Http Status = 200 | Success |
Http Status = 400 | 表示客户端参数错误 |
Http Status = 404 | 表示接口服务不存在 |
Http Status = 500 | 表示服务端内部错误 |