> ## 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.

# 获取小红书签名

> 接口说明：获取前端调用小红书 `xhs.share` 所需的签名配置。API Key 属于接入方；扫码用户不需要 AiToEarn 账号，也无需提前授权或绑定小红书账号。

接入方需要提供自己的移动端分享页面，并将该页面地址生成线下二维码。扫码页面应请求接入方自己的后端，由接入方后端调用本接口，再将返回的 `verifyConfig` 交给前端调用 `xhs.share`。API Key 不得下发到前端。

本接口只生成 `verifyConfig`，不接收图片、视频、标题或正文，不创建 AiToEarn 发布记录，也不返回最终作品信息。分享内容由接入方前端调用 `xhs.share` 时传入。建议在用户准备分享时即时获取签名，并完整使用同一次响应中的 `nonce`、`timestamp` 和 `signature`，不要长期缓存、跨请求混用或跨多次分享复用。

`xhs.share` 的成功回调只表示 SDK 调用或 App 拉起成功，不能直接视为用户最终发布成功。单个 API Key 每 60 秒最多调用 60 次。



## OpenAPI

````yaml /openapi/zh/aitoearn.openapi.json post /api/v2/channels/rednote/open/offline-qr/share-config
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/rednote/open/offline-qr/share-config:
    post:
      tags:
        - 渠道管理/内容发布
      summary: 获取小红书签名
      description: >-
        接口说明：获取前端调用小红书 `xhs.share` 所需的签名配置。API Key 属于接入方；扫码用户不需要 AiToEarn
        账号，也无需提前授权或绑定小红书账号。


        接入方需要提供自己的移动端分享页面，并将该页面地址生成线下二维码。扫码页面应请求接入方自己的后端，由接入方后端调用本接口，再将返回的
        `verifyConfig` 交给前端调用 `xhs.share`。API Key 不得下发到前端。


        本接口只生成 `verifyConfig`，不接收图片、视频、标题或正文，不创建 AiToEarn
        发布记录，也不返回最终作品信息。分享内容由接入方前端调用 `xhs.share`
        时传入。建议在用户准备分享时即时获取签名，并完整使用同一次响应中的 `nonce`、`timestamp` 和
        `signature`，不要长期缓存、跨请求混用或跨多次分享复用。


        `xhs.share` 的成功回调只表示 SDK 调用或 App 拉起成功，不能直接视为用户最终发布成功。单个 API Key 每 60
        秒最多调用 60 次。
      operationId: RedNoteOpenOfflineQrController_createOpenShareConfig_v2
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                nonce:
                  type: string
                  minLength: 1
                  maxLength: 64
                  description: 可选随机字符串，最长 64 个字符；不传时由服务端自动生成
              additionalProperties: false
            examples:
              automatic:
                summary: 自动生成 nonce
                value: {}
              custom:
                summary: 自定义 nonce
                value:
                  nonce: checkin_8f72c9
      responses:
        '200':
          description: 请求已被服务处理。业务是否成功以响应体 code === 0 为准。
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      verifyConfig:
                        type: object
                        description: 调用小红书 xhs.share 时使用的校验配置
                        properties:
                          appKey:
                            type: string
                            description: 小红书应用 App Key
                          nonce:
                            type: string
                            description: 本次签名使用的随机字符串
                          timestamp:
                            type: string
                            description: 字符串形式的 Unix 毫秒时间戳
                          signature:
                            type: string
                            description: 前端调用 xhs.share 时使用的签名
                        required:
                          - appKey
                          - nonce
                          - timestamp
                          - signature
                        additionalProperties: false
                    required:
                      - verifyConfig
                    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:
                      verifyConfig:
                        appKey: app_key
                        nonce: checkin_8f72c9
                        timestamp: '1787389200000'
                        signature: signature_xxx
                    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)。

````