post__auth_google_exchange

Code Samples

# You can also use wget
curl -X POST https://backend.flashback.tech/auth/google/exchange \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /auth/google/exchange

Exchange Google Authorization Code

Exchange Google authorization code for access token.

This endpoint completes the OAuth flow by exchanging an authorization code for an access token. Use this when you have an authorization code from the Google OAuth consent screen.

OAuth Flow:

  1. Redirect user to Google OAuth consent screen

  2. User authorizes your application

  3. Google returns authorization code

  4. Call this endpoint with the code

  5. Receive access token for use with /auth/google

Body parameter

{
  "code": "4/0AfJohXn..."
}

Parameters

Name
In
Type
Required
Description

body

body

object

true

none

» code

body

string

true

Google authorization code from OAuth consent screen

Example responses

200 Response

{
  "success": true,
  "token": "string",
  "refreshToken": "string",
  "expiresAt": 0
}

Responses

Status
Meaning
Description
Schema

200

Token exchange successful

Inline

Response Schema

Status Code 200

Name
Type
Required
Restrictions
Description

» success

boolean

false

none

none

» token

string

false

none

Google access token

» refreshToken

string

false

none

Google refresh token

» expiresAt

integer

false

none

Token expiration timestamp

Last updated

Was this helpful?