Truecaller SDK
  • Hello!
  • Why Truecaller SDK
  • Getting Started
  • ANDROID
    • 🆕OAuth SDK 3.0
      • Implementing user flow for your App
      • Scenarios for all user verifications : Truecaller and Non Truecaller Users
      • Integration Steps
        • Generating Client ID
        • Setup
        • Implementing Callbacks
        • Initialisation
        • Setting up OAuth parameters
        • Invocation
        • Customisation
        • Clearing SDK Instance
        • Handling Error Scenarios
        • Integrating with your Backend
          • Fetching User Token
          • Fetching User Profile
        • Non Truecaller User Verification
          • Completing Verification
          • TrueException
          • Server Side Validation
      • Instrumentation
      • Getting Release Ready
        • Testing your verification flow
          • Non-Truecaller user verification flow
          • Truecaller user verification flow
          • Test Setup
        • Google play store app permission declaration form
        • Moving to Production
    • SDK v2.8.0
      • Implementing user flow for your app
      • Scenarios for all user verifications : Truecaller and Non Truecaller Users
      • Generating App Key
      • Integrating with your App
        • Setup
        • App Key Configuration
        • Initialisation
        • Customisation
        • Implement Callbacks
        • Clearing SDK instance
        • Handling Error Scenarios
        • Verifying non Truecaller users
          • TrueException
          • Completing Verification
        • Advanced Steps
      • Server Side Response Validation
        • For Truecaller users verification flow
        • For Non-Truecaller users verification flow
      • Instrumentation
      • Getting Release Ready
        • Testing your verification flow
          • Truecaller user verification flow
          • Non-Truecaller User Verification Flow
          • Test Setup
        • Google Play App Signing
        • Google Play Store app permissions declaration
        • Google Play Policy Change for Device Identifiers
      • Changelog
  • MOBILE WEBSITES
    • Implementing user flow for your Mobile Website
    • Generating App Key
    • Integrating with your mobile website
      • Initialisation
      • Invoking verification
      • Fetch User Profile
      • Completing User Verification
      • Handling Error Scenarios
    • Getting Release Ready
      • Instrumentation
      • Testing your verification flow
  • IOS
    • Generating App Key
    • Integrating with your iOS App
      • Setup
      • Configuration
      • Usage
        • Swift
        • Objective-C
      • Verifying Non-Truecaller app users
        • Completing Verification
      • Handling Error Scenarios
        • Safari Redirection
    • Server Side Response Validation
  • SHOPIFY APP
    • Generating App Key
    • App Configuration
    • Deactivating App Block
  • FAQs
    • General
    • Developer Account
    • Android App SDK
    • Android OAuth SDK
    • Mobile Web SDK
    • Number Verification Plugin
  • PRODUCT UPDATES
    • App Review Process
    • Introducing dark theme
Powered by GitBook
On this page

Was this helpful?

  1. MOBILE WEBSITES
  2. Integrating with your mobile website

Fetch User Profile

Once the user approves the verification on your app with their Truecaller profile ( by clicking the 'Continue' button on the dialog ), we will immediately post the user's accessToken and the requestID to your Callback endpoint. The sample response format would look like below :

{"requestId":"RL8YZ41FQMt5Jiak2sc_Ys0OgQA=","accessToken":"a1asX--8_yw-OF--E6Gj_DPyKelJIGUUeYB9U9MJhyeu4hOCbrl","endpoint":"https://profile4-noneu.truecaller.com/v1/default"}

Here, the request ID is the same string which you had earlier passed on in the deep link 'requestNonce' parameter. This parameter acts as a request-response correlation identifier and can be used by you to identify the correct source of the request. Once you receive the user's access token at your backend, you can fetch the respective user profile by making an API call to the endpoint that you receive in the above response in the following format :

Header Authorisation Parameters:

Parameter [Type]

Required

Description

Example

Authorization

yes

Bearer {token}

Bearer WcBaSJYbCr5yla5z0CdAGfyj3Rruk8

Get User Profile

curl -X GET -H "Authorization: Bearer a3sAB0KnGANg4VZwIXfhUyFmPbzoONofl4FjIItac0JQSODp6niW8oBr33uOI-u7" -H "Cache-Control: no-cache" "https://profile4-noneu.truecaller.com/v1/default"

Sample User Profile Response

{
  "phoneNumbers": ["919999999999"],
  "addresses": [
    {
       "countryCode": "in",
       "city": "city_field_value",
       "street": "street_field_value",
       "zipcode": "1234567"
    }
  ], 
  "avatarUrl": "https://s3-eu-west-1.amazonaws.com/images1.truecaller.com/myview/1/15a999e9806gh73834c87aaa0498020d/3", 
  "aboutMe":"About me",
  "jobTitle": "CEO", 
  "companyName": "ABC",  
  "history": {
    "name": 
    {
      "updateTime": "1508089888000"
    }
  }, 
  "isActive": "True", 
  "gender": "Male", 
  "createdTime": "1379314068000", 
  "onlineIdentities": {
    "url": "https://www.truecaller.com", 
    "email": "y.s@truecaller.com",
    "facebookId":"105056625245",
  }, 
  "type": "Personal", 
  "id": "655574719", 
  "userId":"1319413476",
  "badges": ["verified", "premium"], 
  "name": {
    "last": "Kapoor", 
    "first": "Rajat"
  }
}

Response parameter

Type

Optional

Description

id

string

N

userId

number

N

phoneNumbers

array[number]

N

Phone numbers prefixed with country code

name

name.first

name.last

object

string

string

N

N

Y

badges

array[string]

Y

avatarUrl

string

N

isActive

boolean

N

gender

string

N

Male|Female|NotSet

privacy

string

N

type

string

N

User type

history

history.<field>

history.<fId>.updateTime

object

string

number

N

Y

Y

Update history record for a field (e.g. history.name contains history for name field)

Update time for a field fId (e.g. history.name.updateTime contains last update time for name field)

addresses

addresses.countryCode

addresses.city

addresses.street

addresses.zipcode

array[object]

string

string

string

string

N

N

N

N

N

List of addresses

Country ISO2 code

city

street/ locality

Zipcode/Postcode/Postal Code

onlineIdentities

onlineIdentities.url

onlineIdentities.email

onlineIdentities.facebookId

object

string

string

string

Y

Y

Y

Y

aboutMe

string

N

jobTitle

string

N

companyName

string

N

Please note that the optional attributes in the user profile as defined above, wouldn't exist in the response if not updated by user

Response Codes

  • 200 OK

  • 401 Unauthorised - If your credentials are not valid

  • 5xx Server error - Any other error

Please note, in case users do not wish to share their Truecaller profile ( by dismissing Truecaller profile dialog ), you'll receive a user reject error response on your callback endpoint. The sample format for the same would look as below :

{"requestId":"WZqlS6PqY0ycO3mKlEuI=","status":"user_rejected"}
PreviousInvoking verificationNextCompleting User Verification

Last updated 4 years ago

Was this helpful?