Mobile User Register

From docs
Jump to: navigation, search

Mobile_API »User Registration

Base URL

https://apimobile.callproof.com

Endpoint

/api/register

Purpose

Creates a new CallProof company account and its initial administrator user. The new company workspace is prepared with standard account settings, permissions, dashboard options, contact categories, opportunity stages, follow-up types, event forms, and other default business configuration.

After successful registration, the user is signed in automatically and receives access credentials.

Registration is available without an invitation or prior authentication. The following business rules apply:

  • The company name must not already be registered.
  • The email address must not already be registered.
  • The contact should contain both a first and last name separated by a space.
  • The email address is stored in lowercase.
  • If no phone number is provided, a default placeholder number is assigned.
  • No email verification, password confirmation, or terms-acceptance field is required by this API.
  • Additional mobile-device information may be supplied for notifications and device recognition.

HTTP Method

POST

Headers

Header Required Description
Content-Type Yes application/x-www-form-urlencoded or application/json

Security

  • No – Registration is publicly accessible and does not require an access token.

Parameters

Account Fields

Parameter Type Required Description
company string Yes The unique name of the company or business account to create.
contact string Yes The full name of the initial account administrator. A first and last name separated by a space should be supplied.
email string Yes A valid and unique email address used to identify and sign in the account administrator.
phone string No The administrator's primary phone number. When supplied, it must contain between 10 and 15 characters. When omitted, the account receives the default value 0000000000.
password string Yes The password used to access the account. It must contain at least six characters.

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.
device_type string No The mobile platform. Recognized values are android and ios. Other values do not prevent registration but may prevent platform details from being recorded.
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)

A successful response confirms that the company and administrator account were created, the company workspace was initialized, and authenticated access credentials were issued.

The response does not include the new user ID or company ID.

Response Field Type Description
clientStatusCode integer Business-level response status. A successful registration returns 200.
data.token_type string The authentication token type, normally Bearer.
data.expires_in integer The 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 access token.
data.is_2fa_enabled boolean Indicates whether two-factor authentication is enabled. A newly created account normally returns false.
data.is_verified boolean Indicates whether the applicable authentication requirements have been satisfied. A newly created account normally returns true.
data.email string The administrator's registered email address in lowercase.
uri string The URL of the registration request.

Error Responses

Most validation and registration failures are represented by a business-level error within the response body. Depending on how the failure is handled, the HTTP status may be 200 or 401.

HTTP Status Code Client Status Code Meaning
200 401 One or more required fields were not supplied.
200 401 The email address is not in a valid format.
200 401 The password contains fewer than six characters.
200 401 The phone number does not meet the required length.
200 401 The company name is already registered.
200 401 The email address is already registered.
200 401 The contact name does not meet the expected format.
200 401 Device information could not be associated with the new account.
401 401 The registration could not be authorized or completed.
401 429 The registration request limit was exceeded. The client should wait before trying again.

Validation Rules

Field Rule Failure Meaning
company Required and unique A company name must be supplied and must not already exist.
contact Required An administrator name must be supplied. A first and last name should be separated by a space.
email Required, valid email, and unique A properly formatted, unregistered email address must be supplied.
phone 10–15 characters when supplied The supplied phone number is outside the accepted length.
password Required and minimum 6 characters The password is missing or too short.

Error Response Fields

Response Field Type Description
clientStatusCode integer The business-level error status, commonly 401 or 429.
error.code integer The business error code. Registration and validation failures generally return 1500; request-limit failures may return 1700.
error.message string A plain-language explanation of the registration failure.
uri string The URL of the registration request.