Let the platform do the work

login

Overview

Logs a user into the SugarCRM application.

Available APIs

  • SOAP
  • REST

Definition

login(user_auth, application_name, name_value_list)

Parameters

Name Type Description
user_auth user_auth | Array Contains the parameters to authenticate a user.
user_auth.user_name String The user name of your user
user_auth.password String The MD5 hash of the users password.
application name String The name of the application logging in.
name_value_list name_value_list | Array Sets the name_value pair. The parameter is used to set values for the 'language' and 'notifyonsave' user settings.
name_value_list.language String The language for the user.
name_value_list.notifyonsave Boolean Alerts users on new record creations when set to true.

Result

Name Type Description
result entry_value | Array The call result
result.id String This is the session id required to make other method calls.
result.module_name String Returns the 'Users' module.
result.name_value_list Array Authenticated user properties.
result.name_value_list.user_id String ID of the authenitcated user.
result.name_value_list.user_name String Username of the authenticated user.
result.name_value_list.user_language String Default language of the authenticated user.
result.name_value_list.user_currency_id String Default currency ID of the authenticated user.
result.name_value_list.user_is_admin String Admin status of the authenticated user.
result.name_value_list.user_default_team_id String Default team of the authenticated user.
result.name_value_list.user_default_dateformat String Default date format for the authenticated user.
result.name_value_list.user_default_timeformat String Default time format for the authenticated user.
result.name_value_list.user_number_seperator String Number seperator for the authenticated user.
result.name_value_list.user_decimal_seperator String Decimal sperator for the authenticated user.
result.name_value_list.mobile_max_list_entries String Max list entires for the authenticated user.
result.name_value_list.mobile_max_subpanel_entries String Max subpanel entries for the authenticated user.
result.name_value_list.user_currency_name String Default currency name for the authenticated user.

Change Log

Version Change
v3_1 Added additional return values to name_value_list. The list now also includes user_number_seperator, user_decimal_seperator, mobile_max_list_entries, mobile_max_subpanel_entries.
v3 Added additional return values to name_value_list. The list now also includes user_is_admin, user_default_team_id, user_default_dateformat, user_default_timeformat.
v2 Added name_value_list to response. Returns user_id, user_name, user_language, user_currency_id, user_currency_name.
v2 Added module_name to response.
v2 Removed error from response.
v2 Added name_value_list parameter
v2 Return type was changed from set_entry_result to entry_value.

Examples

PHP

  $login_parameters = array(
    //user authentication
    "user_auth" => array(
        "user_name" => $username,
        "password" => md5($password),
    ),

    //application name
    "application_name" => "My Application",

    //name value list for 'language' and 'notifyonsave'
    "name_value_list" => array(
        array(
            'name' => 'language',
            'value' => 'en_us',
        ),
        array(
            'name' => 'notifyonsave',
            'value' => true
        ),
    ),
);