# QR code content

Get display content (metadata and fields) by QR code `coding` or full URL.

## Request example



```python [Python + requests]
import requests

url = 'https://open.cli.im/api/v2/rpc/qrcodes/getContent'
data = {
    'qrcode': 'qk3mJHJ',
    'format': 'json'
}
headers = {
    'Authorization': 'Bearer <your API Key>',
    'Content-Type': 'application/json'
}
response = requests.post(url, json=data, headers=headers)
print(response.text)
```

```bash [curl]
curl -X POST 'https://open.cli.im/api/v2/rpc/qrcodes/getContent' \
  -H 'Authorization: Bearer <your API Key>' \
  -H 'Content-Type: application/json' \
  -d '{"qrcode": "qk3mJHJ", "format": "json"}'
```



## Response example

```json
{
  "code": 0,
  "message": "ok",
  "data": {
    "meta": {
      "id": 6763267,
      "title": "示例活码名称",
      "url": "https://qr46.cn/xxx/yyy",
      "coding": "aBcDeFg"
    },
    "fields": [
      {
        "field_id": 1001,
        "type": "text",
        "title": "标题",
        "value": { "value": "示例内容" }
      }
    ]
  }
}
```

## Request details

`qrcode` string *required*

QR code `coding` or full URL to identify the target code.

---

`format` string **optional**

Output format: `json` or `markdown`. Default is `json`.

---

## Response details

`code` integer

Status code; `0` means success.

---

`message` string

Status message.

---

`data` object

Response payload.

---

`data.meta` object

Metadata:

- `title` string: QR code title
- `url` string: QR code URL
- `coding` string: QR code coding
- `id` integer: QR code ID (external `code_id`)

---

Notes:

- `data.meta.id` can be used as `code_id` in [Add record](https://cli.im/open-api/en/openapi/v2/api/record/record-add-record.md).
- `data.meta.id` can also be used as `filters.qrcode.id` in [Get records](https://cli.im/open-api/en/openapi/v2/api/record/record-get-records.md).
- To discover linked forms, call [QR code operation elements](https://cli.im/open-api/en/openapi/v2/api/qrcodes-get-operation.md) and read `tpl_id` from elements with `element_type=2`.

---

`data.fields` array

List of fields. Each item contains `field_id`, `type`, `title`, and `value` (shape depends on component type).

---

## Integration tips

Common downstream usage:

1. If you only have QR `coding` / URL and need `code_id`, call this endpoint.
2. After getting `code_id`:
   - Read records: [Get records](https://cli.im/open-api/en/openapi/v2/api/record/record-get-records.md)
   - Write record: [Add record](https://cli.im/open-api/en/openapi/v2/api/record/record-add-record.md)
3. If you also need linked forms, call [QR code operation elements](https://cli.im/open-api/en/openapi/v2/api/qrcodes-get-operation.md).

## Error codes

See [Error codes and rate limits](https://cli.im/open-api/en/openapi/v2/error-codes.md).
