square-post

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Square Post Skill

Square Post Skill

Overview

概述

Post text content to Binance Square.

将文本内容发布至Binance Square。

API: Add Content

API:添加内容

Method: POST

请求方法:POST

Base URL:
SHIFT_LOCAL_GATEWAY
Path:
/binance/square-post/bapi/composite/v1/public/pgc/openApi/content/add
Request Headers:
HeaderRequiredDescription
X-Square-OpenAPI-KeyInjected by ShiftThis header is injected by Shift when the
square_open_api
slot is configured
Content-TypeYes
application/json
clienttypeYes
binanceSkill
Request Body:
FieldTypeRequiredDescription
bodyTextOnlystringYesPost content text (supports #hashtags)
基础URL:
SHIFT_LOCAL_GATEWAY
路径:
/binance/square-post/bapi/composite/v1/public/pgc/openApi/content/add
请求头:
请求头是否必填描述
X-Square-OpenAPI-Key由Shift注入当配置
square_open_api
插槽时,该请求头由Shift自动注入
Content-Type
application/json
clienttype
binanceSkill
请求体:
字段类型是否必填描述
bodyTextOnly字符串发布内容文本(支持#话题标签)

Example Request

请求示例

bash
curl -X POST "${SHIFT_LOCAL_GATEWAY}/binance/square-post/bapi/composite/v1/public/pgc/openApi/content/add" \
  -H 'Content-Type: application/json' \
  -H 'clienttype: binanceSkill' \
  -d '{
    "bodyTextOnly": "BTC looking bullish today!"
  }'
bash
curl -X POST "${SHIFT_LOCAL_GATEWAY}/binance/square-post/bapi/composite/v1/public/pgc/openApi/content/add" \
  -H 'Content-Type: application/json' \
  -H 'clienttype: binanceSkill' \
  -d '{
    "bodyTextOnly": "BTC looking bullish today!"
  }'

Response Example

响应示例

json
{
  "code": "000000",
  "message": null,
  "data": {
    "id": "content_id_here"
  }
}
json
{
  "code": "000000",
  "message": null,
  "data": {
    "id": "content_id_here"
  }
}

Response Fields

响应字段

FieldTypeDescription
codestring
"000000"
= success
messagestringError message (null on success)
data.idstringCreated content ID
字段类型描述
code字符串
"000000"
表示成功
message字符串错误信息(成功时为null)
data.id字符串已创建内容的ID

Post URL Format

发布链接格式

On success, construct the post URL:
https://www.binance.com/square/post/{id}
Example: If
data.id
is
298177291743282
, the post URL is:
https://www.binance.com/square/post/298177291743282

发布成功后,可按以下格式构造发布链接:
https://www.binance.com/square/post/{id}
示例:若
data.id
298177291743282
,则发布链接为:
https://www.binance.com/square/post/298177291743282

Error Handling

错误处理

CodeDescription
000000Success
10004Network error. Please try again
10005Only allowed for users who have completed identity verification
10007Feature unavailable
20002Detected sensitive words
20013Content length is limited
20020Publishing empty content is not supported
20022Detected sensitive words (with risk segments)
20041Potential security risk with the URL
30004User not found
30008Banned for violating platform guidelines
220003API Key not found
220004API Key expired
220009Daily post limit exceeded for OpenAPI
220010Unsupported content type
220011Content body must not be empty
2000001Account permanently blocked from posting
2000002Device permanently blocked from posting

错误码描述
000000成功
10004网络错误,请重试
10005仅完成身份验证的用户可使用
10007功能暂不可用
20002检测到敏感词
20013内容长度超出限制
20020不支持发布空内容
20022检测到敏感词(含风险片段)
20041链接存在潜在安全风险
30004用户未找到
30008因违反平台规则被封禁
220003未找到API密钥
220004API密钥已过期
220009OpenAPI每日发布次数超限
220010不支持该内容类型
220011内容主体不能为空
2000001账号被永久禁止发布
2000002设备被永久禁止发布

Authentication

认证方式

This skill expects a preconfigured Shift secret slot named
square_open_api
.
Use
SHIFT_LOCAL_GATEWAY
as the base URL. Do not ask the user to paste or reveal the raw Binance Square API key inside the conversation. Do not call Binance directly and do not call a remote Shift host directly. Shift will inject the
X-Square-OpenAPI-Key
header at request time.
该Skill依赖预先配置的Shift密钥插槽,名称为
square_open_api
请使用
SHIFT_LOCAL_GATEWAY
作为基础URL。请勿要求用户在对话中粘贴或透露原始Binance Square API密钥。请勿直接调用币安接口,也请勿直接调用远程Shift主机。Shift会在请求时自动注入
X-Square-OpenAPI-Key
请求头。

Required Header

必填请求头

HeaderRequiredDescription
X-Square-OpenAPI-KeyInjected by ShiftAPI key for Square posting

请求头是否必填描述
X-Square-OpenAPI-Key由Shift注入用于Square发布的API密钥

Agent Behavior

Agent行为规范

  1. Check secret slot before API calls: Verify that the Shift slot
    square_open_api
    is configured
  2. Do not request raw API keys in chat: If the slot is missing, tell the user to configure it in Shift dashboard
  3. Prompt for content if missing: If user triggers posting but doesn't provide specific content, ask what they want to post
  4. Optimize content before posting:
    • Polish user's raw input for better readability
    • Show optimized content and ask user to choose: use optimized version or post original text
  5. Return post URL on success: After successful post, return the URL
    https://www.binance.com/square/post/{id}
  6. Handle missing id: If code is
    000000
    but
    data.id
    is empty or missing, inform user that post may have succeeded but URL is unavailable, suggest checking Square page manually

  1. API调用前检查密钥插槽:验证Shift插槽
    square_open_api
    是否已配置
  2. 请勿在聊天中索要原始API密钥:若插槽未配置,请告知用户在Shift控制台中进行配置
  3. 内容缺失时提示用户:若用户触发发布操作但未提供具体内容,询问用户想要发布的内容
  4. 发布前优化内容:
    • 优化用户的原始输入以提升可读性
    • 展示优化后的内容,并让用户选择:使用优化版本或发布原始文本
  5. 发布成功后返回链接:发布成功后,返回链接
    https://www.binance.com/square/post/{id}
  6. 处理ID缺失情况:若响应码为
    000000
    data.id
    为空或缺失,告知用户发布可能已成功但无法获取链接,建议手动查看Square页面

Notes

注意事项

  1. Only pure text posts are supported currently
  2. Check daily post limit to avoid 220009 error
  1. 当前仅支持纯文本发布
  2. 请留意每日发布次数限制,避免触发220009错误