CompleteOAuth2 processes OAuth2 code submitted by the frontend.
POST/api/v1/engagements/integrations/whatsapp/oauth2/complete
Use this when the OAuth redirect goes to the frontend instead of backend. The frontend extracts the code and state from the redirect URL and submits them via this POST endpoint.
Flow
- Frontend calls InitiateOAuth2 to get OAuth URL
- User completes OAuth on Meta
- Meta redirects to frontend with code and state
- Frontend POSTs code and state to this endpoint
- Backend exchanges code for token and creates config
Errors
- INVALID_ARGUMENT: Invalid or expired state
- FAILED_PRECONDITION: OAuth exchange failed
- INTERNAL: Failed to create channel config
Request
Responses
- 200
- default
A successful response.
An unexpected error response.