OkayAPI Docs


API Path: /api/App/Table/MultiFreeChangeNumber

API Description: Patch U 可The value of one or more fields can be modified IN BATCHES according to multiple customized conditions (AND or OR), which can be increased or decreased. Note that this API can update multiple data rows.

2
API Traffic
HTTP/HTTPS
Protocol
GET/POST
Method
UTF-8
Charset
JSON
Response

API Debug   


API Params

ParameterTypeRequiredDefaultNoteDescription
HTTP_APPKEYStringRequiredMIN: 32Common Put Your APPKEY
model_nameStringRequiredYour table Model Name
logicEnumOptaionandRange: and/orWhere condition logic, logic=and for logical and, logic=or for logical or
wheresArrayJSON FormatRequired批量条件,格式为:wheres=[第一组,第二组,……]。每一组where参数格式如下: SQL WHERE condition, JSON format: [condition_1, condition_2, ...]

EACH condition: ["FIELD", "OP", "COMPARE_VALUE"]
  • FIELD: Table field name;
  • OP: such as >、>=、<、<=、<>、!=、EQ、GT、GE、LT、LE、NE、LIKE、NLIKE、IN、NIN、BETWEEN、NBETWEEN
  • COMPARE_VALUE: The values that need to be compared, the format of the comparison value will be different. If the field is a numeric type, pass the numeric type, not a string.
Example: logic=and, where=[["id",">",9],["id","<=",10]], It means: id > 9 AND id <= 10
change_fieldArraySeperated with ,Required待修改数值的字段名,多个字段名用英文逗号分割。change_value和change_field分割后的数量应当相同。
change_valuesArrayJSON FormatRequired批量待叠加的数值,格式是:change_values=["第一组","第二组","……"]。每一组格式为:正数表示相加,负数表示相减,需要传递有效数值。多个数值用英文逗号分割。每一组和change_field分割后的数量应当相同。示例:change_values=["1","2"],更新多个值时的示例:["1,11","2,22"]
try_add_datasArrayJSON FormatOptaion批量的初始化数据,格式为:try_add_datas=[第一组,第二组,……]。当无更新时尝试创建的数据,仅当无更新且有传此参数时才会进行数据创建。此参数可用于初始化等操作。try_add_datas要么不传,要么需要和change_values的数量保持一致,对于不需要初始化的可以设置为NULL。此参数只用于初始化,不会再进行change_value的修改。

API Debug

KEYREQUIREDVALUE
app_key *Required
model_name *Required
logic Option
wheres *Required
change_field *Required
change_values *Required
try_add_datas Option

API Response

KEYTypeDescription
err_codeInt状态操作码,0成功;1开发类错误,修改失败(表单不存在或字段类型不是数值类型);2应用层规则拦截,拦截后可以小白开放平台查看日记,3表示部分失败,具体查看details批量结果
err_msgString错误提示信息,err_code非0时参考此提示信息
detailsArray批量结果
details[].change_valueString回传客户端本次待更改的数值
details[].update_rowsInt每组数据的更新结果,对应更新的条目数量。没有更新或没有创建时为0,如果进行更新或初始化创建则为1,其他情况为对应更新的条目数量
details[].err_codeInt单次操作的操作码,当err_code为0时才表示正确执行,最终更新结果再看update_rows的返回
details[].err_msgString单次操作的错误提示信息

HTTP Response Code

HTTP Status CodeDescription
Http Status = 200Success
Http Status = 400Illegal-Params
Http Status = 401Illegal-Token
Http Status = 402IP-Banned
Http Status = 404API-NOT-Exsits
Http Status = 406Illegal-APPKEY
Http Status = 407APPKEY-Expired-Out
Http Status = 408APPKEY-Busy
Http Status = 409Illegal-Sign
Http Status = 413API-Traffic-NOT-Enough
Http Status = 415API-LOCKED
Http Status = 500Internal-Server-Error