# 朋友圈文件上传

## 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:
          multipart/form-data:
            schema:
              type: object
              properties:
                method:
                  example: /sns/upload
                  type: string
                guid:
                  example: '{{guid}}'
                  type: string
                file:
                  example: ''
                  type: string
                  format: binary
                fileType:
                  description: >-
                    <p style="margin: 0; font-size: 14px; color: inherit;
                    line-height: 1.6;">文件类型<br>1: 图片<br>2: 视频<br>3: 视频缩略图</p>
                  example: 0
                  type: integer
              required:
                - method
                - guid
                - file
                - fileType
            examples: {}
      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:
                      fileId:
                        type: string
                        title: 文件 ID
                        description: ''
                      fileKey:
                        type: string
                        title: 文件Key
                        description: ''
                      fileMd5:
                        type: string
                        title: 文件md5值
                        description: ''
                      fileSize:
                        type: integer
                        title: 文件大小
                        description: ''
                      cloudUrl:
                        type: string
                        title: 文件地址
                        description: >-
                          <p style="margin: 0; font-size: 14px; color: inherit;
                          line-height: 1.6;">云端文件地址。</p>
                      fileConvertId:
                        type: string
                        title: 朋友圈 fileId
                        description: >-
                          <p style="margin: 0; font-size: 14px; color: inherit;
                          line-height: 1.6;">发送朋友圈消息、聊天消息时取此字段=fileId</p>
                      fileWidth:
                        type: string
                        description: >-
                          <p style="margin: 0; font-size: 14px; color: inherit;
                          line-height: 1.6;">图片格式：jpg，png，gif 时有值</p>
                        title: 文件宽度
                      fileHeight:
                        type: string
                        description: >-
                          <p style="margin: 0; font-size: 14px; color: inherit;
                          line-height: 1.6;">图片格式：jpg，png，gif 时有值</p>
                        title: 文件高度
                      previewImgUrl:
                        type: string
                        title: 预览图片链接
                        description: ''
                      PreviewImgSize:
                        type: integer
                        title: 预览图片尺寸
                        description: ''
                      duration:
                        type: string
                        description: >-
                          <p style="margin: 0; font-size: 14px; color: inherit;
                          line-height: 1.6;">视频时长，单位：秒</p>
                        title: 时长
                    required:
                      - fileId
                      - fileKey
                      - fileMd5
                      - fileSize
                      - cloudUrl
                      - fileConvertId
                      - fileWidth
                      - fileHeight
                      - previewImgUrl
                      - PreviewImgSize
                      - duration
                    x-apifox-orders:
                      - fileId
                      - fileKey
                      - fileMd5
                      - fileSize
                      - cloudUrl
                      - fileConvertId
                      - previewImgUrl
                      - PreviewImgSize
                      - duration
                      - fileWidth
                      - fileHeight
                    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:
                  fileId: >-
                    *1*A2trDonlAhMGSQ2UEsL3T9osCUqMpfv0QfhGJHKm83uJFGkZfazJRe8/wmenbCJRy46She6c5IkFBwjfr64JsNZK1Mj3f8SvZ22y5aRCfavsY08jaP4Mannq3HRXfvyjYCOH403naOrNeYYp85dNFi8ZZVnPVdHWIcs4BlHYroPIYeMlh337m3JsvGxEQoxQ6Pk3gIkA3MzR9PTwocrF/UTh***ONW5iNn1/SbK6f7mpvYY3ZJIicG6Quht4YblAC4oKMD78DsGOSk+imvfhD8cxwNT4TchjHD4tYtqfRsdzCr7PZjUJikn/BarJYao1qF5pVANnvXFKt57XkOeBnj4OVIM94M8ITrW+HfNbS3Z4qW4Fs2WVhhTpx0NNwZrwoHi0sJG/3PFi0PC6dKM04Pu2jLDqj/f1J05TS+sVMuyK98L69wR5w6MC5BHxaHtxHLc/MXAGqf2FhiwCaOVe2cUJr4hgwd8Xe/UhqEbfpj9/QvAYfaoTwkrh6FGt5niX
                  fileKey: fe3b1c0c-19ba-ef74-962a-6b4f5548babe
                  fileMd5: 5c6ebc09c990d7ac3cae5f26b9390da5
                  fileSize: 2899681
                  cloudUrl: >-
                    https://oss-cn-beijing.aliyuncs.com.wochat-media-dev/wochat/stone_1709642853629.jpg
                  fileConvertId: '*1*F34hSNM***8kxl+ezG4MYn39o/rpGo='
                  previewImgUrl: https://wew***6137/0
                  PreviewImgSize: 151220
                  duration: 8
                  fileWidth: 0
                  fileHeight: 0
                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-478916140-run
components:
  schemas: {}
  securitySchemes:
    apiKey:
      type: apikey
      in: header
      name: X-WECOM-TOKEN
servers:
  - url: https://new.qiweapi.com/qiwe
    description: 正式环境
security: []

```
