panda-publish
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSocial Publish
社交媒体发布
Publish social media posts to connected platforms via the Nosy Pandas API from Claude Code.
通过Claude Code的Nosy Pandas API将社交媒体帖子发布至已关联的平台。
Configuration
配置
Configuration is stored in as simple key=value pairs:
~/.pandasapi_url=https://nosypandas.com/api
api_key=your-key-here
media_folder=~/social-mediaIf this file doesn't exist or is missing values, the skill will walk the user through setup:
- Ask them to paste their API key (generated from the dashboard under API Keys)
- Write automatically
~/.pandas
The user can also just paste their API key directly in chat at any time — the skill should detect it and offer to save it.
media_folder~/social-media/配置信息以简单的键值对形式存储在文件中:
~/.pandasapi_url=https://nosypandas.com/api
api_key=your-key-here
media_folder=~/social-media如果该文件不存在或缺少必要值,本工具会引导用户完成设置:
- 要求用户粘贴其API密钥(可在控制台的API Keys页面生成)
- 自动写入文件
~/.pandas
用户也可以随时在聊天中直接粘贴API密钥,工具会自动检测并提供保存选项。
media_folder~/social-media/Reading Configuration
读取配置
bash
undefinedbash
undefinedRead config values (use these instead of env vars in all curl commands)
读取配置值(在所有curl命令中使用这些变量而非环境变量)
PANDAS_API_URL="https://nosypandas.com/api"
PANDAS_API_KEY=$(grep '^api_key=' ~/.pandas 2>/dev/null | cut -d= -f2-)
PANDAS_MEDIA_FOLDER=$(grep '^media_folder=' ~/.pandas 2>/dev/null | cut -d= -f2-)
PANDAS_MEDIA_FOLDER="${PANDAS_MEDIA_FOLDER:-$HOME/social-media}"
undefinedPANDAS_API_URL="https://nosypandas.com/api"
PANDAS_API_KEY=$(grep '^api_key=' ~/.pandas 2>/dev/null | cut -d= -f2-)
PANDAS_MEDIA_FOLDER=$(grep '^media_folder=' ~/.pandas 2>/dev/null | cut -d= -f2-)
PANDAS_MEDIA_FOLDER="${PANDAS_MEDIA_FOLDER:-$HOME/social-media}"
undefinedAvailable Commands
可用命令
| Command | Description |
|---|---|
| Publish | Create and publish a post to one or more platforms |
| History | View recent posts and their statuses |
| Detail | Check a specific post's full details |
| Retry | Retry a failed post |
| Delete | Delete a scheduled or failed post |
| 命令 | 描述 |
|---|---|
| Publish | 创建并将帖子发布至一个或多个平台 |
| History | 查看近期帖子及其状态 |
| Detail | 查看特定帖子的完整详情 |
| Retry | 重试发布失败的帖子 |
| Delete | 删除已排期或发布失败的帖子 |
Publish Flow
发布流程
Follow these steps in order:
按以下步骤依次操作:
Step 0: Permission Setup (first run only)
步骤0:权限设置(仅首次运行)
Check if the user's Claude Code permissions already include the skill's bash patterns:
bash
grep -q "nosypandas.com" ~/.claude/settings.json 2>/dev/null && echo "CONFIGURED" || echo "NOT_CONFIGURED"If , skip to Step 1.
CONFIGUREDIf , explain to the user:
NOT_CONFIGUREDQuick setup: This skill runs bash commands to call the Nosy Pandas API, read your config, scan for media files, and move them after posting. By default, Claude Code asks you to approve each one — that's 6-11 prompts every time you publish.I can add permission patterns to your Claude Code settings () so these commands auto-approve. The patterns are scoped narrowly:~/.claude/settings.json
- API calls only to
nosypandas.com- Config reads/writes only to
~/.pandas- File operations only in your
foldersocial-media/Want me to set this up?
If the user agrees, read , merge these patterns into the array (avoiding duplicates), and write it back:
~/.claude/settings.jsonpermissions.allowjson
"Bash(cat > ~/.pandas *)",
"Bash(chmod 600 ~/.pandas)",
"Bash(grep * ~/.pandas *)",
"Bash(find * social-media *)",
"Bash(curl * https://nosypandas.com/*)",
"Bash(sleep *)",
"Bash(mkdir -p * social-media/*)",
"Bash(mv * social-media/*)"If the user declines, proceed normally — they'll just see approval prompts for each command.
检查用户的Claude Code权限是否已包含本工具的bash命令规则:
bash
grep -q "nosypandas.com" ~/.claude/settings.json 2>/dev/null && echo "CONFIGURED" || echo "NOT_CONFIGURED"如果返回,直接跳至步骤1。
CONFIGURED如果返回,向用户说明:
NOT_CONFIGURED快速设置: 本工具通过执行bash命令来调用Nosy Pandas API、读取配置、扫描媒体文件并在发布后移动文件。默认情况下,Claude Code会要求您批准每个命令——每次发布可能需要6-11次确认。我可以将权限规则添加到您的Claude Code设置文件()中,让这些命令自动获得批准。这些规则的范围被严格限定:~/.claude/settings.json
- 仅允许调用
的APInosypandas.com- 仅允许读写
配置文件~/.pandas- 仅允许在
文件夹中进行文件操作social-media/是否需要我帮您完成设置?
如果用户同意,读取文件,将以下规则合并到数组中(避免重复),然后写回文件:
~/.claude/settings.jsonpermissions.allowjson
"Bash(cat > ~/.pandas *)",
"Bash(chmod 600 ~/.pandas)",
"Bash(grep * ~/.pandas *)",
"Bash(find * social-media *)",
"Bash(curl * https://nosypandas.com/*)",
"Bash(sleep *)",
"Bash(mkdir -p * social-media/*)",
"Bash(mv * social-media/*)"如果用户拒绝,正常继续流程——用户将看到每个命令的确认提示。
Step 1: Verify Configuration & Fetch Accounts
步骤1:验证配置并获取账号
Read and check that is present.
~/.pandasapi_keyIf the file doesn't exist or is missing :
api_key- Ask: "Paste your API key" (tell them to generate one from the dashboard under API Keys)
- Write the values to :
~/.pandas
bash
cat > ~/.pandas << 'EOF'
api_url=https://nosypandas.com/api
api_key=the-pasted-key
media_folder=~/social-media
EOF
chmod 600 ~/.pandasIf the user pastes what looks like an API key without being asked, detect it and offer to save it to .
~/.pandasOnce config is confirmed, read config and fetch accounts in a single call:
bash
PANDAS_API_KEY=$(grep '^api_key=' ~/.pandas 2>/dev/null | cut -d= -f2-) && \
curl -s "https://nosypandas.com/api/accounts" \
-H "Authorization: Bearer $PANDAS_API_KEY" \
-H "Accept: application/json"Response:
json
{
"accounts": [
{ "id": 1, "platform": "twitter", "account_name": "@myhandle" },
{ "id": 2, "platform": "bluesky", "account_name": "@me.bsky.social" }
]
}If no accounts are returned, tell the user to connect accounts via the web dashboard.
读取文件并检查是否存在。
~/.pandasapi_key如果文件不存在或缺少:
api_key- 询问:"请粘贴您的API密钥"(告知用户可在控制台的API Keys页面生成)
- 将值写入文件:
~/.pandas
bash
cat > ~/.pandas << 'EOF'
api_url=https://nosypandas.com/api
api_key=the-pasted-key
media_folder=~/social-media
EOF
chmod 600 ~/.pandas如果用户在未被要求的情况下粘贴了类似API密钥的内容,工具会自动检测并提供保存到的选项。
~/.pandas配置确认后,读取配置并通过单次调用获取账号信息:
bash
PANDAS_API_KEY=$(grep '^api_key=' ~/.pandas 2>/dev/null | cut -d= -f2-) && \
curl -s "https://nosypandas.com/api/accounts" \
-H "Authorization: Bearer $PANDAS_API_KEY" \
-H "Accept: application/json"响应:
json
{
"accounts": [
{ "id": 1, "platform": "twitter", "account_name": "@myhandle" },
{ "id": 2, "platform": "bluesky", "account_name": "@me.bsky.social" }
]
}如果未返回任何账号信息,告知用户需通过网页控制台关联账号。
Step 3: Select Platforms
步骤3:选择平台
Show the user their connected accounts as a numbered list and ask which to post to:
Which platforms do you want to post to?
- Twitter/X (@myhandle)
- Bluesky (@me.bsky.social)
- LinkedIn (My Profile)
After selection, show the character limits and media requirements for the selected platforms using the Platform Reference Table below.
将用户已关联的账号以编号列表形式展示,并询问要发布到哪些平台:
您想要发布到哪些平台?
- Twitter/X (@myhandle)
- Bluesky (@me.bsky.social)
- LinkedIn (我的个人主页)
用户选择后,根据下方的平台参考表,展示所选平台的字符限制和媒体要求。
Step 4: Ask for Content
步骤4:请求内容
Ask: "What do you want to post?"
Show character limits for each selected platform so the user knows constraints before writing. If content exceeds a platform's limit and that platform supports threading (Twitter, Threads, Bluesky), note the content will be auto-split into a thread.
If content exceeds LinkedIn's 3000 character hard limit, warn the user and ask them to shorten it.
询问:"您想要发布什么内容?"
展示每个所选平台的字符限制,让用户在撰写内容前了解约束条件。如果内容超过某平台的限制且该平台支持分帖(Twitter、Threads、Bluesky),需说明内容将自动拆分为多帖。
如果内容超过LinkedIn的3000字符硬限制,需警告用户并要求缩短内容。
Step 5: Platform-Specific Fields
步骤5:平台特定字段
- If YouTube is selected, ask: "What's the video title?" (required, max 500 chars)
- If Pinterest is selected, ask: "What's the destination URL for this pin?" (required, must be a valid URL)
- 如果选择了YouTube,询问:"视频标题是什么?"(必填,最多500字符)
- 如果选择了Pinterest,询问:"此Pin的目标URL是什么?"(必填,必须是有效的URL)
Step 6: Media Selection
步骤6:媒体选择
Scan the configured media folder using :
findbash
MEDIA_DIR="${PANDAS_MEDIA_FOLDER:-$HOME/social-media}"
find "$MEDIA_DIR" -maxdepth 1 -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" -o -iname "*.gif" -o -iname "*.webp" -o -iname "*.mp4" -o -iname "*.mov" -o -iname "*.avi" -o -iname "*.webm" \) 2>/dev/nullIf files are found, list them (distinguishing images vs videos by extension) and ask which to attach. If no files found, ask: "Do you want to attach any media? Provide a file path, or skip."
Important checks before proceeding:
- If a selected platform requires media (Instagram, YouTube, Pinterest, TikTok) and no media is attached, warn the user and ask them to provide media.
- If a selected platform requires video (YouTube, TikTok) and only images are attached, warn the user that video is required.
- Check media counts against the Platform Reference Table limits below and warn about any violations.
- If a platform has and both images and videos are selected, warn the user.
noMix: true - Accepted file types: jpg, jpeg, png, gif, webp (images); mp4, mov, avi, webm (videos).
使用命令扫描配置的媒体文件夹:
findbash
MEDIA_DIR="${PANDAS_MEDIA_FOLDER:-$HOME/social-media}"
find "$MEDIA_DIR" -maxdepth 1 -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" -o -iname "*.gif" -o -iname "*.webp" -o -iname "*.mp4" -o -iname "*.mov" -o -iname "*.avi" -o -iname "*.webm" \) 2>/dev/null如果找到文件,列出它们(按扩展名区分图片和视频)并询问要附加哪些。如果未找到文件,询问:"是否要附加媒体文件?提供文件路径,或跳过。"
继续操作前的重要检查:
- 如果所选平台要求媒体(Instagram、YouTube、Pinterest、TikTok)但未附加任何媒体,需警告用户并要求提供媒体文件。
- 如果所选平台要求视频(YouTube、TikTok)但仅附加了图片,需警告用户该平台要求视频。
- 根据下方的平台参考表检查媒体数量是否符合限制,并对违规情况发出警告。
- 如果平台设置了且同时选择了图片和视频,需警告用户。
noMix: true - 支持的文件类型:jpg、jpeg、png、gif、webp(图片);mp4、mov、avi、webm(视频)。
Step 7: Schedule or Publish Now
步骤7:立即发布或排期
Ask: "Publish now or schedule for later?"
If scheduling, ask for the date and time. Accept natural language like "tomorrow at 9am" and convert to ISO 8601 format. Also ask for timezone if not obvious.
询问:"立即发布还是排期至稍后发布?"
如果选择排期,询问日期和时间。接受自然语言输入(如"明天上午9点")并转换为ISO 8601格式。如果时区不明确,需询问时区。
Step 8: Confirmation Summary
步骤8:确认摘要
Show a summary with any applicable warnings:
Content: [first 100 chars...]
Media: [count] files ([list filenames])
Platforms: Twitter, Bluesky
Timing: Publish now
Title: [if YouTube]
Link URL: [if Pinterest]
Warnings:
- Twitter: Content will be split into a thread (exceeds 280 chars)Ask: "Look good? (yes/no)"
展示包含所有适用警告的摘要:
内容:[前100个字符...]
媒体:[数量]个文件([文件名列表])
平台:Twitter、Bluesky
发布时间:立即发布
标题:[如果是YouTube]
链接URL:[如果是Pinterest]
警告:
- Twitter:内容将拆分为多帖(超过280字符限制)询问:"看起来没问题吗?(是/否)"
Step 9: Execute Post
步骤9:执行发布
This step has two parts: stage media (if any), then create the post.
此步骤分为两部分:暂存媒体(如有),然后创建帖子。
Step 9a: Stage Media, Create Post & Check Status
步骤9a:暂存媒体、创建帖子并检查状态
Run all of media staging, post creation, and status checking in a single bash call. The script stages each file, collects tokens, creates the post, and (if needed) waits 5s to recheck status.
For posts with media:
bash
PANDAS_API_KEY=$(grep '^api_key=' ~/.pandas 2>/dev/null | cut -d= -f2-) && \
PANDAS_API_URL="https://nosypandas.com/api" && \
TOKENS="" && \
for FILE in /path/to/file1.jpg /path/to/file2.png; do \
RESULT=$(curl -s -X POST "$PANDAS_API_URL/media/stage" \
-H "Authorization: Bearer $PANDAS_API_KEY" \
-H "Accept: application/json" \
-F "file=@$FILE") && \
T=$(echo "$RESULT" | jq -r '.token') && \
TOKENS="${TOKENS:+$TOKENS,}\"$T\""; \
done && \
POST_RESULT=$(curl -s -X POST "$PANDAS_API_URL/posts" \
-H "Authorization: Bearer $PANDAS_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d "{
\"content\": \"POST_CONTENT\",
\"platforms\": [ACCOUNT_ID_1, ACCOUNT_ID_2],
\"publish_now\": true,
\"media_tokens\": [$TOKENS]
}") && \
echo "$POST_RESULT" && \
POST_ID=$(echo "$POST_RESULT" | jq -r '.post.id') && \
HAS_PENDING=$(echo "$POST_RESULT" | jq '[.post.platforms[] | select(.status == "pending" or .status == "publishing" or (.status == "failed" and (.error == null or .error == "")))] | length') && \
if [ "$HAS_PENDING" -gt 0 ]; then \
sleep 5 && \
curl -s "$PANDAS_API_URL/posts/$POST_ID" \
-H "Authorization: Bearer $PANDAS_API_KEY" \
-H "Accept: application/json"; \
fiFor posts without media:
bash
PANDAS_API_KEY=$(grep '^api_key=' ~/.pandas 2>/dev/null | cut -d= -f2-) && \
PANDAS_API_URL="https://nosypandas.com/api" && \
POST_RESULT=$(curl -s -X POST "$PANDAS_API_URL/posts" \
-H "Authorization: Bearer $PANDAS_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"content": "POST_CONTENT",
"platforms": [ACCOUNT_ID_1, ACCOUNT_ID_2],
"publish_now": true
}') && \
echo "$POST_RESULT" && \
POST_ID=$(echo "$POST_RESULT" | jq -r '.post.id') && \
HAS_PENDING=$(echo "$POST_RESULT" | jq '[.post.platforms[] | select(.status == "pending" or .status == "publishing" or (.status == "failed" and (.error == null or .error == "")))] | length') && \
if [ "$HAS_PENDING" -gt 0 ]; then \
sleep 5 && \
curl -s "$PANDAS_API_URL/posts/$POST_ID" \
-H "Authorization: Bearer $PANDAS_API_KEY" \
-H "Accept: application/json"; \
fiOptional fields (add to the JSON when applicable):
- — for YouTube
"title": "VIDEO_TITLE" - — for Pinterest
"link_url": "https://example.com" - — for scheduled posts (omit
"scheduled_at": "2026-03-16T09:00:00Z"or set topublish_now)false - — timezone for scheduled posts
"timezone": "America/New_York"
Stage response (201):
json
{
"token": "stg_abc123...",
"original_filename": "photo.jpg",
"type": "image",
"expires_at": "2026-03-16T14:00:00+00:00"
}Tokens are valid for 2 hours.
Post response (201):
json
{
"post": {
"id": 42,
"content": "Hello world!",
"status": "published",
"platforms": [
{ "platform": "twitter", "status": "published", "url": "https://x.com/..." },
{ "platform": "bluesky", "status": "published", "url": "https://bsky.app/..." }
]
}
}Some platforms (especially Threads) take time to process. The script automatically does one 5-second recheck if any platform has a non-terminal status (, , or with no error). Do not add additional retries — the server handles verification via background jobs and webhooks.
pendingpublishingfailed将媒体暂存、帖子创建和状态检查全部通过单次bash调用完成。脚本会暂存每个文件、收集令牌、创建帖子,并在需要时等待5秒重新检查状态。
对于包含媒体的帖子:
bash
PANDAS_API_KEY=$(grep '^api_key=' ~/.pandas 2>/dev/null | cut -d= -f2-) && \
PANDAS_API_URL="https://nosypandas.com/api" && \
TOKENS="" && \
for FILE in /path/to/file1.jpg /path/to/file2.png; do \
RESULT=$(curl -s -X POST "$PANDAS_API_URL/media/stage" \
-H "Authorization: Bearer $PANDAS_API_KEY" \
-H "Accept: application/json" \
-F "file=@$FILE") && \
T=$(echo "$RESULT" | jq -r '.token') && \
TOKENS="${TOKENS:+$TOKENS,}\"$T\""; \
done && \
POST_RESULT=$(curl -s -X POST "$PANDAS_API_URL/posts" \
-H "Authorization: Bearer $PANDAS_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d "{
\"content\": \"POST_CONTENT\",
\"platforms\": [ACCOUNT_ID_1, ACCOUNT_ID_2],
\"publish_now\": true,
\"media_tokens\": [$TOKENS]
}") && \
echo "$POST_RESULT" && \
POST_ID=$(echo "$POST_RESULT" | jq -r '.post.id') && \
HAS_PENDING=$(echo "$POST_RESULT" | jq '[.post.platforms[] | select(.status == "pending" or .status == "publishing" or (.status == "failed" and (.error == null or .error == "")))] | length') && \
if [ "$HAS_PENDING" -gt 0 ]; then \
sleep 5 && \
curl -s "$PANDAS_API_URL/posts/$POST_ID" \
-H "Authorization: Bearer $PANDAS_API_KEY" \
-H "Accept: application/json"; \
fi对于不包含媒体的帖子:
bash
PANDAS_API_KEY=$(grep '^api_key=' ~/.pandas 2>/dev/null | cut -d= -f2-) && \
PANDAS_API_URL="https://nosypandas.com/api" && \
POST_RESULT=$(curl -s -X POST "$PANDAS_API_URL/posts" \
-H "Authorization: Bearer $PANDAS_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"content": "POST_CONTENT",
"platforms": [ACCOUNT_ID_1, ACCOUNT_ID_2],
"publish_now": true
}') && \
echo "$POST_RESULT" && \
POST_ID=$(echo "$POST_RESULT" | jq -r '.post.id') && \
HAS_PENDING=$(echo "$POST_RESULT" | jq '[.post.platforms[] | select(.status == "pending" or .status == "publishing" or (.status == "failed" and (.error == null or .error == "")))] | length') && \
if [ "$HAS_PENDING" -gt 0 ]; then \
sleep 5 && \
curl -s "$PANDAS_API_URL/posts/$POST_ID" \
-H "Authorization: Bearer $PANDAS_API_KEY" \
-H "Accept: application/json"; \
fi可选字段(适用时添加到JSON中):
- — 适用于YouTube
"title": "VIDEO_TITLE" - — 适用于Pinterest
"link_url": "https://example.com" - — 适用于排期帖子(省略
"scheduled_at": "2026-03-16T09:00:00Z"或设为publish_now)false - — 排期帖子的时区
"timezone": "America/New_York"
暂存响应(201):
json
{
"token": "stg_abc123...",
"original_filename": "photo.jpg",
"type": "image",
"expires_at": "2026-03-16T14:00:00+00:00"
}令牌有效期为2小时。
帖子创建响应(201):
json
{
"post": {
"id": 42,
"content": "Hello world!",
"status": "published",
"platforms": [
{ "platform": "twitter", "status": "published", "url": "https://x.com/..." },
{ "platform": "bluesky", "status": "published", "url": "https://bsky.app/..." }
]
}
}部分平台(尤其是Threads)需要时间处理。如果任何平台处于非最终状态(、或无错误的),脚本会自动进行一次5秒的重新检查。无需添加额外重试——服务器会通过后台任务和webhooks处理验证。
pendingpublishingfailedStep 10: Display Results
步骤10:展示结果
Show the result per platform:
- Success: "Twitter/X: Published — https://x.com/..."
- Pending: "LinkedIn: Pending — check back shortly"
- Failed: "Instagram: Failed — Instagram requires media."
- Still processing: "Threads: Still processing — check your dashboard for the final status."
按平台展示结果:
- 成功:"Twitter/X: 已发布 — https://x.com/..."
- 待处理:"LinkedIn: 待处理 — 请稍后查看"
- 失败:"Instagram: 发布失败 — Instagram要求附加媒体。"
- 处理中:"Threads: 处理中 — 请查看控制台获取最终状态。"
Step 11: Move Media
步骤11:移动媒体文件
After successful posting, move all used media files to a subfolder in a single call:
posted/bash
MEDIA_DIR="${PANDAS_MEDIA_FOLDER:-$HOME/social-media}" && \
mkdir -p "$MEDIA_DIR/posted/" && \
mv "$MEDIA_DIR/file1.jpg" "$MEDIA_DIR/file2.png" "$MEDIA_DIR/posted/"List all used files as arguments to a single command.
mv发布成功后,将所有使用过的媒体文件通过单次调用移动到子文件夹:
posted/bash
MEDIA_DIR="${PANDAS_MEDIA_FOLDER:-$HOME/social-media}" && \
mkdir -p "$MEDIA_DIR/posted/" && \
mv "$MEDIA_DIR/file1.jpg" "$MEDIA_DIR/file2.png" "$MEDIA_DIR/posted/"将所有使用过的文件作为参数传递给单个命令。
mvPost History Flow
帖子历史流程
Fetch recent posts:
bash
curl -s "$PANDAS_API_URL/posts" \
-H "Authorization: Bearer $PANDAS_API_KEY" \
-H "Accept: application/json"Returns paginated posts with platform statuses. Display as a table showing post ID, content preview, status, and platform results.
获取近期帖子:
bash
curl -s "$PANDAS_API_URL/posts" \
-H "Authorization: Bearer $PANDAS_API_KEY" \
-H "Accept: application/json"返回带平台状态的分页帖子。以表格形式展示帖子ID、内容预览、状态和平台结果。
Post Detail Flow
帖子详情流程
Check a specific post's full details:
bash
curl -s "$PANDAS_API_URL/posts/POST_ID" \
-H "Authorization: Bearer $PANDAS_API_KEY" \
-H "Accept: application/json"Response:
json
{
"post": {
"id": 42,
"content": "Hello world!",
"title": null,
"status": "published",
"scheduled_at": null,
"created_at": "2026-03-15T12:00:00Z",
"platforms": [
{ "platform": "twitter", "status": "published", "url": "https://x.com/...", "error": null }
],
"media": [
{ "url": "https://cdn.example.com/file.jpg", "type": "image", "filename": "photo.jpg" }
]
}
}查看特定帖子的完整详情:
bash
curl -s "$PANDAS_API_URL/posts/POST_ID" \
-H "Authorization: Bearer $PANDAS_API_KEY" \
-H "Accept: application/json"响应:
json
{
"post": {
"id": 42,
"content": "Hello world!",
"title": null,
"status": "published",
"scheduled_at": null,
"created_at": "2026-03-15T12:00:00Z",
"platforms": [
{ "platform": "twitter", "status": "published", "url": "https://x.com/...", "error": null }
],
"media": [
{ "url": "https://cdn.example.com/file.jpg", "type": "image", "filename": "photo.jpg" }
]
}
}Retry Flow
重试流程
Retry a failed post:
bash
curl -s -X POST "$PANDAS_API_URL/posts/POST_ID/retry" \
-H "Authorization: Bearer $PANDAS_API_KEY" \
-H "Accept: application/json"Response:
json
{
"post": {
"id": 42,
"status": "pending"
}
}Only posts with status can be retried. If the post is not in a failed state, the API will return a 404.
failed重试发布失败的帖子:
bash
curl -s -X POST "$PANDAS_API_URL/posts/POST_ID/retry" \
-H "Authorization: Bearer $PANDAS_API_KEY" \
-H "Accept: application/json"响应:
json
{
"post": {
"id": 42,
"status": "pending"
}
}仅状态为的帖子可重试。如果帖子未处于失败状态,API会返回404。
failedDelete Flow
删除流程
Delete a scheduled or failed post. Only posts with or status can be deleted — published posts cannot be removed.
scheduledfailed删除已排期或发布失败的帖子。仅状态为或的帖子可删除——已发布的帖子无法删除。
scheduledfailedStep 1: Identify the Post
步骤1:识别帖子
Use the Detail flow to fetch the post and confirm its status is or . Show the post summary to the user and ask for confirmation:
scheduledfailedAre you sure you want to delete this post? Content: [first 100 chars...] Status: scheduled Platforms: Twitter, Bluesky
使用详情流程获取帖子信息并确认其状态为或。向用户展示帖子摘要并请求确认:
scheduledfailed您确定要删除此帖子吗? 内容:[前100个字符...] 状态:已排期 平台:Twitter、Bluesky
Step 2: Send Delete Request
步骤2:发送删除请求
bash
curl -s -X DELETE "$PANDAS_API_URL/posts/POST_ID" \
-H "Authorization: Bearer $PANDAS_API_KEY" \
-H "Accept: application/json"Response (200):
json
{
"message": "Post deleted."
}bash
curl -s -X DELETE "$PANDAS_API_URL/posts/POST_ID" \
-H "Authorization: Bearer $PANDAS_API_KEY" \
-H "Accept: application/json"响应(200):
json
{
"message": "Post deleted."
}Step 3: Display Confirmation
步骤3:展示确认信息
Show: "Post #POST_ID has been deleted."
If the API returns 404, the post either doesn't exist or is in a non-deletable status (e.g., published). Inform the user accordingly.
展示:"帖子#POST_ID已被删除。"
如果API返回404,说明帖子不存在或处于不可删除状态(如已发布)。需相应告知用户。
Platform Reference Table
平台参考表
| Platform | Max Content | Threading | Requires Media | Requires Video | Max Images | Max Videos | No Mix |
|---|---|---|---|---|---|---|---|
| Twitter/X | 280 chars | Yes | No | No | 4 | 1 | Yes |
| Bluesky | 300 chars | Yes | No | No | 4 | 1 | No |
| Threads | 500 chars | Yes | No | No | 10 | 1 | No |
| None | No | Yes | No | 10 | 1 | No | |
| 3000 chars | No | No | No | 20 | 1 | No | |
| YouTube | None | No | Yes | Yes | 0 | 1 | No |
| None | No | Yes | No | 1 | 1 | Yes | |
| TikTok | None | No | Yes | Yes | 35 | 1 | Yes |
Notes:
- "Threading" means content exceeding the character limit is auto-split into a thread.
- "No Mix" means the platform does not allow images and videos in the same post.
- YouTube requires a field (max 500 chars). Pinterest requires a
titlefield.link_url - YouTube and TikTok require at least one video file — images alone will be rejected.
- Accepted file types: jpg, jpeg, png, gif, webp (images); mp4, mov, avi, webm (videos).
| 平台 | 内容最大长度 | 支持分帖 | 要求媒体 | 要求视频 | 最大图片数 | 最大视频数 | 不可混合 |
|---|---|---|---|---|---|---|---|
| Twitter/X | 280字符 | 是 | 否 | 否 | 4 | 1 | 是 |
| Bluesky | 300字符 | 是 | 否 | 否 | 4 | 1 | 否 |
| Threads | 500字符 | 是 | 否 | 否 | 10 | 1 | 否 |
| 无限制 | 否 | 是 | 否 | 10 | 1 | 否 | |
| 3000字符 | 否 | 否 | 否 | 20 | 1 | 否 | |
| YouTube | 无限制 | 否 | 是 | 是 | 0 | 1 | 否 |
| 无限制 | 否 | 是 | 否 | 1 | 1 | 是 | |
| TikTok | 无限制 | 否 | 是 | 是 | 35 | 1 | 是 |
说明:
- "支持分帖"指内容超过字符限制时会自动拆分为多帖。
- "不可混合"指该平台不允许在同一帖子中同时包含图片和视频。
- YouTube要求字段(最多500字符)。Pinterest要求
title字段。link_url - YouTube和TikTok要求至少一个视频文件——仅图片会被拒绝。
- 支持的文件类型:jpg、jpeg、png、gif、webp(图片);mp4、mov、avi、webm(视频)。
Error Handling
错误处理
| Status | Meaning | Recovery |
|---|---|---|
| 401 | Invalid API key | Check |
| 403 | Subscription required | Subscribe at the dashboard |
| 404 | Post not found or not retryable | Verify the post ID and that its status is |
| 422 | Validation error | Show the specific error messages from the response body and help the user fix them |
| 500 | Server error | Try again later |
| 状态码 | 含义 | 恢复方法 |
|---|---|---|
| 401 | API密钥无效 | 检查 |
| 403 | 需要订阅 | 在控制台订阅服务 |
| 404 | 帖子不存在或不可重试 | 验证帖子ID及其状态是否为 |
| 422 | 验证错误 | 展示响应体中的具体错误信息并帮助用户修复 |
| 500 | 服务器错误 | 稍后重试 |