AI GrowthAI content creation toolkit

After writing an article, auto-generate a Tencent Doc

No prior experience required · Windows users · WorkBuddy + Python + Tencent Docs Open API
After AI writes the article, write it directly into Tencent Docs with one command
📋 Instructions
  1. Content in the gray box = Copy and paste directly into the WorkBuddy dialog boxinstructions for
  2. Start from step one in order, and proceed to the next step only after completing each one
  3. Steps 1 and 2 only need to be done once (environment setup); after that, each document generation only requires Step 4
  4. If you run into problems, see the FAQ at the bottom
🗺️ Overall Process Overview
Register on the Open Platform → Get Client ID / Secret → Configure Python Environment → AI writes the article → One-click write to Tencent Docs

Configure once, and after that each document generation only takes one sentence.

ℹ️ About the Tencent Docs Open API:Tencent Docs provides OAuth2.0 authorization + RESTful API, supporting creation of online documents, writing formatted content, file management, and more. Documentation URL:docs.qq.com/open/document/app。

Step 1: Register on the Open Platform and get your Client ID and Client Secret

Just as a WeChat Official Account needs an AppID and AppSecret, Tencent Docs also requires a pair of keys to call the API.

1.1 Register as a developer

1
Open your browser and visit the Tencent Docs Open Cooperation Platform:
https://docs.qq.com/open/developers/
2
After logging in, click"Create Application", fill in the application name (e.g., "AI Smart Document Assistant"), and submit for review.
3
After approval, go to the application details page, where you will see two key pieces of information:
Parameter nameDescriptionPurpose
Client IDUnique application identifierRequired for both authorization and API calls
Client SecretApplication secret (keep confidential!)Used when exchanging for an Access Token
4
SettingsCallback URL(Callback URL), enter:http://localhost:8080/callback(this is fine for local development).
⚠️ Client Secret must be kept confidential!It is only used in backend services and must never be exposed to the frontend or made public. If leaked, reset it on the Open Platform.
✅ Once you have your Client ID and Client Secret, proceed to the next step!

Step 2: Configure the Python environment

Copy the following message and send it to WorkBuddy, and it will help you set up the entire environment with one click:

📦 Dialog box commands Copy, paste, then modify
帮我配置腾讯文档自动生成环境:

Client ID:在这里填你的Client ID
Client Secret:在这里填你的Client Secret
回调地址:http://localhost:8080/callback

请帮我:
1. 创建 Python 虚拟环境并安装依赖(requests、flask、python-dotenv)
2. 创建配置文件 .env 保存 Client ID 和 Client Secret
3. 创建授权脚本 auth_server.py(启动本地 Flask 服务完成 OAuth 授权)
4. 创建文档生成脚本 tencent_docs.py(支持创建文档 + 写入内容)
5. 测试配置是否正常
💡 Replace "fill in xxx here" with your real information, then send it to WorkBuddy

2.1 Complete OAuth authorization

On first use, you need to authorize manually once to obtain Access Token(valid for 30 days). After that, WorkBuddy will automatically refresh the Token, so no repeated action is needed.

📦 Dialog box commands Copy and paste
启动腾讯文档 OAuth 授权流程,获取 Access Token。
💡 WorkBuddy will give you a link. Open it in your browser, log in to Tencent Docs and click "Agree to authorize", and the Token is obtained

2.2 Verify the environment

📦 Dialog box commands Copy and paste
测试腾讯文档 API 连接是否正常,验证 Access Token 是否有效。
💡 If you see "Connection successful, user information retrieved normally", the configuration is correct
✅ Authorization complete! You can now start writing documents.

Step 3: Customize document content and format

Tell WorkBuddy what you want to write, and it will generate the content and write it into Tencent Docs via API.

Option 1: Let AI write the full content

📦 Dialog box commands Copy, paste, then modify
帮我写一篇文章,并自动创建为腾讯文档:

主题:在这里写主题(比如:2024年AI行业年度总结)
风格:专业、简洁,适合内部汇报
字数:不少于2000字
结构要求:
- 开篇摘要
- 3-5个章节,每章有明确标题
- 关键数据用加粗标注
- 结尾附总结与展望
文档标题:在这里写文档标题
💡 Replace "write xxx here" with your requirement

Option 2: You already have content and only need to write it into Tencent Docs

📦 Dialog box commands Copy, paste, then modify
帮我把下面这段内容写入腾讯文档:

文档标题:在这里填标题
正文:
(在这里粘贴你的文章内容)

格式要求:
- 标题用二号、加粗
- 正文用四号
- 重要内容用蓝色背景高亮
- 段落间保留间距
💡 Markdown format is supported, and WorkBuddy will automatically convert it to Tencent Docs format

Option 3: Import a Markdown file directly

📦 Dialog box commands Copy, paste, then modify
帮我把下面这个 Markdown 文件导入到腾讯文档:
C:\Users\你的用户名\Desktop\我的文章.md
文档标题:在这里填标题
💡 WorkBuddy will read the file, parse the Markdown format and write it into Tencent Docs

Step 4: One-click generation of Tencent Docs (most commonly used!)

Once the environment is set up, you only need to say this sentence each time:

📦 Dialog box commands Copy and paste
帮我写一篇文章,自动创建为腾讯文档。
💡 Done in one sentence: AI writing → call API to create document → write content and format

After successful execution, WorkBuddy will return the document link, like this:

# 生成成功示例输出
✓ 文档创建成功!
  文档ID: DQWxxxxxxx
  链接: https://docs.qq.com/doc/DQWxxxxxxx
✓ 已写入 2150 字,共 5 个章节
✓ 格式设置完成(标题加粗、段落缩进、关键内容高亮)
ℹ️ The generated document is stored underyour Tencent Docs account. Open the link directly to view and edit it, or share the link with colleagues for collaboration.

Where to view it after generation?

Open docs.qq.com, log in to the same account, and you will see the document just generated in "My Documents".

Step 5: Set up scheduled automatic document generation

📦 Dialog box commands Copy, paste, then modify
帮我创建一个每天自动写文章并生成腾讯文档的定时任务:

执行时间:每天上午9点
内容主题:每日科技资讯汇总,每次不重复
文章风格:简洁专业,适合团队周报
输出位置:腾讯文档(默认目录)
💡 WorkBuddy will create an automation task and execute it automatically on schedule
About automation:WorkBuddy's automation feature requires the computer to stay powered on and WorkBuddy to be running. The Access Token is valid for 30 days, and WorkBuddy will refresh it automatically, so no need to worry about expiration.

Common Commands Quick Reference

What you want to doCopy this text
Write an article and generate Tencent Docs帮我写一篇关于"xxx"的文章,创建为腾讯文档。
Import Markdown into Tencent Docs把"xxx.md"导入为腾讯文档。
Batch generate multiple documents帮我写3篇关于"xxx"不同角度的文章,分别创建为腾讯文档。
Update existing document content更新腾讯文档 xxx 的内容,把第二章改成"xxx"。
List my documents列出我腾讯文档账号里的最近10个文档。
Copy document把腾讯文档 xxx 复制一份。
Test API connection测试腾讯文档 API 连接是否正常。
Refresh Token检查并刷新腾讯文档 Access Token。
Modify default format修改腾讯文档生成脚本,默认字体改为"微软雅黑",字号14px。
View scheduled tasks查看当前有哪些自动化任务在运行。

FAQ

❓ What to do if "invalid_client" error occurs?

The Client ID or Client Secret is incorrect. Check that you copied them completely and watch out for extra spaces. If you're sure they're correct, go to the open platform to reset the Client Secret and try again:

📦 Dialog box commands Copy, paste, then modify
更新腾讯文档 Client Secret:在这里填新的Secret

❓ What to do if the Access Token expires?

The Access Token is valid for 30 days. WorkBuddy automatically refreshes it using the Refresh Token, so manual action is usually unnecessary. If it does expire:

📦 Dialog box commands Copy and paste
刷新腾讯文档 Access Token。

❓ What to do if the user cancels authorization?

If the user cancels third-party authorization in Tencent Docs settings, re-authorization is required:

📦 Dialog box commands Copy and paste
重新执行腾讯文档 OAuth 授权流程。

❓ Document generated successfully but the content format is wrong?

The Tencent Docs v3 API uses JSON format to describe document structure (paragraphs, text, styles). If you find the format is wrong, you can ask WorkBuddy to adjust it:

📦 Dialog box commands Copy, paste, then modify
调整腾讯文档生成格式:
- 标题改为"一号、加粗、蓝色"
- 正文改为"四号、宋体"
- 段落首行缩进2字符
- 代码块用灰色背景

❓ Is there a limit on the number of documents?

Tencent Docs Open API provides each app with 20,000 free API calls(starting July 2025), which is enough for daily use. Contact the official team if you need more capacity.

❓ How to generate to a specified folder?

📦 Dialog box commands Copy, paste, then modify
帮我写一篇关于"xxx"的文章,创建到腾讯文档的"周报"文件夹里。

❓ Scheduled task didn't run?

📦 Dialog box commands Copy and paste
检查每日腾讯文档生成定时任务状态,查看上次执行时间和下次执行时间。

The core is just one sentence:Once the API environment is configured, just tell WorkBuddy in plain language what to write. It will write the article, call the Tencent Docs API to create the document, and write the formatted content—no manual steps required.
Configuration parameters quick reference
Configuration itemDescriptionWhere to find it
Client IDUnique application identifierOpen Platform → App Details
Client SecretApplication secret (keep confidential!)Same as above, generated when creating the app
Callback URLOAuth callback URLhttp://localhost:8080/callback
Access TokenAPI call credential (30 days)Automatically obtained after OAuth authorization
Refresh TokenRefresh credential (1 year)Obtained together with the Access Token
API documentationAPI referencedocs.qq.com/open/document/app
Scan the QR code to follow
Scan the QR code to follow