User

User

User Objects

class User()

This class allow make get request to user resource into Opengate North API.

constructor
function constructor()

Constructor

Arguments:

  • Reference InternalOpenGateAPI - to the API object.

changeApiKey
function changeApiKey(apiKey: String) -> 'Promise'

This invoke a request to OpenGate North API and the callback is managed by promises This function updates a apiKey of a user

Arguments:

  • apiKey String - required field

Returns:

  • Promise

Example:

 ogapi.usersBuilder().withEmail(example@example.es).withPassword(oldPassword).changeApiKey(newPassword);

changePassword
function changePassword(newPassword: String) -> 'Promise'

This invoke a request to OpenGate North API and the callback is managed by promises This function updates a password of a user

Arguments:

  • newPassword String - required field

Returns:

  • Promise

Example:

 ogapi.usersBuilder().withEmail(example@example.es).withPassword(oldPassword).changePassword(newPassword);

generateApiKey
function generateApiKey() -> '*'

Returns:

  • *

login
function login(email: String,password: String,twoFaCode: String) -> 'Promise'

This invoke a request to OpenGate North API and the callback is managed by promises This function get a JWT for user with Two Factor Authorithation (optional)

Arguments:

  • email String - required field
  • password String - required field
  • twoFaCode String - optional field

Returns:

  • Promise

Example:

 ogapi.usersBuilder().login(email, password);
 ogapi.usersBuilder().login(email, password, twoFaCode);

requestResetPassword
function requestResetPassword() -> 'Promise'

This invoke a request to OpenGate North API and the callback is managed by promises This function request for new password when the user forgets it. Sends a password recovery email

Returns:

  • Promise

Example:

 ogapi.usersBuilder().withEmail(example@example.es).requestResetPassword()

updatePassword
function updatePassword(newPassword: String,tokenId: String) -> 'Promise'

This invoke a request to OpenGate North API and the callback is managed by promises This function updates a password of a user with a tokenId

Arguments:

  • newPassword String - required field
  • tokenId String - required field

Returns:

  • Promise

Example:

 ogapi.usersBuilder().withEmail(example@example.es).updatePassword(newPassword, tokenid);

with2FaType
function with2FaType(twoFaType: string) -> 'User'

Set the 2FaType attribute

Arguments:

  • twoFaType string - required field

Returns:

  • User

withApiKey
function withApiKey(apiKey: string) -> 'User'

Set the apiKey attribute. Only on update user

Arguments:

  • apiKey string - required field

Returns:

  • User

withCountryCode
function withCountryCode(countryCode: string) -> 'User'

Set the countryCode attribute

Arguments:

  • countryCode string - required field

Returns:

  • User

withDescription
function withDescription(description: string) -> 'User'

Set the description attribute

Arguments:

  • description string - required field

Returns:

  • User

withDomain
function withDomain(domain: string) -> 'User'

Set the domain attribute

Arguments:

  • domain string - required field

Returns:

  • User

withEmail
function withEmail(email: string) -> 'User'

Set the email attribute

Arguments:

  • email string - required field

Returns:

  • User

withForcePasswordChange
function withForcePasswordChange(forcePasswordChange: boolean) -> 'User'

Set the forcePasswordChange: if true Forces you to reset your password on your next login attempt.

Arguments:

  • forcePasswordChange boolean

Returns:

  • User

withLangCode
function withLangCode(langCode: string) -> 'User'

Set the langCode attribute

Arguments:

  • langCode string - required field

Returns:

  • User

withName
function withName(name: string) -> 'User'

Set the name attribute

Arguments:

  • name string - required field

Returns:

  • User

withPassword
function withPassword(password: string) -> 'User'

Set the password attribute

Arguments:

  • password string - required field

Returns:

  • User

withProfile
function withProfile(profile: string) -> 'User'

Set the profile attribute

Arguments:

  • profile string - required field

Returns:

  • User

withSurname
function withSurname(surname: string) -> 'User'

Set the surname attribute

Arguments:

  • surname string - required field

Returns:

  • User

withTimezone
function withTimezone(timezone: string) -> 'User'

Set the timezone attribute

Arguments:

  • timezone string - required field

Returns:

  • User

withWorkgroup
function withWorkgroup(workgroup: string) -> 'User'

Set the workgroup attribute

Arguments:

  • workgroup string - required field

Returns:

  • User