OkayAPI Docs
API Params
| Parameter | Type | Required | Default | Note | Description |
|---|---|---|---|---|---|
| HTTP_APPKEY | String | Required | MIN: 32 | Common Put Your APPKEY | |
| model_name | String | Required | Your table Model Name | ||
| logic | Enum | Optaion | and | Range: and/or | Where condition logic, logic=and for logical and, logic=or for logical or |
| where | ArrayJSON Format | Optaion | [["id", ">=", "1"]] | SQL WHERE condition, JSON format: [condition_1, condition_2, ...] EACH condition: ["FIELD", "OP", "COMPARE_VALUE"]
| |
| where_X | String | Optaion | 动态条件,优先于where的JSON数据,简化的where条件,更易使用但只支持部分比较符。条件格式:where_ + X(X要换成你的字段名) = 比较符(见下方) + 中横线(-) + 比较值。支持的比较符和示例如下:
||分割,如:where_year=GT-2000||LT-2020,表示year年份大于2020(logic=and或logic=or)小于2020。(where和where_X二选一,不可混用,以where_X优先) | ||
| field | String | Required | 待更新的字段,如:field=money,此字段必须为数值类型 | ||
| op | Enum | Required | Range: add/sub/mul/div | 运算符号,加:add,减:sub,乘:mul,乘:div | |
| number | String | Required | 待运算的数字,例如加多少,减多少,乘多少,除多少。必须为合法的数字,可以是小数 |
API Debug
| KEY | REQUIRED | VALUE |
|---|---|---|
| app_key | *Required | |
| model_name | *Required | |
| logic | Option | |
| where | Option | |
| field | *Required | |
| op | *Required | |
| number | *Required |
API Response
| KEY | Type | Description |
|---|---|---|
| err_code | Int | 状态操作码,0成功;1开发类错误,删除失败(表单不存在);2应用层规则拦截,拦截后可以小白开放平台查看日记 |
| err_msg | String | 错误提示信息,err_code非0时参考此提示信息 |
| update_rows | String | 本次更新的条数,没有更新时为0 |
HTTP Response Code
| HTTP Status Code | Description |
|---|---|
| Http Status = 200 | Success |
| Http Status = 400 | Illegal-Params |
| Http Status = 401 | Illegal-Token |
| Http Status = 402 | IP-Banned |
| Http Status = 404 | API-NOT-Exsits |
| Http Status = 406 | Illegal-APPKEY |
| Http Status = 407 | APPKEY-Expired-Out |
| Http Status = 408 | APPKEY-Busy |
| Http Status = 409 | Illegal-Sign |
| Http Status = 413 | API-Traffic-NOT-Enough |
| Http Status = 415 | API-LOCKED |
| Http Status = 500 | Internal-Server-Error |