TikTok
Profil, video dan publikasi TikTok, ditambah komentar dan DM lewat Business API
Eksperimental v0.3.0 Node.js 19 aksi Risiko ToS sedang
Tentang
Plugin Graphrt untuk API TikTok resmi. Plugin ini memakai dua API TikTok.
Yang bisa dilakukan
- Profile and videos: user info, list videos (cursor paging), query videos by id, creator posting settings
- Publishing: - Post a video from a URL, directly or as an inbox draft. - Post 1–35 photos, directly or as an inbox upload. - Each publish checks the privacy level against creator_info first, then waits for TikTok to finish (polls every 5 s, up to 5 min).
- Token refresh (node only): refresh_access_token returns the rotated access and refresh tokens. It isn't offered to agents as a tool, so tokens never reach an LLM
- Comments (Business API): list, list replies, comment, reply, hide/unhide, like/unlike, delete
- Messages (Business API): list conversations, list messages, send a text message
- api_request: any other endpoint, with api: open or api: business, restricted to that API's host
- TikTok errors are mapped to stable kinds, including errors sent inside HTTP 200 bodies. Tokens never appear in errors.
Aksi
Setiap aksi adalah langkah yang bisa ditambahkan ke workflow. Agent juga bisa memakai sebagian besar aksi sebagai tool.
- Get TikTok user info
tiktok-api.get_user_info - List TikTok videos
tiktok-api.list_videos - Query TikTok videos
tiktok-api.query_videos - Get TikTok creator info
tiktok-api.get_creator_info - Refresh TikTok access token
tiktok-api.refresh_access_token - Publish TikTok video
tiktok-api.publish_video - Publish TikTok photos
tiktok-api.publish_photos - Get TikTok publish status
tiktok-api.get_publish_status - List TikTok comments
tiktok-api.list_comments - List TikTok comment replies
tiktok-api.list_comment_replies
Tampilkan semua 19 aksi
- Comment on TikTok video
tiktok-api.create_comment - Reply to TikTok comment
tiktok-api.reply_to_comment - Hide/unhide TikTok comment
tiktok-api.set_comment_hidden - Like/unlike TikTok comment
tiktok-api.set_comment_liked - Delete TikTok comment
tiktok-api.delete_comment - List TikTok conversations
tiktok-api.list_conversations - List TikTok messages
tiktok-api.list_messages - Send TikTok message
tiktok-api.send_message - TikTok API request
tiktok-api.api_request
Pengaturan
Graphrt menyalakan plugin dengan environment yang bersih. Hanya nilai ini yang sampai ke plugin, dan secret tidak masuk log.
-
TIKTOK_ACCESS_TOKENFor Open API operationsUser access token (Bearer). It is short-lived (see expires_in), refresh it with refresh_access_token -
TIKTOK_BUSINESS_ACCESS_TOKENFor comment and message operationsBusiness API access token (Access-Token header) -
TIKTOK_BUSINESS_IDFor comment and message operationsDefault business_id (the business account's open_id) -
TIKTOK_CLIENT_KEYFor refresh_access_tokenApp client key (can also be passed as client_key) -
TIKTOK_CLIENT_SECRETFor refresh_access_tokenApp client secret. Env only, never an argument -
TIKTOK_REFRESH_TOKENOpsionalDefault refresh token for refresh_access_token -
TIKTOK_TOOL_ALLOW_POSTOpsional1 lets agent tools post directly (mode=direct), comment and reply (see Agent policy) -
TIKTOK_TOOL_ALLOW_ENGAGEOpsional1 lets agent tools hide, unhide, like and unlike comments -
TIKTOK_TOOL_ALLOW_DMOpsional1 lets agent tools send_message -
TIKTOK_API_TOOL_TOKEN_SOURCE
Cara memakainya
Di Graphrt Desktop
- Buka Plugins dan cari TikTok.
- Klik Install lalu setujui.
- Ikuti langkah setup di halaman plugin, lalu tempel pengaturan yang dibutuhkan.
- Jelaskan pekerjaan yang membutuhkannya, dan builder menambahkan langkahnya.
Dengan CLI
terminal
$ graphrt plugin install tiktok-api --yes workflow.yaml
- id: post
type: tiktok-api.publish_video
video_url: "https://media.example.com/clips/launch.mp4"
post_title: "Launch day #fyp"
privacy_level: SELF_ONLY
- id: reply
type: tiktok-api.reply_to_comment
video_id: "{{#start.video_id#}}"
comment_id: "{{#start.comment_id#}}"
text: "Thank you!"