# 发送混合文本消息

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /api/qw/doApi:
    post:
      summary: 发送混合文本消息
      deprecated: false
      description: >-
        <div style="background: linear-gradient(135deg, rgba(255, 213, 145,
        0.45) 0%, rgba(255, 255, 255, 0.06) 100%); border: 1px solid rgba(255,
        236, 202, 0.7); border-radius: 12px; padding: 20px 28px; margin-bottom:
        20px; box-shadow: 0 4px 12px rgba(250, 140, 22, 0.08);">
          <h3 style="margin: 0 0 8px 0; font-size: 18px; font-weight: 600; color: inherit; border: none; padding-bottom: 0;">发送混合文本消息</h3>
          <p style="margin: 0; font-size: 14px; color: inherit; line-height: 1.6;">向指定联系人或群聊发送混合文本。发送前请确认接收方 ID（<code style="color: inherit; background: rgba(82, 196, 26, 0.08); border: 1px solid rgba(82, 196, 26, 0.1); padding: 2px 4px; border-radius: 3px;">userId</code> 或 <code style="color: inherit; background: rgba(82, 196, 26, 0.08); border: 1px solid rgba(82, 196, 26, 0.1); padding: 2px 4px; border-radius: 3px;">roomId</code>）正确。</p>
        </div>
      tags:
        - 'API参考/会话与消息/消息模块 '
      parameters:
        - name: Content-Type
          in: header
          description: ''
          required: true
          example: application/json
          schema:
            type: string
        - name: X-QIWEI-TOKEN
          in: header
          description: >-
            <p style="margin: 0; font-size: 14px; color: inherit; line-height:
            1.6;">进入 <a href="https://new.qiweapi.com/tokens" style="color:
            inherit; text-decoration: underline; font-weight: 600;">应用凭证</a>，复制
            <code style="color: inherit; background: rgba(82, 196, 26, 0.08);
            border: 1px solid rgba(82, 196, 26, 0.1); padding: 2px 4px;
            border-radius: 3px;">TokenId</code>。</p>
          required: true
          example: '{{tokenId}}'
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                method:
                  type: string
                  title: 执行方法
                  description: >-
                    <code style="color: inherit; background: rgba(82, 196, 26,
                    0.08); border: 1px solid rgba(82, 196, 26, 0.1); padding:
                    2px 4px; border-radius: 3px;">/msg/sendHyperText</code>
                params:
                  type: object
                  properties:
                    guid:
                      type: string
                      title: 设备 ID
                      description: >-
                        <p style="margin: 0; font-size: 14px; color: inherit;
                        line-height: 1.6;">设备唯一标识 <code style="color: inherit;
                        background: rgba(82, 196, 26, 0.08); border: 1px solid
                        rgba(82, 196, 26, 0.1); padding: 2px 4px; border-radius:
                        3px;">guid</code>，由「创建设备」接口返回，业务接口必传。</p>
                    content:
                      type: array
                      items:
                        type: object
                        properties:
                          subtype:
                            type: integer
                            description: >-
                              <p style="margin: 0; font-size: 14px; color:
                              inherit; line-height: 1.6;">=0表示普通文本
                              =1表示@具体人，text为对方的userId, 当送0时为@所有人 =2表示系统表情
                              eg:[微笑][憨笑]</p>
                          text:
                            type: string
                        x-apifox-orders:
                          - subtype
                          - text
                      title: 消息内容
                      description: ''
                    toId:
                      type: string
                      title: 指定接收消息的成员id
                      description: >-
                        <p style="margin: 0; font-size: 14px; color: inherit;
                        line-height: 1.6;">接收方 ID，联系人传 userId，群聊传 roomId。</p>
                  required:
                    - guid
                    - content
                    - toId
                  x-apifox-orders:
                    - guid
                    - content
                    - toId
                  title: 请求参数
              required:
                - method
                - params
              x-apifox-orders:
                - method
                - params
            example: |-
              {
                  "method": "/msg/sendHyperText",
                  "params": {
                      "guid": "{{guid}}",
                      "content": [
                          {
                              "subtype": 2,
                              "text": "[微笑][憨笑]"
                          },
                          {
                              "subtype": 1,
                              "text": "" //@所有人
                          },
                          {
                              "subtype": 0,
                              "text": " 我是智能客服"
                          }
                      ],
                      "toId": "7881302****70971"
                  }
              }
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    title: 状态码
                    description: >-
                      <p style="margin: 0; font-size: 14px; color: inherit;
                      line-height: 1.6;">状态码，<code style="color: inherit;
                      background: rgba(82, 196, 26, 0.08); border: 1px solid
                      rgba(82, 196, 26, 0.1); padding: 2px 4px; border-radius:
                      3px;">0</code> 成功。</p>
                  data:
                    type: object
                    properties:
                      isSendSuccess:
                        type: integer
                        title: 是否发送成功
                        description: ''
                      msgServerId:
                        type: integer
                        title: 消息id，用于撤回消息
                        description: ''
                      msgType:
                        type: integer
                        title: 消息类型
                        description: ''
                      msgUniqueIdentifier:
                        type: string
                        title: 消息唯一标识
                        description: ''
                      seq:
                        type: integer
                        title: 消息序号
                        description: ''
                      timestamp:
                        type: integer
                        title: 时间戳
                        description: ''
                    required:
                      - isSendSuccess
                      - msgServerId
                      - msgType
                      - msgUniqueIdentifier
                      - seq
                      - timestamp
                    x-apifox-orders:
                      - isSendSuccess
                      - msgServerId
                      - msgType
                      - msgUniqueIdentifier
                      - seq
                      - timestamp
                    title: 响应数据
                    description: >-
                      <p style="margin: 0; font-size: 14px; color: inherit;
                      line-height: 1.6;">业务数据。</p>
                  msg:
                    type: string
                    title: 说明
                    description: >-
                      <p style="margin: 0; font-size: 14px; color: inherit;
                      line-height: 1.6;">返回说明。</p>
                required:
                  - code
                  - data
                  - msg
                x-apifox-orders:
                  - code
                  - data
                  - msg
              example:
                code: 0
                data:
                  isSendSuccess: 1
                  msgServerId: 1000838
                  msgType: 2
                  msgUniqueIdentifier: T2Bsflc6oeswjjM==
                  seq: 4649019
                  timestamp: 1758350588
                msg: 成功
          headers: {}
          x-apifox-name: 成功
      security: []
      x-apifox-folder: 'API参考/会话与消息/消息模块 '
      x-apifox-status: released
      x-run-in-apifox: https://app.apifox.com/web/project/7051713/apis/api-344613914-run
components:
  schemas: {}
  securitySchemes:
    apiKey:
      type: apikey
      in: header
      name: X-WECOM-TOKEN
servers:
  - url: https://new.qiweapi.com/qiwe
    description: 正式环境
security: []

```
