Integrating Whatchimp with WordPress via HTTP API allows businesses to automate user registration directly through WhatsApp. This eliminates manual work, provides instant responses, and ensures a smooth onboarding experience for users. This guide walks you through setting up the integration from configuring the API to testing the workflow.
Table of Contents #
- Benefits of Integration
- Setting Up the API in Whatchimp
- Configuring Authentication
- Mapping API Request Data
- Verifying the API Connection
- Creating the Flow in Whatchimp
- Testing the Integration
Benefits of Integration #
- Automation – Eliminates manual user registrations.
- Instant Feedback – Users receive immediate confirmation.
- Seamless Workflow – Connects WhatsApp and WordPress effortlessly.
Setting Up the API in Whatchimp #
- Go to WhatsApp HTTP API in Whatchimp’s dashboard (From the left navigation menu, select “Integration” or “Settings”. There you will find “HTTP API”. Click on it, and then select “WhatsApp HTTP API”)
- Click Create to set up a new API connection.
- Configure:
- API Name: e.g., “WordPress User Create Demo.”
- Method: POST (since we are sending data to create a new user)
- Endpoint URL: Input the WordPress REST API endpoint for user creation: https://yourwebsite.com/wp-json/wp/v2/users
Configuring Authentication #
- Generate WordPress Application Password:
- Go to WordPress Admin Dashboard → Users → Your Profile.
- Generate an Application Password– In the Application Passwords section, give your integration a name (e.g., “WhatChimp API”) and generate the password
- Copy and save the password as you won’t be able to view it again.
- Encode Credentials (Base64):
To use this password in your API, you need to encode your username:application_password string in Base64.
Here’s how:
- If your username is admin and your application password is 1234567890abcdef, you’ll need to encode the string admin:1234567890abcdef.
- You can use various online tools for Base64 encoding: Base64 Encode
- Once encoded, it will look like this YWRtaW46MTIzNDU2Nzg5MGFiY2RlZg==
- Add Headers in Whatchimp:
- Header Key: Content-Type
Header Value: application/json
- Header Key: Authorization
Header Value: Basic
Authorization: Basic YWRtaW46MTIzNDU2Nzg5MGFiY2RlZg==
Mapping API Request Data #
In the API body, map fields like:
- username: (e.g., phone number from the chatbot input).
- name: (e.g., full name from user input).
- email: (dynamically captured email).
- password: Static or dynamically generated.
- roles: Set this to subscriber or any other role as per your requirement.
You can map static values or dynamic values collected from the chatbot conversation (such as a user’s email or name)
Verifying the API Connection #
Once you’ve configured the API, click “Verify Connection” to ensure everything is set up correctly. If the connection is successful, WhatChimp will confirm that the API endpoint is reachable, and the data is being sent properly.
Creating the Flow in Whatchimp #
- Start a New Bot Flow:
- Create a new bot flow and add a trigger, such as a keyword (WPAPITest) that users can type to start the flow.
- Collect User Input:
- Add a User Input Flow to collect the user’s information, such as their email address or name. Save this data into custom fields.
- Send a Confirmation Message:
- “Thanks! We are creating your WordPress account, please wait a moment.”
- Trigger API Call:
- Add the HTTP API action in the flow. Map the user input (such as email, username, etc.) to the appropriate fields in the API request body.
- Send Success Confirmation:
- Hi, your WordPress account has been created. Your username is: #WordPressUserId# and your default password is: 123456.
Here WordPressUserId is a custom field inside WhatChimp.
- Hi, your WordPress account has been created. Your username is: #WordPressUserId# and your default password is: 123456.
Testing the Integration #
Test by interacting with your chatbot to confirm that user accounts are created in WordPress. Ensure correct data mapping.
This integration automates WordPress user registration through WhatsApp, improving efficiency and user experience. To explore more, check out Whatchimp’s HTTP API Integration Guide.