> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scanova.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Text Message QR Code

> 创建一个可预填短信内容的 QR 码。

## 适用场景

Text Message QR 码会打开设备的短信编辑器，并预先填好收件号码和消息内容，因此扫描它就是给企业发短信的一键式方式——无论是反馈热线、订单号，还是一个订阅关键词。它是一种 **Quick Code**——一种没有落地页的直接动作型 QR。在应用中，其卡片上的文案是 "Open SMS composer with a pre-filled message."（打开短信编辑器，消息已预填）。

<Note>
  Text Message **仅支持 Static**——此类型没有 Dynamic 选项。一旦发布，编码后的号码和消息将无法编辑或追踪；如需更改，请创建一个新的 QR 码。
</Note>

## 创建一个 Text Message QR 码

<Steps>
  <Step title="打开 Create QR Code 并选择 Quick Code">
    在侧边栏中，进入 **QR Codes**，然后点击 **Create QR Code**（或前往 `/qr/create`）。点击 **Quick Code** 卡片。
  </Step>

  <Step title="选择 Text Message">
    在 **Quick Code** 类型网格中，点击 **Static Only** 分区下 **Text Message** 下方的 **Configure**。这会打开 `/qr/quick/sms` 处的表单。
  </Step>

  <Step title="输入电话号码和消息内容">
    填写以下两个字段：

    * **Phone number**（占位符 `+1 415 555 0100`）—— 校验方式与 [Phone Number](/zh/qr-codes/create/phone-number) 类型相同：在失焦时校验，接受数字、空格、括号、连字符，以及可选的前导 `+`，总位数为 6–15 位。
    * **Message**（占位符 "Hello!"）—— 一个单行文本字段，作为短信正文发送。

    两个字段都是发布所必需的，尽管表单本身并没有用必填标记来标注它们。

    <Frame caption="已填写电话号码和消息内容的 Text Message Quick Code 表单">
      <img src="https://mintcdn.com/scanova-api/q8t3kzcRTgAP7jV0/images/v2/qr-codes/create/text-message/text-message-form-filled.png?fit=max&auto=format&n=q8t3kzcRTgAP7jV0&q=85&s=6b0c10aa0b1d183edfaea47e73e1a0cc" alt="Text Message Quick Code 表单，电话号码字段填写了 +1 415 555 0142，消息字段填写了一条感谢短语，右侧带有实时 QR 预览" width="1440" height="900" data-path="images/v2/qr-codes/create/text-message/text-message-form-filled.png" />
    </Frame>
  </Step>

  <Step title="发布">
    点击 **Publish**。会弹出一个面板，用于确认或重命名 QR 码（默认使用 "SMS \<number>"）、分配文件夹或标签，并在确认前调整 QR 码设计。
  </Step>
</Steps>

## 通过 API 创建

若要通过 API 而非界面创建 Text Message QR 码，请使用类别 ID `5`（标记为 **Text Message**，`allowed_qr_types: "st"`——`qr_type` 只能取 `"st"`），其 `info` 负载结构如下：

```json theme={null}
{
  "type": "sms",
  "data": {
    "contactNumber": "+14155550142",
    "message": "Thanks for scanning — here's 10% off your next visit."
  }
}
```

`contactNumber` 和 `message` 都是后端模式要求的必填字段。完整的请求结构请参见 [Create QR Code](/v1/api-reference/endpoint/qr_manager/create)。

<Note>
  [Category List](/v1/api-reference/references/category-list) 参考表目前尚未列出 Text Message（以及本页其他仅限 Quick Code 的类别）——上述 ID 是直接对照实际的 `/qr/category/` 端点确认得到的。
</Note>

## 相关内容

* [Email QR Code](/zh/qr-codes/create/email) —— 一种类似的直接动作型类型，打开的是邮件应用而非短信编辑器。
* [Phone Number QR Code](/zh/qr-codes/create/phone-number) —— 使用相同的电话号码校验逻辑，用于打开拨号盘。
* [创建您的第一个 QR 码](/zh/getting-started/first-qr-code) —— 完整介绍此类型所属的 Quick Code 流程。
