Qeasy Cloud
Get Started
POSThttps://qyapi.weixin.qq.com/cgi-bin/oa/getapprovallistaccess_token(query 传参)

Batch Get Approval List (getapprovallist)

按时间窗口与模板过滤,游标分页获取企业微信审批单号列表,配合 getapprovaldetail 拉取审批详情,用于审批单据同步进 ERP/财务。

## Overview getapprovallist pages through approval serial numbers (sp_no) within a time window — the first step of WeCom approval integration: collect numbers here, then call cgi-bin/oa/getapprovaldetail per sp_no for the full detail (template control values, approval flow, status). Typical flows sync expense, payment and leave approvals into ERP payables, vouchers or attendance records. ### Request essentials 1. POST with Content-Type: application/json; access_token in the URL query. 2. Body: starttime/endtime (seconds; the window cannot exceed 30 days), new_cursor (omit or 0 for page one), size (up to 100) and filters — e.g. key=template_id to scope a template, key=sp_status for approval state. 3. sp_no_list returns the serial numbers and next_cursor continues pagination; an empty list means done. 4. Backfill history month by month; for incremental sync advance endtime as the cursor with a few minutes of overlap so late status changes are not missed. ### Integration advice - Control values live in applyer/template_content; control ids and titles vary with template versions, so keep mappings in a maintainable dictionary. - sp_status 2 means approved — only approved forms should land in finance. Qeasy keys on sp_no for idempotency and updates on status change instead of creating duplicates. - Respect WeCom frequency control during bulk backfills.

Code examples

curl
curl -X POST "https://qyapi.weixin.qq.com/cgi-bin/oa/getapprovallist?access_token=TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"starttime":1780000000,"endtime":1780086400,"size":100,"filters":[{"key":"template_id","value":"3Txxxx"}]}'

Error codes

CodeMessageMeaning
40014invalid access_tokentoken 失效,重新获取
301002无权限操作应用未授权该审批模板数据
60020not allow to access from your ip出口 IP 不在可信 IP 列表