Fetching User Token

Using the “state” from step 10, “code verifier” from step 12, and the “authorization code” from step 9, you need to make a network call to Truecaller’s backend so as to fetch the access token :

POST https://oauth-account-noneu.truecaller.com/v1/token

Headers

NameTypeDescription

Content-Type*

application/x-www-form-urlencoded

String

Request Body

NameTypeDescription

grant_type*

"authorization_code"

// hardcoded value

String

client_id*

<YOUR_CLIENT_ID>

code*

<USER_AUTHORISATION_CODE>

Authorisation code from TcOAuthData callback from step 9

code_verifier*

<YOUR_CODE_VERIFIER>

From step 12

{ "access_token": "some-access-token", "expires_in": 3600, "token_type": "Bearer" }

Sample cURL request :

curl --location --request POST 'https://oauth-account-noneu.truecaller.com/v1/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=authorization_code' \
--data-urlencode 'client_id=<<your-client-id>>' \
--data-urlencode 'code=<<authorization_code>>' \
--data-urlencode 'code_verifier=<<your-code-verifier>>'

Last updated