Skip to main content

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

  1. Frontend calls InitiateOAuth2 to get OAuth URL
  2. User completes OAuth on Meta
  3. Meta redirects to frontend with code and state
  4. Frontend POSTs code and state to this endpoint
  5. 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

A successful response.