OkayAPI Docs


API Path: /api/App/Table/MultiCheckCreateOrUpdate

API Description: PatchCUUnique Try to add multi DISTINCT record when not exist, or multi update the existed record.

3
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
datasArrayJSON FormatRequired需要批量创建的初始化数据,需要JSON编码后传递。格式:datas=[{第一组数据},{第二组数据},{第三组数据……}]。每一组的数据格式:{"字段名1":"字段值1","字段名2":"字段值2"...}。数据中的uuid将优先于model_uuid参数。JSON Parser Online
check_fieldArraySeperated with ,Required待检测的字段,非批量,全部检测的字段都应一致。注意:datas批量数据每一组数据中必须包含待检测的全部字段。即check_field可指定data数据中的一个或多个字段。多个检测字段用英文逗号分割。例如:check_field=name,age,表示同时检测名字和年龄。请留意字段类型的相等性判断,如字符串类型的字段不能在data参数中传整型参数。
logicEnumOptaionandRange: and/or多个check_field的逻辑组合,非批量,全部检测的字段都应一致。logic=and表示逻辑且,logic=or表示逻辑或

API Debug

KEYREQUIREDVALUE
app_key *Required
model_name *Required
datas *Required
check_field *Required
logic Option

API Response

KEYTypeDescription
err_codeInt状态操作码,0成功;1创建失败(不符合表字段要求,或表字段不存在);2应用层规则拦截,拦截后可以小白开放平台查看日记;3存在部分失败的情况
err_msgString错误提示信息,err_code非0时参考此提示信息
detailsArray批量的结果
details[].idInt新创建数据的自增ID/或原来数据的ID
details[].op_typeString本次操作的具体类型,insert为插入,update为更新,fail为失败(参数错误)
model_nameString当前表单名称

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