User
User
User Objects
class User()This class allow make get request to user resource into Opengate North API.
constructor
function constructor()Constructor
Arguments:
ReferenceInternalOpenGateAPI - 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:
apiKeyString - 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:
newPasswordString - 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:
emailString - required fieldpasswordString - required fieldtwoFaCodeString - 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:
newPasswordString - required fieldtokenIdString - 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:
twoFaTypestring - required field
Returns:
User
withApiKey
function withApiKey(apiKey: string) -> 'User'Set the apiKey attribute. Only on update user
Arguments:
apiKeystring - required field
Returns:
User
withCountryCode
function withCountryCode(countryCode: string) -> 'User'Set the countryCode attribute
Arguments:
countryCodestring - required field
Returns:
User
withDescription
function withDescription(description: string) -> 'User'Set the description attribute
Arguments:
descriptionstring - required field
Returns:
User
withDomain
function withDomain(domain: string) -> 'User'Set the domain attribute
Arguments:
domainstring - required field
Returns:
User
withEmail
function withEmail(email: string) -> 'User'Set the email attribute
Arguments:
emailstring - 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:
forcePasswordChangeboolean
Returns:
User
withLangCode
function withLangCode(langCode: string) -> 'User'Set the langCode attribute
Arguments:
langCodestring - required field
Returns:
User
withName
function withName(name: string) -> 'User'Set the name attribute
Arguments:
namestring - required field
Returns:
User
withPassword
function withPassword(password: string) -> 'User'Set the password attribute
Arguments:
passwordstring - required field
Returns:
User
withProfile
function withProfile(profile: string) -> 'User'Set the profile attribute
Arguments:
profilestring - required field
Returns:
User
withSurname
function withSurname(surname: string) -> 'User'Set the surname attribute
Arguments:
surnamestring - required field
Returns:
User
withTimezone
function withTimezone(timezone: string) -> 'User'Set the timezone attribute
Arguments:
timezonestring - required field
Returns:
User
withWorkgroup
function withWorkgroup(workgroup: string) -> 'User'Set the workgroup attribute
Arguments:
workgroupstring - required field
Returns:
User