OkayAPI Docs


API Path: /api/App/Table/GetFiledDailyDataReport

API Description: RStat For a single field, obtain daily statistical reports within two periods. You can count the total number or the total number of entries, that is: sum({field}) or count({field}).

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
opEnumOptaionCOUNTRange: SUM/COUNT需要统计的类型,求和:SUM,算总条目数:COUNT
fieldStringRequired需要统计的字段,如:field=money
date_fieldStringRequiredadd_time需要统计的时间日期字段,此字段类型必须是datetime,如:field=add_time
daysIntOptaion7MAX: 180多少天前的对比报表数据,例如7表示一周前,30天表示上个月
startDateDateOptaion开始日期,例如:2020-02-20
endDateDateOptaion结束日期,例如:2020-02-27,包含结束当天的数据。

API Debug

KEYREQUIREDVALUE
app_key *Required
model_name *Required
op Option
field *Required
date_field *Required
days Option
startDate Option
endDate Option

API Response

KEYTypeDescription
err_codeInt操作码,0表示成功,正数表示业务失败场景,负数表示系统失败场景
err_msgString错误提示信息,err_code非0时参考此提示信息
itemsObject报表数据
items.nowArray最近几天的统计数据
items.now[].idInt序号
items.now[].dateString日期,格式如:2019-04-01
items.now[].totalFloat统计的总数
items.preArray上一周期的统计数据
items.pre[].idInt序号
items.pre[].dateString日期,格式如:2019-04-01
items.pre[].totalFloat统计的总数

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