Pro Feature
Contact Form 7 to Chatwork: API Token Setup in 4 Steps
Get Contact Form 7 submissions in a Chatwork room: where to issue the API token, how to find the room ID (rid), a no-code 4-step setup and a code sample.
If you handle inquiries through Chatwork, the most reliable approach is to automatically notify a Chatwork group chat whenever a Contact Form 7 (CF7) submission comes in. Even if someone misses an email, the whole team can still notice the incoming inquiry. This article covers both a no-code method that’s completed entirely through the settings screen, and a manual implementation where you write the code yourself.
Why Chatwork notifications matter
At many Japan-based production and outsourcing companies, day-to-day communication happens primarily through Chatwork. If inquiries only arrive by email, they can get buried in a staff member’s inbox and cause delays. Routing them into Chatwork lets you assign “who handles this” directly within the project room, which speeds up response times.
Method 1: Complete everything through the settings screen (no code, recommended)
You can implement Chatwork notifications entirely through WordPress admin settings, without touching functions.php at all. With Frontierline Forms’ notification integration feature, you can finish in the following four steps. All you need is an API token and a room ID — no code to maintain, and no dependency on your theme.
Steps
- Prepare an API token and room ID: Issue a token from your account name in the top right of Chatwork → “Service Connections” → “API Token.” The room ID is the number at the end of the destination group chat’s URL (
https://www.chatwork.com/#!rid123456789). - Enter the token and room ID: In the admin screen, open Frontierline Forms → Settings → Integrations and enter “Chatwork API token” and “Chatwork Room ID”, then save.
- Check the notification content: Each notification automatically includes the form name, the time received, every submitted field (name and value) and a link to the entry in the admin screen, inside an [info] box. There is no field selection to configure.
- Send a test submission: Submit the form and confirm that it arrives in the room.
The token is kept in the plugin settings (the database) rather than in functions.php, so it survives theme changes and handovers. Because each notification carries whatever fields were submitted, you don’t need to update anything when you edit the form. If encrypted storage is enabled, the decrypted values are sent. Notifications go to a single room; routing by inquiry type is not supported.
Method 2: Manual implementation with the Chatwork API (for advanced users)
If you want to write the code yourself, you can implement this using the Chatwork API and CF7’s wpcf7_mail_sent hook.
Prepare an API token and room ID
As in step 1 of Method 1, issue a token from Chatwork’s “Service Connections” → “API Token,” and get the room ID from the number at the end of the destination room’s URL.
Add a hook to functions.php
add_action('wpcf7_mail_sent', function ($form) {
$submission = WPCF7_Submission::get_instance();
$data = $submission ? $submission->get_posted_data() : [];
$body = "[info][title]New Inquiry[/title]"
. "Name: " . ($data['your-name'] ?? '') . "\n"
. "Email: " . ($data['your-email'] ?? '') . "\n"
. "Message: " . ($data['your-message'] ?? '') . "[/info]";
$room_id = '123456789';
wp_remote_post("https://api.chatwork.com/v2/rooms/{$room_id}/messages", [
'headers' => ['X-ChatWorkToken' => 'YOUR_API_TOKEN'],
'body' => ['body' => $body],
]);
});
Using Chatwork notation like [info][title] makes the notification easier to read inside a boxed frame.
Pitfalls of manual implementation
- The API token ends up hardcoded in your code: Writing the token directly into
functions.phprisks exposure through theme files. - Branching logic grows as forms and rooms multiply: If you split rooms by inquiry type, the branching code based on
$form->id()or input values tends to balloon. - Maintenance is tied to the theme: The code can be lost during theme changes or handovers, and this only gets worse the more sites you roll it out to.
Manual implementation can work fine for a single site, but once you factor in securely storing the token and rolling this out across multiple projects, Method 1 — completed entirely through settings — is the more realistic choice.
How is this different from Slack notifications?
Both Chatwork and Slack can deliver notifications via webhook/API. Chatwork tends to suit projects with a lot of Japan-based work and external collaborators, while Slack fits development and internal teams better. Frontierline Forms supports both, so you can choose per project. For the Slack version of this guide, see How to Send Contact Form 7 Notifications to Slack.
Summary
Since CF7 doesn’t have built-in Chatwork integration, you need either a notification-enabled plugin or a manual API-based implementation. If you’re running multiple projects through Chatwork, the settings-only method is faster and keeps token management secure. Method 1 is the best place to start.
If you’d like Chatwork notifications alongside Slack and Google Sheets integration, submission log storage, and CSV export — all set up through settings alone — consider adopting Frontierline Forms.
Frontierline Forms
This setup takes just a checkbox in the admin.
Add alerts, submission logging, CSV export and multi-step forms without writing code — all from the settings screen. The 5-site / unlimited license lets agencies cover form maintenance across many client projects at once. Your license key is issued instantly on payment.