Skip to content

QR code operation elements

Get operation elements linked to a QR code by coding or full URL.

This endpoint returns a flattened array:

  • Each item in data is one operation element
  • If one operation contains multiple elements, they are returned as separate records
  • If no operation is linked, data is []

Request example

python
import requests

url = "https://open.cli.im/api/v2/rpc/qrcodes/getOperation"
data = {
    "qrcode": "qk3mJHJ"
}
headers = {
    "Authorization": "Bearer <your API Key>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=data, headers=headers)
print(response.text)
bash
curl -X POST 'https://open.cli.im/api/v2/rpc/qrcodes/getOperation' \
  -H 'Authorization: Bearer <your API Key>' \
  -H 'Content-Type: application/json' \
  -d '{"qrcode":"qk3mJHJ"}'

Request parameters

ParameterTypeRequiredDescription
qrcodestringYesQR code coding or full URL, e.g. qk3mJHJ or https://qr61.cn/xxxx/yyy

Request body example

json
{
  "qrcode": "qk3mJHJ"
}

Full response example

json
{
  "code": 0,
  "message": "ok",
  "data": [
    {
      "operation_name": "巡检操作",
      "operation_description": "每日巡检填写",
      "element_type": 2,
      "element_type_title": "填写表单",
      "element_value": 122507
    },
    {
      "operation_name": "巡检操作",
      "operation_description": "每日巡检填写",
      "element_type": 1,
      "element_type_title": "更新状态",
      "element_value": 88001
    }
  ]
}

In this example, one operation contains two elements:

  • A form-fill element with tpl_id = 122507
  • A state-update element with state_id = 88001

Response overview

PathTypeDescription
codeintegerPlatform status code, 0 for success
messagestringStatus message (ok or empty string on success)
dataarrayFlattened operation-element list

data[] fields

FieldTypeDescription
operation_namestringOperation title
operation_descriptionstringSubtitle/description (may be empty)
element_typeintegerElement type, see enum below
element_type_titlestringElement type title from server
element_valueinteger|string|objectAssociated value; meaning depends on element_type

element_type enum

element_typeelement_type_titleMeaningelement_value meaning
1更新状态Update QR code state optionState ID
2填写表单Fill or link to a formForm template ID
3跳转链接Jump to external URLLink config value
4更新子码内容Update subcode field contentSubcode field config
5更新子码内容Update related-code field contentRelated-code field config

Notes:

  • element_type_title is display text returned by server.
  • element_type=4 and 5 may share title text but business semantics differ.
  • For programmatic branching, use element_type rather than only element_type_title.

Integration tips:

  • For element_type=2, element_value is tpl_id.
  • After getting tpl_id, call Get form template for field definitions and IDs.
  • To read history, call Get records.
  • To submit new records, call Add record.

Empty result

json
{
  "code": 0,
  "message": "ok",
  "data": []
}

Error response

Typical non-success examples:

json
{
  "code": 400,
  "error_code": 0,
  "message": "Invalid qrcode data, need coding or url"
}
json
{
  "code": 400,
  "error_code": 0,
  "message": "Invalid qrcode url"
}
FieldTypeDescription
codeintegerError status, commonly 400
error_codeintegerBusiness error code (varies by case)
messagestringError summary

Common error cases:

  • Missing qrcode
  • qrcode is not a valid QR code URL
  • Target QR code does not exist

See Error codes.