Get a single record
Fetches one record by ID or URL. Supports json, json-ld, and markdown.
This page focuses on response structure and integration notes; full schemas and demos live in the companion folder. Example files are sanitized.
Request example
import requests
url = 'https://open.cli.im/api/v2/rpc/record/getRecord'
data = {
'record_id': 10001,
'format': 'json'
}
headers = {
'Authorization': 'Bearer <your API Key>',
'Content-Type': 'application/json'
}
response = requests.post(url, json=data, headers=headers)
print(response.text)curl -X POST 'https://open.cli.im/api/v2/rpc/record/getRecord' \
-H 'Authorization: Bearer <your API Key>' \
-H 'Content-Type: application/json' \
-d '{"record_id": 10001, "format": "json"}'Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
record_id | integer | No | Record ID. Use with record_url: at least one required |
record_url | string | No | Short record URL, often full URL starting with record code r. At least one of record_id / record_url |
format | string | No | Output format, default json. Values: json, json-ld, markdown |
Output format overview
format | data.content_type | data.data type | Typical use |
|---|---|---|---|
json | application/json; charset=utf-8 | object | Parsing, field processing, sync |
json-ld | application/ld+json; charset=utf-8 | object | Semantic exchange, Schema.org style |
markdown | text/markdown; charset=utf-8 | string | Reading, archive export, summarization |
Full examples:
- Normal record:
jsonresponse,json-ldresponse,markdownresponse - Subcode edit record:
json,json-ld,markdown
Full response skeleton
Skeletons below; large samples use the companion files.
{
"code": 0,
"message": "ok",
"data": {
"format": "json",
"version": "v1",
"content_type": "application/json; charset=utf-8",
"data": {
"record_id": 10001,
"record_number": "REC-001",
"record_code": "record_demo_code_001",
"record_url": "https://example.com/records/record-demo-001",
"submit_at": 1773056539,
"submit_at_iso": "2026-03-09 19:42:19(UTC+08:00)",
"submit_method": "扫一扫填写",
"recorder": { "auth_id": 20001, "user_id": 30001, "name": "张**" },
"project": { "id": 40001, "name": "示例园区", "number": "P001" },
"qrcode": { "id": 50001, "name": "示例点位A", "type": 0, "type_text": "普通二维码", "template_id": 50010, "qrcode_url": "https://example.com/qrcodes/qrcode-demo-001", "number": "", "category_id": 50020 },
"org": { "id": 60001, "name": "示例企业", "code": "org_demo_code", "logo_url": "https://example.com/assets/logo-demo.png" },
"record_template": { "id": 70001, "name": "设备巡检示例", "type": 0, "type_text": "普通表单", "number": "TPL-001" },
"audit": { "enabled": true, "current_stage_id": 80001, "current_stage_title": "组长审批", "status": 0, "status_text": "待审核", "auditor_name": "李**" },
"process_status": { "enabled": true, "text": "处理中", "color": "#155EB7" },
"state_changes": [],
"tpl_groups": [ { "...": "完整字段结构见示例文件与 schema" } ]
}
}
}{
"code": 0,
"message": "ok",
"data": {
"format": "json-ld",
"version": "v1",
"content_type": "application/ld+json; charset=utf-8",
"data": {
"@context": "https://schema.org",
"@type": "CreativeWork",
"identifier": "record-demo-001",
"name": "设备巡检示例-REC-001",
"url": "https://example.com/records/record-demo-001",
"mainEntity": { "@type": "ItemList", "name": "组件数据" }
}
}
}{
"code": 0,
"message": "ok",
"data": {
"format": "markdown",
"version": "v1",
"content_type": "text/markdown; charset=utf-8",
"data": "---\ntitle: 设备巡检示例-REC-001\nrecord_id: 10001\n...\n---\n\n# 设备巡检示例-REC-001\n\n## 基本信息\n\n**记录编号:** REC-001"
}
}Response overview
| Path | Type | Description |
|---|---|---|
code | integer | Platform code; 0 success |
message | string | Message |
data | object | Wrapper |
data.format | string | Actual format (matches request) |
data.version | string | Content version, currently v1 |
data.content_type | string | MIME type of business payload |
data.data | object | string | Payload; type depends on data.format |
Wrapper example:
{
"format": "json",
"version": "v1",
"content_type": "application/json; charset=utf-8",
"data": { "...": "..." }
}format=json details
When format=json, data.data is a structured record. Full schema: content-json-v1.schema.json; sample: payload-normal.json.
Record object
| Field | Type | Description |
|---|---|---|
record_id | integer | Record ID |
record_number | string | Record number |
record_code | string | Record code, unique in platform |
record_url | string | Record access URL |
submit_at | integer | Submitted at (Unix seconds) |
submit_at_iso | string | Submitted at with timezone |
submit_method | string | How it was submitted |
recorder | object | Submitter |
project | object | Project (partition) |
qrcode | object | QR code |
org | object | Organization |
record_template | object | Form template |
audit | object | Approval info |
process_status | object | Processing status |
state_changes | array | State change list |
tpl_groups | array | Groups and field values |
Key nested objects
| Object | Key fields | Description |
|---|---|---|
recorder | auth_id, user_id, name | Submitter |
project | id, name, number | Project |
qrcode | id, name, type, qrcode_url | QR code |
org | id, name, code, logo_url | Org |
record_template | id, name, type, number | Form |
audit | enabled, current_stage_id, status | Approval |
process_status | enabled, text, color | Processing |
state_changes[] | state, from_state_option, to_state_option | Changes |
tpl_groups[]
| Field | Type | Description |
|---|---|---|
group_id | integer | Group ID |
group_title | string | Title; "" if none |
show_group_title | boolean | Whether to show title |
is_page_break_group | boolean | Page-break marker; fields often empty |
fields | array | Fields in the group |
tpl_groups[].fields[]
| Field | Type | Description |
|---|---|---|
field_id | integer | Field ID |
field_title | string | Title |
field_desc | string | Description / hint |
field_type | string | Type; drives field_value shape |
field_short_name | string | Short name |
group_id | integer | Group ID |
field_value | mixed | Value |
options | object | Display options: is_result, is_highlight, is_hidden, is_masked |
field_type vs field_value
Names and categories: Form component types overview.
Read field_type first, then parse field_value. Full mapping: content-json-v1.schema.json.
| Category | field_type | field_value shape |
|---|---|---|
| Plain text | name, tel, recorder, identity, job_number, text, textarea, date, time, customer_name, customer_mobile, customer_number, carnumber | string |
| Single choice | sex, radio | object with option_text, option_id |
| Number | number | object with value, unit, unit_enabled |
| Multi choice | checkbox | object with values[] |
| Checklist | checklist | array of items with item_id, item_title, value |
| Matrix | matrix | object with columns[] |
| Dynamic matrix | dynamic_matrix | object with rows[] |
| Located address | address | object with address, lat, lng |
| Manual address | owner_address | object with province, city, district, street, detail, full_address |
| Cascaded | chained_selects | object with values[] |
| Image / signature | image, signature | array of media objects |
| Audio | audio | array with url, size, duration, etc. |
| Video | video | array with url, size, duration |
| File | file | array with url, size, file_name |
| Description | description | object with description_html |
| OCR | ocr_* | object with items[] and image |
| Subcode edit diff | sub_qrcode_edit_diff | array with before_value, after_value |
format=json-ld
Semantic Schema.org object. Good for knowledge graphs or systems that need explicit semantics.
Files:
- Schema:
content-jsonld-v1.schema.json - Normal payload:
payload-normal.json - Subcode edit payload:
payload-child-qrcode-edit.json
format=markdown
data.data is full Markdown for display, export, or LLM reading.
Files:
- Schema:
content-markdown-v1.schema.json - Normal full response:
success-normal.response.json - Subcode edit:
success-child-qrcode-edit.response.json
Schema and examples
Schema
response.schema.json: full responsecontent-json-v1.schema.json:format=jsonpayloadcontent-jsonld-v1.schema.json:format=json-ldpayloadcontent-markdown-v1.schema.json:format=markdownpayload
Full examples
- JSON:
normal,child-qrcode-edit - JSON-LD:
normal,child-qrcode-edit - Markdown:
normal,child-qrcode-edit
Other conventions
Nulls
| Case | Rule |
|---|---|
| Empty field | field_value may be null |
| Missing entity | Structure kept; nested fields may be null |
| Empty string | Often "" |
| Empty array | Often [] |
Masking
| Case | Description |
|---|---|
| Live API | Masking depends on org permission and output settings |
| Doc samples | Sanitized for structure reference only |
options.is_masked | Means masking is enabled for the component; not a guarantee of masked values in every response |
AI image audit fields
Optional ai_audit_result may appear on:
image/signatureitems infield_value[]value.images[]in checklists- OCR
image media_items[]in subcode edit diff
| Field | Type | Description |
|---|---|---|
ai_audit_result.audit_status | integer | 0 default, 1 pass, 2 fail, 3 error, 4 pending |
ai_audit_result.audit_status_text | string | Chinese label for audit_status |
ai_audit_result.reason | string | AI reason text |
Error response
{
"code": 400,
"error_code": 100300,
"message": "System error",
"message_detail": ""
}| Field | Type | Description |
|---|---|---|
code | integer | HTTP or platform status |
error_code | integer | Business error code |
message | string | Summary |
message_detail | string | Detail; may be empty |
Full error codes: Error codes.