Qeasy Cloud
Get Started
POSThttps://oapi.dingtalk.com/topapi/processinstance/listidsaccess_token(query 传参)

List Approval Instance IDs (processinstance/listids)

按审批模板与时间窗口分页获取审批实例 ID 列表,配合实例详情接口把钉钉审批单据(报销、请假、采购申请)同步进 ERP/财务系统。

## Overview This endpoint pages through approval instance IDs by template (process_code) and time window — the first step of DingTalk approval data integration: collect IDs here, then call topapi/processinstance/get for each instance's detail (form component values, approval trail, status). Typical flows: expense reports into ERP payables/vouchers, purchase requisitions into purchase orders, connecting OA to finance. ### Request essentials 1. POST with Content-Type: application/json; access_token rides in the URL query. 2. Body: process_code (required), start_time (ms epoch, required), end_time (optional, at most 120 days after start), size (up to 20 per page), cursor (0 for the first page). 3. result.list holds instance IDs; has_more tells whether to continue with next_cursor. 4. The window caps at 120 days — backfill history month by month; for incremental sync advance start_time as the cursor with a few minutes of overlap. ### Integration advice - Form values live in form_component_values of the instance detail; component labels/values shift with template versions, so drive mappings from a maintainable dictionary instead of hard-coded indexes. - Qeasy syncs approvals with process_instance_id as the idempotency key and writes only COMPLETED instances into the ERP. ### Detail fetch strategy Listings return IDs only, so budget one detail call per instance and throttle accordingly — a 20-ID page typically means twenty follow-up calls. Cache instance details immutably once an instance reaches COMPLETED or TERMINATED, because terminal instances never change; this removes most repeat traffic when a window is replayed after a failure.

Code examples

curl
curl -X POST "https://oapi.dingtalk.com/topapi/processinstance/listids?access_token=TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"process_code":"PROC-XXXX","start_time":1780000000000,"size":20,"cursor":0}'

Error codes

CodeMessageMeaning
40014不合法的 access_tokentoken 失效,重新获取
60011没有调用该接口的权限应用未开通审批权限点,需在开发者后台添加
40035缺少参数检查 process_code/start_time 是否传入