Modules.Cloud.Users
> Modules.Cloud.Users

Provides methods for accessing ArrowDB user objects.

Examples

Create User

This example creates a new user and checks the response.

Cloud.Users.create({
    email: 'test@mycompany.com',
    first_name: 'test_firstname',
    last_name: 'test_lastname',
    password: 'test_password',
    password_confirmation: 'test_password'
}, function (e) {
    if (e.success) {
        var user = e.users[0];
        alert('Success:\n' +
            'id: ' + user.id + '\n' +
            'sessionId: ' + Cloud.sessionId + '\n' +
            'first name: ' + user.first_name + '\n' +
            'last name: ' + user.last_name);
    } else {
        alert('Error:\n' +
            ((e.error && e.message) || JSON.stringify(e)));
    }
});

Log in User

This example logs a user in and checks the response.

Cloud.Users.login({
    login: 'test@mycompany.com',
    password: 'test_password'
}, function (e) {
    if (e.success) {
        var user = e.users[0];
        alert('Success:\n' +
            'id: ' + user.id + '\n' +
            'sessionId: ' + Cloud.sessionId + '\n' +
            'first name: ' + user.first_name + '\n' +
            'last name: ' + user.last_name);
    } else {
        alert('Error:\n' +
            ((e.error && e.message) || JSON.stringify(e)));
    }
});

Show User

This example requests information about a user and checks the response.

Cloud.Users.show({
    user_id: savedUserInfo.id
}, function (e) {
    if (e.success) {
        var user = e.users[0];
        alert('Success:\n' +
            'id: ' + user.id + '\n' +
            'first name: ' + user.first_name + '\n' +
            'last name: ' + user.last_name);
    } else {
        alert('Error:\n' +
            ((e.error && e.message) || JSON.stringify(e)));
    }
});

Show Current User

This example requests information about the currently logged in user and checks the response.

Cloud.Users.showMe(function (e) {
    if (e.success) {
        var user = e.users[0];
        alert('Success:\n' +
            'id: ' + user.id + '\n' +
            'first name: ' + user.first_name + '\n' +
            'last name: ' + user.last_name);
    } else {
        alert('Error:\n' +
            ((e.error && e.message) || JSON.stringify(e)));
    }
});

Search for Users

This example requests information about particular users and checks the response.

Cloud.Users.search({
    q: 'test'
}, function (e) {
    if (e.success) {
        alert('Success:\n' +
            'Count: ' + e.users.length);
        for (var i = 0; i < e.users.length; i++) {
            var user = e.users[i];
            alert('id: ' + user.id + '\n' +
                'first name: ' + user.first_name + '\n' +
                'last name: ' + user.last_name);
         }
    } else {
        alert('Error:\n' +
            ((e.error && e.message) || JSON.stringify(e)));
    }
});

Query for Users

This example requests information about specific users and checks the response.

Cloud.Users.query({
    page: 1,
    per_page: 10,
    where: {
        age: { '$gt': 28 },
        favorite_color: 'blue',
        first_name: 'joe'
    }
}, function (e) {
    if (e.success) {
        alert('Success:\n' +
            'Count: ' + e.users.length);
        for (var i = 0; i < e.users.length; i++) {
            var user = e.users[i];
            alert('id: ' + user.id + '\n' +
                'first name: ' + user.first_name + '\n' +
                'last name: ' + user.last_name);
         }
    } else {
        alert('Error:\n' +
            ((e.error && e.message) || JSON.stringify(e)));
    }
});

Update User

This example updates information about the currently logged in user and checks the response.

Cloud.Users.update({
    email: 'joeuser@mycompany.com',
    first_name: 'joe',
    last_name: 'user',
    custom_fields: {
        favorite_color: 'blue',
        age: 25
    }
}, function (e) {
    if (e.success) {
        var user = e.users[0];
        alert('Success:\n' +
            'id: ' + user.id + '\n' +
            'first name: ' + user.first_name + '\n' +
            'last name: ' + user.last_name);
    } else {
        alert('Error:\n' +
            ((e.error && e.message) || JSON.stringify(e)));
    }
});

Logout User

This example logs out the current user and checks the response.

Cloud.Users.logout(function (e) {
    if (e.success) {
        alert('Success: Logged out');
    } else {
        alert('Error:\n' +
            ((e.error && e.message) || JSON.stringify(e)));
    }
});

Remove User

This example deletes the current user and checks the response.

Cloud.Users.remove(function (e) {
    if (e.success) {
        alert('Success: Removed');
    } else {
        alert('Error:\n' +
            ((e.error && e.message) || JSON.stringify(e)));
    }
});

Request Reset Password User

This example requests a password reset for a user and checks the response.

Cloud.Users.requestResetPassword({
    email: 'joeuser@mycompany.com'
}, function (e) {
    if (e.success) {
        alert('Success: Reset Request Sent');
    } else {
        alert('Error:\n' +
            ((e.error && e.message) || JSON.stringify(e)));
    }
});
  • 0.8
  • 0.8
  • 0.8
Defined By

Properties

apiName : Stringreadonly

The name of the API that this proxy corresponds to.

The name of the API that this proxy corresponds to.

The value of this property is the fully qualified name of the API. For example, Button returns Ti.UI.Button.

  • 3.2.0
  • 3.2.0
  • 3.2.0
Indicates if the proxy will bubble an event to its parent. ...

Indicates if the proxy will bubble an event to its parent.

Some proxies (most commonly views) have a relationship to other proxies, often established by the add() method. For example, for a button added to a window, a click event on the button would bubble up to the window. Other common parents are table sections to their rows, table views to their sections, and scrollable views to their views. Set this property to false to disable the bubbling to the proxy's parent.

Default: true

  • 3.0.0
  • 3.0.0
  • 3.0.0

The Window or TabGroup whose Activity lifecycle should be triggered on the proxy.

The Window or TabGroup whose Activity lifecycle should be triggered on the proxy.

If this property is set to a Window or TabGroup, then the corresponding Activity lifecycle event callbacks will also be called on the proxy. Proxies that require the activity lifecycle will need this property set to the appropriate containing Window or TabGroup.

  • 3.6.0
Defined By

Methods

Applies the properties to the proxy. ...

Applies the properties to the proxy.

Properties are supplied as a dictionary. Each key-value pair in the object is applied to the proxy such that myproxy[key] = value.

  • 3.0.0
  • 3.0.0
  • 3.0.0

Parameters

  • props : Dictionary

    A dictionary of properties to apply.

Returns

  • void
Modules.Cloud.Users
( parameters, callback )
Create a new user. ...

Create a new user.

See Users: Create User for the request parameters supported by this method.

Data is returned in the users property of the parameter passed to the callback.

Parameters

  • parameters : Dictionary

    Parameters to send in the request.

  • callback : Callback<CloudUsersResponse>

    Callback function to execute when the method completes.

Returns

  • void
Gets the value of the apiName property. ...

Gets the value of the apiName property.

  • 3.2.0
  • 3.2.0
  • 3.2.0

Returns

  • String
Gets the value of the bubbleParent property. ...

Gets the value of the bubbleParent property.

  • 3.0.0
  • 3.0.0
  • 3.0.0

Returns

  • Boolean
Gets the value of the lifecycleContainer property. ...

Gets the value of the lifecycleContainer property.

  • 3.6.0

Returns

Modules.Cloud.Users
( parameters, callback )
Log in a user. ...

Log in a user.

See Users: Login User for the request parameters supported by this method.

Data is returned in the users property of the parameter passed to the callback.

Parameters

  • parameters : Dictionary

    Parameters to send in the request.

  • callback : Callback<CloudUsersResponse>

    Callback function to execute when the method completes.

Returns

  • void
Modules.Cloud.Users
( [parameters], callback )
Log out the current user. ...

Log out the current user.

Requires user login.

See Users: Logout User for the request parameters supported by this method.

Data is returned in the users property of the parameter passed to the callback.

Parameters

  • parameters : Dictionary (optional)

    Parameters to send in the request.

  • callback : Callback<CloudUsersResponse>

    Callback function to execute when the method completes.

Returns

  • void
Modules.Cloud.Users
( [parameters], callback )
Retrieve a list of users with sorting and pagination. ...

Retrieve a list of users with sorting and pagination.

See Users: Custom Query of Users for the request parameters supported by this method.

Data is returned in the users property of the parameter passed to the callback.

Parameters

  • parameters : Dictionary (optional)

    Parameters to send in the request.

  • callback : Callback<CloudUsersResponse>

    Callback function to execute when the method completes.

Returns

  • void
Modules.Cloud.Users
( parameters, callback )
Delete the current user. ...

Delete the current user.

Requires user login.

See Users: Delete User for the request parameters supported by this method.

Parameters

  • parameters : Dictionary

    Parameters to send in the request.

  • callback : Callback<CloudUsersResponse>

    Callback function to execute when the method completes.

Returns

  • void
Modules.Cloud.Users
( parameters, callback )
Send an email to user to recover lost password. ...

Send an email to user to recover lost password.

See Users: Send a reset password email to User for the request parameters supported by this method.

Data is returned in the users property of the parameter passed to the callback.

Parameters

  • parameters : Dictionary

    Parameters to send in the request.

  • callback : Callback<CloudUsersResponse>

    Callback function to execute when the method completes.

Returns

  • void
Modules.Cloud.Users
( parameters, callback )
Re-send a user verification email. ...

Re-send a user verification email.

See Users: Send a reset password email to User for the request parameters supported by this method.

Data is returned in the users property of the parameter passed to the callback.

Parameters

  • parameters : Dictionary

    Parameters to send in the request.

  • callback : Callback<CloudUsersResponse>

    Callback function to execute when the method completes.

Returns

  • void
Modules.Cloud.Users
( [parameters], callback )removed
Create a new user using 3-Legged OAuth. ...

Create a new user using 3-Legged OAuth.

This method has been removed since 3.2.3

OAuth authentication is no longer supported in the ti.cloud module.

Invokes a modal dialog that allows the authentication server to display a web page for creating a new user.

See Authentication for instructions on enabling 3-Legged OAuth for your application.

Authentication data is returned in the parameter passed to the callback.

  • 2.1.2
  • 2.1.2
  • 2.1.2

Parameters

Returns

  • void
Modules.Cloud.Users
( [parameters], callback )removed
Log in a user using 3-Legged OAuth. ...

Log in a user using 3-Legged OAuth.

This method has been removed since 3.2.3

OAuth authentication is no longer supported in the ti.cloud module.

Invokes a modal dialog that allows the authentication server to display a web page for authenticating a user.

See Authentication for instructions on enabling 3-Legged OAuth for your application.

Authentication data is returned in the parameter passed to the callback.

  • 2.1.2
  • 2.1.2
  • 2.1.2

Parameters

Returns

  • void
Modules.Cloud.Users
( ) : Booleanremoved
Checks if the user is authenticated with 3-Legged OAuth. ...

Checks if the user is authenticated with 3-Legged OAuth.

This method has been removed since 3.2.3

OAuth authentication is no longer supported in the ti.cloud module.

True is returned after successfully calling secureCreate or secureLogin, and false after successfully calling logout.

  • 2.1.2
  • 2.1.2
  • 2.1.2

Returns

  • Boolean
Sets the value of the bubbleParent property. ...

Sets the value of the bubbleParent property.

  • 3.0.0
  • 3.0.0
  • 3.0.0

Parameters

  • bubbleParent : Boolean

    New value for the property.

Returns

  • void
Sets the value of the lifecycleContainer property. ...

Sets the value of the lifecycleContainer property.

  • 3.6.0

Parameters

Returns

  • void
Modules.Cloud.Users
( parameters, callback )
Show public user information. ...

Show public user information.

See Users: Show User Profile for the request parameters supported by this method.

Data is returned in the users property of the parameter passed to the callback.

Parameters

  • parameters : Dictionary

    Parameters to send in the request.

  • callback : Callback<CloudUsersResponse>

    Callback function to execute when the method completes.

Returns

  • void
Modules.Cloud.Users
( callback )
Show both public and private information about the user currently logged in. ...

Show both public and private information about the user currently logged in.

Requires user login.

See Users: Show Current User Profile for the request parameters supported by this method.

Data is returned in the users property of the parameter passed to the callback.

Parameters

  • callback : Callback<CloudUsersResponse>

    Callback function to execute when the method completes.

Returns

  • void
Modules.Cloud.Users
( parameters, callback )
Update the current user. ...

Update the current user.

Requires user login.

See Users: Update Current User for the request parameters supported by this method.

Data is returned in the users property of the parameter passed to the callback.

Parameters

  • parameters : Dictionary

    Parameters to send in the request.

  • callback : Callback<CloudUsersResponse>

    Callback function to execute when the method completes.

Returns

  • void