Skip to main content
POST
/
v1
/
auth
/
token
ExchangeToken
curl --request POST \
  --url https://sdk.anghami.com/v1/auth/token \
  --header 'Content-Type: application/json' \
  --data '
{
  "code": "<string>",
  "redirectUri": "<string>",
  "clientId": "<string>",
  "codeVerifier": "<string>"
}
'
{
  "token": {
    "accessToken": "<string>",
    "tokenType": "<string>",
    "expiresIn": 123,
    "refreshToken": "<string>",
    "scopes": [
      "AUTH_SCOPE_UNSPECIFIED"
    ]
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.sdk.anghami.com/llms.txt

Use this file to discover all available pages before exploring further.

Body

application/json

ExchangeTokenRequest is the request message for exchanging an authorization code for an access token using the OAuth 2.0 Authorization Code + PKCE flow.

code
string
required

The authorization code received from the authorization server callback.

redirectUri
string<uri>
required

The redirect URI that was used in the authorization request. Must match the URI registered for the client application.

clientId
string
required

The client application identifier.

codeVerifier
string
required

The PKCE code verifier corresponding to the code_challenge sent in the authorization request. Must be 43-128 characters per RFC 7636.

Required string length: 43 - 128

Response

Successful response

ExchangeTokenResponse is the response message containing the issued tokens.

token
object

TokenInfo contains the OAuth 2.0 token response fields. Returned by ExchangeToken and RefreshToken RPCs.