iachat/app/views/api/v1/accounts
Tanmay Deep Sharma 61d10044a0
feat: Whatsapp embedded signup (#11612)
## Description

This PR introduces WhatsApp Embedded Signup functionality, enabling
users to connect their WhatsApp Business accounts through Meta's
streamlined OAuth flow without manual webhook configuration. This
significantly improves the user experience by automating the entire
setup process.

**Key Features:**

- Embedded signup flow using Facebook SDK and Meta's OAuth 2.0
- Automatic webhook registration and phone number configuration
- Enhanced provider selection UI with card-based design
- Real-time progress tracking during signup process
- Comprehensive error handling and user feedback


## Required Configuration

The following environment variables must be configured by administrators
before this feature can be used:
Super Admin Configuration (via
super_admin/app_config?config=whatsapp_embedded)

- `WHATSAPP_APP_ID`: The Facebook App ID for WhatsApp Business API
integration
- `WHATSAPP_CONFIGURATION_ID`: The Configuration ID for WhatsApp
Embedded Signup flow (obtained from Meta Developer Portal)
- `WHATSAPP_APP_SECRET`: The App Secret for WhatsApp Embedded Signup
flow (required for token exchange)
![Screenshot 2025-06-09 at 11 21
08 AM](https://github.com/user-attachments/assets/1615fb0d-27fc-4d9e-b193-9be7894ea93a)


## How Has This Been Tested?

#### Backend Tests (RSpec):

- Authentication validation for embedded signup endpoints
- Authorization code validation and error handling
- Missing business parameter validation
- Proper response format for configuration endpoint
- Unauthorized access prevention

#### Manual Test Cases:

- Complete embedded signup flow (happy path)
- Provider selection UI navigation
- Facebook authentication popup handling
- Error scenarios (cancelled auth, invalid business data, API failures)
- Configuration presence/absence behavior

## Related Screenshots:

![Screenshot 2025-06-09 at 7 48
18 PM](https://github.com/user-attachments/assets/34001425-df11-4d78-9424-334461e3178f)
![Screenshot 2025-06-09 at 7 48
22 PM](https://github.com/user-attachments/assets/c09f4964-3aba-4c39-9285-d1e8e37d0e33)
![Screenshot 2025-06-09 at 7 48
32 PM](https://github.com/user-attachments/assets/a34d5382-7a91-4e1c-906e-dc2d570c864a)
![Screenshot 2025-06-09 at 10 43
05 AM](https://github.com/user-attachments/assets/a15840d8-8223-4513-82e4-b08f23c95927)
![Screenshot 2025-06-09 at 10 42
56 AM](https://github.com/user-attachments/assets/8c345022-38b5-44c4-aba2-0cda81389c69)


Fixes
https://linear.app/chatwoot/issue/CW-2131/spec-for-whatsapp-cloud-channels-sign-in-with-facebook

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: iamsivin <iamsivin@gmail.com>
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2025-07-14 21:37:06 -07:00
..
actions/contact_merges feat: Reverse the contact merge (#8057) 2023-10-10 08:20:48 +05:30
agent_bots feat: Ability to reset api_access_token (#11565) 2025-05-29 14:42:13 +05:30
agents chore: Fix agent API returning 500 error (#9193) 2024-04-04 19:44:47 +05:30
articles feat(v4): Update the help center portal design (#10296) 2024-10-23 22:09:36 -07:00
assignable_agents fix: DEPRECATION WARNING: Rendering actions with '.' in the name is deprecated (#5560) 2022-10-05 17:24:34 -07:00
automation_rules fix: DEPRECATION WARNING: Rendering actions with '.' in the name is deprecated (#5560) 2022-10-05 17:24:34 -07:00
callbacks fix: DEPRECATION WARNING: Rendering actions with '.' in the name is deprecated (#5560) 2022-10-05 17:24:34 -07:00
campaigns fix: DEPRECATION WARNING: Rendering actions with '.' in the name is deprecated (#5560) 2022-10-05 17:24:34 -07:00
categories feat: Adds the ability to set an emoji for help center category (#8111) 2023-10-20 13:52:30 +05:30
channels/twilio_channels fix: DEPRECATION WARNING: Rendering actions with '.' in the name is deprecated (#5560) 2022-10-05 17:24:34 -07:00
contact_inboxes chore: Add an API to find the contacts using contact inbox sourceId (#8012) 2023-09-28 15:26:28 -07:00
contacts feat: hide tokens and password on contact inbox payloads (#10888) 2025-02-20 21:22:12 -08:00
conversations feat: API Endpoints to update message status (#11387) 2025-04-29 15:33:11 -07:00
csat_survey_responses fix: DEPRECATION WARNING: Rendering actions with '.' in the name is deprecated (#5560) 2022-10-05 17:24:34 -07:00
custom_attribute_definitions fix: DEPRECATION WARNING: Rendering actions with '.' in the name is deprecated (#5560) 2022-10-05 17:24:34 -07:00
custom_filters fix: DEPRECATION WARNING: Rendering actions with '.' in the name is deprecated (#5560) 2022-10-05 17:24:34 -07:00
dashboard_apps fix: DEPRECATION WARNING: Rendering actions with '.' in the name is deprecated (#5560) 2022-10-05 17:24:34 -07:00
inbox_members fix: DEPRECATION WARNING: Rendering actions with '.' in the name is deprecated (#5560) 2022-10-05 17:24:34 -07:00
inboxes fix: Added authentication to FireCrawl API, remove unused RobinAI references (#10737) 2025-01-22 18:14:25 -08:00
integrations feat: Linear OAuth 2.0 (#10851) 2025-02-27 18:15:53 +05:30
labels Feature: Label APIs (#931) 2020-06-07 11:17:13 +05:30
macros fix: DEPRECATION WARNING: Rendering actions with '.' in the name is deprecated (#5560) 2022-10-05 17:24:34 -07:00
notification_settings Feature: Add web push notification permission in frontend (#766) 2020-05-06 00:10:56 +05:30
notifications feat(v4): Update Inbox view card design (#10599) 2025-01-07 21:11:54 +05:30
portals chore: Clean up report & knowledge base policies (#11234) 2025-04-03 16:00:32 -07:00
search feat: Whatsapp embedded signup (#11612) 2025-07-14 21:37:06 -07:00
team_members fix: DEPRECATION WARNING: Rendering actions with '.' in the name is deprecated (#5560) 2022-10-05 17:24:34 -07:00
teams fix: DEPRECATION WARNING: Rendering actions with '.' in the name is deprecated (#5560) 2022-10-05 17:24:34 -07:00
webhooks feat: Add event subscription option to webhooks (#4540) 2022-04-25 17:44:42 +05:30
whatsapp/callbacks feat: Whatsapp embedded signup (#11612) 2025-07-14 21:37:06 -07:00
create.json.jbuilder fix: Cannot read properties of undefined (reading 'always_play_audio_alert') (#7260) 2023-06-06 15:16:25 -07:00
show.json.jbuilder feat: allow feature plan map in super admin (#9318) 2024-05-08 22:58:46 -07:00
update.json.jbuilder fix: DEPRECATION WARNING: Rendering actions with '.' in the name is deprecated (#5560) 2022-10-05 17:24:34 -07:00