Google User Register

From docs
Jump to: navigation, search

Mobile_API »Sign Up with Google

Base URL

https://apimobile.callproof.com

Endpoint

/api/google-register

Purpose

Creates a CallProof account using a verified Google identity and immediately provides authenticated access.

Important: This API is exclusively for users signing up or continuing with Google.

For a new Google email address, the API creates a company workspace and administrator account using profile information supplied by Google. The workspace receives CallProof's standard settings, permissions, dashboard options, contact categories, opportunity stages, event forms, and other default business configuration.

If the Google email already belongs to a CallProof user, a duplicate account is not created. The existing account is used and authenticated access is returned.

The user's Google connection is also prepared for supported calendar features.

HTTP Method

POST

Headers

Header Required Description
Content-Type Yes multipart/form-data when supplying a profile image; otherwise application/x-www-form-urlencoded may be used.

Security

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

Parameters

Google Authentication 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 requesting registration. Accepted values are android and ios.

General Device Fields

Parameter Type Required Description
device_id_app string No The device notification token used for notifications and device recognition.
device_time_zone string No The device's time-zone identifier, such as America/Chicago. When omitted, a time zone may be determined automatically.
user_profile_image file No A profile image to associate with the CallProof user.
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 Device Fields

These fields apply when device_type is android.

Parameter Type Required Description
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 Device Fields

This field applies when device_type is ios.

Parameter Type Required Description
ios_version string No The iOS operating-system version.

Successful Response (200)

The Google identity was verified and authenticated access credentials were issued.

For a new Google user, the response confirms that a CallProof company and administrator account were created. For an existing user, the matching CallProof account was used without creating a duplicate.

Response Field Type Description
clientStatusCode integer Business-level response status. A successful request returns 200.
data.token_type string The authentication token type, normally Bearer.
data.expires_in integer The CallProof access token validity period.
data.access_token string The credential used to access authenticated CallProof API endpoints.
data.refresh_token string The credential used to obtain a new CallProof 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 email address obtained from the verified Google identity.
uri string The URL of the Google registration request.

Error Responses

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

HTTP Status Code Client Status Code Meaning
200 401 The required auth_code field was not supplied.
200 401 The required device_type field was not supplied.
200 400 The device type is not android or ios.
200 400 The Google authorization code is invalid, expired, or could not be exchanged.
200 400 Google did not provide sufficient identity information.
200 400 The Google identity token could not be verified.
200 400 The CallProof account or company workspace could not be created.
200 400 Device or calendar information could not be associated with the account.
200 400 Google signup 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 Google registration failure.
uri string The URL of the Google registration request.