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

# 创建抖音打卡

> 接口说明：创建抖音线下打卡发布入口。API Key 属于接入方；扫码用户不需要 AiToEarn 账号，也无需提前授权或绑定抖音账号。

接入方应保存 `recordId`。可以直接展示服务端生成的 `userAction.qrCodeUrl`，也可以使用 `userAction.shortLink` 自行生成二维码，以便自定义尺寸、样式或添加 Logo。用户扫码后会拉起抖音 App，并在 App 内确认和完成发布。`schemeUrl` 可用于移动端页面直接尝试拉起抖音 App。创建后的 `status` 固定为 `8`，表示等待用户操作，不表示发布成功。

抖音发布完成后，AiToEarn 会通过抖音回调更新发布记录。接入方服务端应使用创建记录时的同一 API Key 调用已有的 `GET /api/v2/channels/publish/records/{recordId}` 查询结果。二维码和拉起链接均有有效期，请以 `expiresAt` 为准；过期后需要重新调用本接口。

图片和视频不能混合上传。图片最多 12 张，支持 JPG、JPEG、PNG、BMP，单张最大 20 MB；视频最多 1 个，支持 MP4、AVI、MKV、MOV，最大 1 GB、最长 3600 秒。单个 API Key 每 60 秒最多调用 30 次。



## OpenAPI

````yaml /openapi/zh/aitoearn.openapi.json post /api/v2/channels/douyin/open/offline-qr
openapi: 3.0.1
info:
  title: AiToEarn 开放平台 API
  description: AiToEarn 开放平台 API，支持在中国站与国际站之间切换调试。业务是否成功以响应体 code === 0 为准。
  version: 1.0.0
  contact: {}
servers:
  - url: https://aitoearn.cn
    description: 中国站
  - url: https://aitoearn.ai
    description: 国际站
security: []
tags:
  - name: AI 服务
  - name: AI 服务/视频生成
  - name: AI 服务/图像生成
  - name: 渠道管理
  - name: 渠道管理/账号
  - name: 渠道管理/内容发布
  - name: 渠道管理/平台
  - name: 渠道管理/作品
  - name: 渠道管理/账号分组
  - name: 渠道管理/授权
  - name: 资源管理
  - name: AI 服务/大语言模型
paths:
  /api/v2/channels/douyin/open/offline-qr:
    post:
      tags:
        - 渠道管理/内容发布
      summary: 创建抖音打卡
      description: >-
        接口说明：创建抖音线下打卡发布入口。API Key 属于接入方；扫码用户不需要 AiToEarn 账号，也无需提前授权或绑定抖音账号。


        接入方应保存 `recordId`。可以直接展示服务端生成的 `userAction.qrCodeUrl`，也可以使用
        `userAction.shortLink` 自行生成二维码，以便自定义尺寸、样式或添加 Logo。用户扫码后会拉起抖音 App，并在 App
        内确认和完成发布。`schemeUrl` 可用于移动端页面直接尝试拉起抖音 App。创建后的 `status` 固定为
        `8`，表示等待用户操作，不表示发布成功。


        抖音发布完成后，AiToEarn 会通过抖音回调更新发布记录。接入方服务端应使用创建记录时的同一 API Key 调用已有的 `GET
        /api/v2/channels/publish/records/{recordId}` 查询结果。二维码和拉起链接均有有效期，请以
        `expiresAt` 为准；过期后需要重新调用本接口。


        图片和视频不能混合上传。图片最多 12 张，支持 JPG、JPEG、PNG、BMP，单张最大 20 MB；视频最多 1 个，支持
        MP4、AVI、MKV、MOV，最大 1 GB、最长 3600 秒。单个 API Key 每 60 秒最多调用 30 次。
      operationId: DouyinOpenOfflineQrController_createOpenPublish_v2
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                content:
                  type: object
                  description: 线下打卡发布内容
                  properties:
                    title:
                      type: string
                      description: 标题，最多 30 个字符
                      maxLength: 30
                    body:
                      type: string
                      description: '正文，可在正文中使用 #话题；最多 5 个话题。标题与去除话题后的正文合计最多 1000 个字符'
                    media:
                      type: array
                      default: []
                      description: 图片或视频列表，至少传入 1 个媒体。图片最多 12 张，视频最多 1 个，图片和视频不能混合上传
                      items:
                        type: object
                        properties:
                          url:
                            type: string
                            format: uri
                            description: 媒体 URL
                          options:
                            type: object
                            description: 媒体处理选项
                            properties:
                              adaptation:
                                type: object
                                description: 媒体格式转换选项
                                properties:
                                  imageFormat:
                                    description: 图片和封面格式转换目标
                                    type: string
                                    enum:
                                      - 'off'
                                      - auto
                                      - jpeg
                                      - png
                                      - webp
                                additionalProperties: false
                            additionalProperties: false
                        required:
                          - url
                        additionalProperties: false
                      minItems: 1
                      maxItems: 12
                    cover:
                      type: object
                      properties:
                        url:
                          type: string
                          format: uri
                          description: 封面 URL
                        options:
                          type: object
                          description: 媒体处理选项
                          properties:
                            adaptation:
                              type: object
                              description: 媒体格式转换选项
                              properties:
                                imageFormat:
                                  description: 图片和封面格式转换目标
                                  type: string
                                  enum:
                                    - 'off'
                                    - auto
                                    - jpeg
                                    - png
                                    - webp
                              additionalProperties: false
                          additionalProperties: false
                      required:
                        - url
                      additionalProperties: false
                      description: 视频封面；发布视频时可传入公网可访问的图片 URL
                  required:
                    - media
                  additionalProperties: false
                option:
                  type: object
                  description: 抖音发布选项
                  properties:
                    short_title:
                      type: string
                      maxLength: 12
                      description: 抖音短标题，最多 12 个字符
                    cover_tsp:
                      type: integer
                      minimum: 0
                      description: 视频封面时间戳，单位为毫秒
                    download_type:
                      type: integer
                      enum:
                        - 1
                        - 2
                      description: 下载权限：1 表示允许下载，2 表示不允许下载
                    private_status:
                      type: integer
                      enum:
                        - 0
                        - 1
                        - 2
                      description: 可见范围：0 表示公开，1 表示私密，2 表示好友可见
                    poi_id:
                      type: string
                      description: 抖音地理位置 POI ID
                  additionalProperties: false
              required:
                - content
              additionalProperties: false
            examples:
              video:
                summary: 视频打卡
                value:
                  content:
                    title: 线下打卡
                    body: '今天来参加活动 #线下打卡'
                    media:
                      - url: https://assets.example.com/check-in.mp4
                    cover:
                      url: https://assets.example.com/check-in-cover.jpg
                  option:
                    short_title: 活动打卡
                    download_type: 1
                    private_status: 0
              images:
                summary: 图文打卡
                value:
                  content:
                    title: 门店打卡
                    body: '记录今天的探店体验 #探店'
                    media:
                      - url: https://assets.example.com/check-in-1.jpg
                      - url: https://assets.example.com/check-in-2.jpg
                  option:
                    poi_id: poi_xxx
                    private_status: 0
      responses:
        '200':
          description: 请求已被服务处理。业务是否成功以响应体 code === 0 为准。
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      recordId:
                        type: string
                        description: AiToEarn 发布记录 ID
                      status:
                        type: integer
                        enum:
                          - 8
                        description: 发布状态。创建后固定为 8，表示等待用户在抖音 App 内继续操作
                      userAction:
                        type: object
                        description: 用户继续完成抖音发布所需的信息
                        properties:
                          shareId:
                            type: string
                            description: 抖音分享 ID
                          schemeUrl:
                            type: string
                            description: 用于拉起抖音 App 的 Scheme URL
                          shortLink:
                            type: string
                            description: HTTPS 拉起短链接；可由接入方自行生成和定制二维码
                          qrCodeUrl:
                            type: string
                            description: 服务端生成的二维码 PNG Data URL，可直接用于 img src
                          expiresAt:
                            type: string
                            format: date-time
                            description: 拉起链接的过期时间
                        required:
                          - shareId
                          - schemeUrl
                          - shortLink
                          - qrCodeUrl
                          - expiresAt
                        additionalProperties: false
                    required:
                      - recordId
                      - status
                      - userAction
                    additionalProperties: false
                  code:
                    type: integer
                    description: 业务状态码。0 表示成功，非 0 表示业务错误。
                  message:
                    type: string
                    description: 响应消息。
                  requestId:
                    type: string
                    description: 请求 ID。
                  timestamp:
                    type: integer
                    description: 错误响应时间戳，Unix 毫秒。
                required:
                  - code
                  - message
              examples:
                success:
                  summary: 成功
                  value:
                    code: 0
                    message: 请求成功
                    data:
                      recordId: 66c5f23ec7d9b89d23e6b102
                      status: 8
                      userAction:
                        shareId: '7400000000000000000'
                        schemeUrl: >-
                          snssdk1128://openplatform/share?state=7400000000000000000
                        shortLink: https://aitoearn.cn/api/shortLink/abc123
                        qrCodeUrl: data:image/png;base64,iVBORw0KGgo...
                        expiresAt: '2026-08-22T13:00:00.000Z'
                    requestId: request_xxx
      security:
        - apikey-header-X-Api-Key: []
components:
  securitySchemes:
    apikey-header-X-Api-Key:
      type: apiKey
      in: header
      name: X-Api-Key
      description: 需要从 AiToEarn 获取 API Key。点击前往[「API Key 获取教程」](/zh/use/api-key)。

````