Google User Login

From docs
Jump to: navigation, search

Mobile_API » Google Login

Base URL

https://apimobile.callproof.com

Endpoint

/api/google-login

Purpose

Authenticates an existing CallProof user through their Google account. The Google account email must match an existing, active CallProof account that is eligible for mobile access.

HTTP Method

POST

Headers

Header Required Description
Content-Type Yes multipart/form-data, particularly when supplying a profile image. Form-encoded data may be used when no file is included.

Security

  • No – No prior CallProof authentication is required. A valid Google authorization code must be supplied.

Parameters

Request Body Fields

Parameter Type Required Description
auth_code string Yes A valid authorization code received from Google sign-in.
device_type string Yes The mobile platform. Accepted values are android and ios.
device_id_app string No The device notification token used for notifications and device recognition.
device_phone_number string No The phone number associated with the mobile device.
device_time_zone string No The device's time zone. When omitted, a time zone may be determined automatically.
user_profile_image file No A profile image used when the existing user does not already have one.
cp_version string No The installed CallProof application version.
product string No The device product or model identifier.
resolution string No The device screen resolution.
device_name string No The user-visible device name.
is_tablet boolean No Indicates whether the device is a tablet.
android_version string No The Android operating-system version.
android_api_version string No The Android API version.
android_apk_version string No The installed Android application package version.
is_callLog_build boolean No Indicates whether the Android application supports call-log capabilities.
ios_version string No The iOS operating-system version.

cURL Example For Android

curl --location 'https://apimobile.callproof.com/api/google-login' \
--form 'auth_code=YOUR_GOOGLE_AUTH_CODE' \
--form 'device_type=android'

cURL Example for iOS

curl --location 'https://apimobile.callproof.com/api/google-login' \
--form 'auth_code=YOUR_GOOGLE_AUTH_CODE' \
--form 'device_type=ios'

Successful Response (200)

The Google identity was verified, matched to an eligible CallProof account, and authenticated access credentials were issued.

Response Field Type Description
clientStatusCode integer Business-level response status. A successful login returns 200.
data.token_type string The authentication token type.
data.expires_in integer The access token validity period.
data.access_token string The credential used to access authenticated API endpoints.
data.refresh_token string The credential used to obtain a new access token.
data.is_2fa_enabled boolean Indicates whether two-factor authentication is enabled for the user or company.
data.is_verified boolean Indicates whether the applicable two-factor authentication requirement has been satisfied.
data.email string The authenticated user's Google email address.
uri string The URL of the Google login request.

Error Responses

Google login failures are generally returned with HTTP status 200. The business-level result is provided through clientStatusCode.

HTTP Status Code Client Status Code Meaning
200 401 A required field, such as auth_code or device_type, was not supplied.
200 401 Device information could not be associated with the user.
200 400 The device type is not supported.
200 400 The Google authorization code is invalid, expired, or could not be verified.
200 400 The Google email does not match an existing CallProof account.
200 400 The user or associated company account is disabled.
200 400 The account is not eligible for this type of access and must be updated through CallProof Support.
200 400 Google authentication could not be completed.

Error Response Fields

Response Field Type Description
clientStatusCode integer The business-level error status, typically 400 or 401.
error.code integer The business error code, generally 1500.
error.message string A plain-language explanation of the login failure.
uri string The URL of the Google login request.