API Docs for: 1.4.7
Show:

User Class

Defined in: src/SDK/User.js:7
Module: SinchInternal

Internal class for manging Sinch Users

Constructor

User

(
  • sinch
)
protected

Defined in src/SDK/User.js:7

Parameters:

  • sinch SinchClient

    A reference to a SinchClient object this object belongs to.

Methods

authenticate

(
  • loginObj
)
protected chainable async

Defined in src/SDK/User.js:121

Internal method to authenticate and store user data in the user object

Parameters:

  • loginObj Object

    Object containing a userObject with auth ticket, or a loginObj specifying password and one of username, number or email.

    • [email] String optional

      Authenticate using email

    • [number] String optional

      Authenticate using number

    • [username] String optional

      Authenticate using username

    • [password] String optional

      The password to authenticate using

    • [expiresIn] String optional

      The desired TTL of a session, in seconds. Default is 24 hours.

Returns:

promise which resolves null on success

create

(
  • signupObj
)
protected chainable async

Defined in src/SDK/User.js:66

Internal method to create a new user, retrieves authentication ticket.

Parameters:

  • signupObj Object

    Object with details on the user. One or more of email/username/number must be specifieed.

    • [email] String optional

      E-mail identity

    • [username] String optional

      username identity

    • [number] String optional

      number identity

Returns:

promise which resolves to an object containing the user and authorization ticket

getMXPConf

() protected chainable async

Defined in src/SDK/User.js:350

Internal method to retrieve MXP user configuration from PAPI. Configuration is store it in "this"

Returns:

promise which resolves null on success

initSessKeySecret

() protected chainable async

Defined in src/SDK/User.js:252

Internal method to retrieve instance (key & secret for signed requests), key and secret stored in {SinchClient} object. (Previously sessions where used, hence the name. TODO: Rename function to something with instances)

Returns:

promise which resolves null on success

resumeSession

() protected chainable async

Defined in src/SDK/User.js:314

Internal method to resume a session.

Returns:

promise which resolves null on success

updateUser

() protected chainable async

Defined in src/SDK/User.js:34

Internal method to update user profile

Returns:

promise which resolves to the new user object on success

Example:

sinchClient.user.updateUser({name: {first: 'First name', last: 'Some last name'}})
    .then(function(newUserObj) {
        //Do things with the new user object    
    });

Properties

sinch

SinchClient protected

Defined in src/SDK/User.js:26

SinchClient instance this user belongs to

userObj

Object protected

Defined in src/SDK/User.js:19

User object with some fundamental information and the user profile. Contents may vary.