Developer Access
Generate a token and pull your subscribed messages with the API.
Use the developer API if you want to sync subscribed WeChat messages into your own system.
Good fit for
- Internal dashboards or reporting tools
- Feishu, WeCom, or bot notifications
- Knowledge bases, vector stores, or AI workflows
- Scheduled polling and automated classification
Requirements
Before using the API, make sure you have already done both:
- Subscribed to at least one official account from the web app
- Created a site-wide API key from the web app
How to create an API key
- Sign in
- Open "API Key management" from the profile menu or the standalone API Key page
- Create a new API key
- Copy and store the key safely
You can now reveal and copy the full API key again from the dashboard later. Keep it secure and avoid exposing it in logs or screenshots. The same key also works for the MD import API.
Endpoint
GET https://api.fafafa.ai/api/v1/wechat/messages
The full production endpoint above is filled in automatically by the system, so you can copy it directly. Its domain comes from the system environment variable WORKER_PUBLIC_BASE_URL, then /api/v1/wechat/messages is appended automatically.
Authentication
Use a Bearer API key:
Authorization: Bearer YOUR_API_KEY
Common query parameters
| Parameter | Description |
|---|---|
page | Page number for initial sync |
pageSize | Number of items per page |
since | Pull only messages newer than a given timestamp |
Example request
curl 'https://api.fafafa.ai/api/v1/wechat/messages?page=1&pageSize=20' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Accept: application/json'
Recommended integration pattern
Initial sync
Start with paginated requests to collect the message history you can access.
Incremental sync
Store the timestamp of the last successful poll and use since to fetch only new messages.
Idempotent processing
If you store messages in your own system, deduplicate by article identifier so repeated polling does not create duplicates.
What should stay in the web app
These actions are still best handled in the web app:
- Add subscriptions
- Cancel subscriptions
- Check plan and quota
- Create, revoke, or rotate API keys
The API is best used for consuming messages, not for replacing the dashboard.