---
title: "创建抖音打卡"
method: POST
path: "/api/v2/channels/douyin/open/offline-qr"
tags: ["渠道管理/内容发布"]
---

# 创建抖音打卡

`POST /api/v2/channels/douyin/open/offline-qr`

## Request

- Base URL: `https://aitoearn.cn`
- URL: `https://aitoearn.cn/api/v2/channels/douyin/open/offline-qr`
- Auth: API key in header `X-Api-Key`
- TypeScript: <https://skmtc.dev/aitoearn/apis/aitoearn-api/docs/api/v2/channels/douyin/open/offline-qr/post.ts> (a function with typed inputs; its response is checked against the schema)

接口说明：创建抖音线下打卡发布入口。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 次。

## Request body

- object
  - `content` object, required: 线下打卡发布内容
    - `title` string: 标题，最多 30 个字符
    - `body` string: 正文，可在正文中使用 #话题；最多 5 个话题。标题与去除话题后的正文合计最多 1000 个字符
    - `media` object[], required: 图片或视频列表，至少传入 1 个媒体。图片最多 12 张，视频最多 1 个，图片和视频不能混合上传
      - `url` string, uri, required: 媒体 URL
      - `options` object: 媒体处理选项
        - `adaptation` object: 媒体格式转换选项
          - `imageFormat` 'off' | 'auto' | 'jpeg' | 'png' | 'webp': 图片和封面格式转换目标
    - `cover` object: 视频封面；发布视频时可传入公网可访问的图片 URL
      - `url` string, uri, required: 封面 URL
      - `options` object: 媒体处理选项
        - `adaptation` object: 媒体格式转换选项
          - `imageFormat` 'off' | 'auto' | 'jpeg' | 'png' | 'webp': 图片和封面格式转换目标
  - `option` object: 抖音发布选项
    - `short_title` string: 抖音短标题，最多 12 个字符
    - `cover_tsp` integer: 视频封面时间戳，单位为毫秒
    - `download_type` 1 | 2: 下载权限：1 表示允许下载，2 表示不允许下载
    - `private_status` 0 | 1 | 2: 可见范围：0 表示公开，1 表示私密，2 表示好友可见
    - `poi_id` string: 抖音地理位置 POI ID

## Response `200`

请求已被服务处理。业务是否成功以响应体 code === 0 为准。

- object
  - `data` object
    - `recordId` string, required: AiToEarn 发布记录 ID
    - `status` 8, required: 发布状态。创建后固定为 8，表示等待用户在抖音 App 内继续操作
    - `userAction` object, required: 用户继续完成抖音发布所需的信息
      - `shareId` string, required: 抖音分享 ID
      - `schemeUrl` string, required: 用于拉起抖音 App 的 Scheme URL
      - `shortLink` string, required: HTTPS 拉起短链接；可由接入方自行生成和定制二维码
      - `qrCodeUrl` string, required: 服务端生成的二维码 PNG Data URL，可直接用于 img src
      - `expiresAt` string, date-time, required: 拉起链接的过期时间
  - `code` integer, required: 业务状态码。0 表示成功，非 0 表示业务错误。
  - `message` string, required: 响应消息。
  - `requestId` string: 请求 ID。
  - `timestamp` integer: 错误响应时间戳，Unix 毫秒。

## Changes

- **2026-11-03** `7cc8f21c4c96`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/aitoearn/apis/aitoearn-api/changes/api/v2/channels/douyin/open/offline-qr/post.md)

---

[API](https://skmtc.dev/aitoearn/apis/aitoearn-api.md) - [All operations](https://skmtc.dev/aitoearn/apis/aitoearn-api/llms.txt) - [OpenAPI document](https://skmtc.dev/aitoearn/apis/aitoearn-api/revisions/7cc8f21c4c96?raw)
