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
Help me set up the Tencent Docs auto-generation environment:

Client ID: enter your Client ID here
Client Secret: enter your Client Secret here
Callback URL: http://localhost:8080/callback

Please help me:
1. Create a Python virtual environment and install dependencies (requests, flask, python-dotenv)
2. Create a config file .env to store the Client ID and Client Secret
3. Create an authorization script auth_server.py (start a local Flask service to complete OAuth authorization)
4. Create a document generation script tencent_docs.py (supports creating documents + writing content)
5. Test whether the configuration works properly
💡 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
Start the Tencent Docs OAuth authorization flow and obtain the 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
Test whether the Tencent Docs API connection works properly and verify whether the Access Token is valid.
💡 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
Help me write an article and automatically create it as a Tencent Doc:

Topic: write the topic here (e.g., 2024 AI Industry Annual Summary)
Style: professional and concise, suitable for internal reporting
Word count: no less than 2000 words
Structure requirements:
- Opening summary
- 3-5 chapters, each with a clear heading
- Key data in bold
- Closing summary and outlook
Document title: write the document title here
💡 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
Help me write the following content into a Tencent Doc:

Document title: enter the title here
Body:
(paste your article content here)

Formatting requirements:
- Title in size 2, bold
- Body in size 4
- Important content highlighted with a blue background
- Keep spacing between paragraphs
💡 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
Help me import the following Markdown file into a Tencent Doc:
C:\Users\your username\Desktop\my article.md
Document title: enter the title here
💡 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
Help me write an article and automatically create it as a Tencent Doc.
💡 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:

# Example output of successful generation
✓ Document created successfully!
  Document ID: DQWxxxxxxx
  Link: https://docs.qq.com/doc/DQWxxxxxxx
✓ Wrote 2150 words across 5 chapters
✓ Formatting completed (bold headings, paragraph indentation, key content highlighted)
ℹ️ 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
Help me create a scheduled task that automatically writes an article and generates a Tencent Doc every day:

Execution time: 9 AM every day
Content topic: daily tech news roundup, different each time
Article style: concise and professional, suitable for team weekly reports
Output location: Tencent Docs (default directory)
💡 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 DocsHelp me write an article about "xxx" and create it as a Tencent Doc.
Import Markdown into Tencent DocsImport "xxx.md" as a Tencent Doc.
Batch generate multiple documentsHelp me write 3 articles about "xxx" from different angles and create each as a Tencent Doc.
Update existing document contentUpdate the content of Tencent Doc xxx and change Chapter 2 to "xxx".
List my documentsList the 10 most recent documents in my Tencent Docs account.
Copy documentMake a copy of Tencent Doc xxx.
Test API connectionTest whether the Tencent Docs API connection works properly.
Refresh TokenCheck and refresh the Tencent Docs Access Token.
Modify default formatModify the Tencent Docs generation script to change the default font to "Microsoft YaHei" and the font size to 14px.
View scheduled tasksCheck which automation tasks are currently running.

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
Update the Tencent Docs Client Secret: enter the new Secret here

❓ 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
Refresh the Tencent Docs 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
Re-run the Tencent Docs OAuth authorization flow.

❓ 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
Adjust the Tencent Docs generation format:
- Change the title to "Size 1, bold, blue"
- Change the body text to "Size 4, SimSun"
- Indent the first line of paragraphs by 2 characters
- Use a gray background for code blocks

❓ 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
Help me write an article about "xxx" and create it in the "Weekly Report" folder in Tencent Docs.

❓ Scheduled task didn't run?

📦 Dialog box commands Copy and paste
Check the status of the daily Tencent Docs generation scheduled task, and view the last execution time and next execution time.

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