# 发送链接消息

## 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">支持发送富文本卡片消息，结构包含：主题 + 描述 + 图片 + 跳转链接。</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/sendLink</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>
                    title:
                      type: string
                      title: 标题
                      description: ''
                    iconUrl:
                      type: string
                      title: 图标链接
                      description: ''
                    linkUrl:
                      type: string
                      title: 链接链接
                      description: ''
                    desc:
                      type: string
                      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
                    - title
                    - iconUrl
                    - linkUrl
                    - desc
                    - toId
                  x-apifox-orders:
                    - guid
                    - title
                    - iconUrl
                    - linkUrl
                    - desc
                    - toId
                  title: 请求参数
              required:
                - method
                - params
              x-apifox-orders:
                - method
                - params
            example:
              method: /msg/sendLink
              params:
                guid: '{{guid}}'
                title: 我是title
                iconUrl: >-
                  https://wework.qpic.cn/wwp**3az/59411_H0x4p2RNQHmdDjh_1709274772/0
                linkUrl: https://www.baidu.com
                desc: 我是desc
                toId: 1{{toId}}
      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: 0
                  msgServerId: 0
                  msgType: 0
                  msgUniqueIdentifier: string
                  seq: 0
                  timestamp: 0
                msg: string
          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-344613920-run
components:
  schemas: {}
  securitySchemes:
    apiKey:
      type: apikey
      in: header
      name: X-WECOM-TOKEN
servers:
  - url: https://new.qiweapi.com/qiwe
    description: 正式环境
security: []

```
