RICADO Gen 4 API JS Client

RICADO Gen 4 API JS Client

Class

UserAccountActionTokenController

Controller Class for User Account Action Tokens

Constructor

new UserAccountActionTokenController()

Source

Methods

static

activateAction(token, email, password, firstName, lastName) → {Promise.<{email: string, firstName: string, lastName: string}>}

Activate a User's Account [POST /user-action-tokens/actions/activate]

This method is used to Activate a User's Account

Parameters

  • token string

    The JWT Token that was provided in the form of a Link to the User's Email Address

  • email string

    The User's Email Address

  • password string

    The User's Chosen Password

  • firstName string

    The User's First Name

  • lastName string

    The User's Last Name

Returns

  • Promise.<{email: string, firstName: string, lastName: string}>

Source

static

create(createData) → {Promise.<UserAccountActionTokenModel>}

Create a User Account Action Token [POST /user-action-tokens]

Parameters

  • createData UserAccountActionTokenController.CreateData

    The User Account Action Token Create Data

Returns

  • Promise.<UserAccountActionTokenModel>

Source

static

createToken(email, action, providerId) → {Promise.<boolean>}

Generate a new Action Token [POST /user-action-tokens/new]

This method is used to generate a new JWT to be used for a User Action (e.g. to Reset a User's Password). The JWT is sent to the User's Email Address in a formatted Email in the form of a Link.

Parameters

  • email string

    A User Account's Email Address

  • action string

    The Action that will be performed

  • providerId string

    The Platform Provider ID

Returns

  • Promise.<boolean>

Source

static

getActivateActionDetails(token) → {Promise.<{email: string, firstName: string, lastName: string}>}

Retrieve a User's Details for Activation [GET /user-action-tokens/actions/activate]

This method is used to Request a User's Details which can be used to populate fields required for Account Activation

Parameters

  • token string

    The JWT Token that was provided in the form of a Link to the User's Email Address

Returns

  • Promise.<{email: string, firstName: string, lastName: string}>

Source

static

getAll(queryParametersopt) → {Promise.<Array.<UserAccountActionTokenModel>>}

List all User Account Action Tokens [GET /user-action-tokens]

Parameters

  • queryParameters UserAccountActionTokenController.GetAllQueryParameters <optional>

    The Optional Query Parameters

Returns

  • Promise.<Array.<UserAccountActionTokenModel>>

Source

static

getOne(id) → {Promise.<UserAccountActionTokenModel>}

Retrieve a User Account Action Token [GET /user-action-tokens/{id}]

Parameters

  • id string

    The User Account Action Token ID

Returns

  • Promise.<UserAccountActionTokenModel>

Source

static

resetPasswordAction(token, newPassword) → {Promise.<boolean>}

Reset a User's Password [POST /user-action-tokens/actions/reset-password]

This method is used to Reset a User's Password

Parameters

  • token string

    The JWT Token that was provided in the form of a Link to the User's Email Address

  • newPassword string

    The New Password

Returns

  • Promise.<boolean>

Source

static

resetPinCodeAction(token, newPinCode) → {Promise.<boolean>}

Reset a User's Pin Code [POST /user-action-tokens/actions/reset-pin-code]

This method is used to Reset a User's Pin Code

Parameters

  • token string

    The JWT Token that was provided in the form of a Link to the User's Email Address

  • newPinCode string

    The New Pin Code

Returns

  • Promise.<boolean>

Source

static

update(id, updateData) → {Promise.<UserAccountActionTokenModel>}

Update a User Account Action Token [PATCH /user-action-tokens/{id}]

Parameters

  • id string

    The User Account Action Token ID

  • updateData UserAccountActionTokenController.UpdateData

    The User Account Action Token Update Data

Returns

  • Promise.<UserAccountActionTokenModel>

Source

static

verifyToken(token, action) → {Promise.<boolean>}

Verify an existing Action Token [POST /user-action-tokens/verify]

This method is used to verify an existing JWT and confirm it is valid for the specified Action.

Parameters

  • token string

    The JWT Token that was provided in the form of a Link to the User's Email Address

  • action string

    The Action that will be performed

Returns

  • Promise.<boolean>

Source

Type Definitions

CreateData

The Create Data for a User Account Action Token

Type

  • Object

Properties

  • accountId string

    The Account this Action Token belongs to

  • companyId string

    The Company this Action Token belongs to

  • action string

    The Action that can be Performed using this Action Token

  • issueTimestamp Date

    When the Action Token was issued

  • expireTimestamp Date

    When the Action Token will expire

  • activityTimestamp Date <optional>
    <nullable>

    When the last API call using this Action Token was made

  • completedTimestamp Date <optional>
    <nullable>

    When the Action was Completed

  • emailTimestamp Date <optional>
    <nullable>

    When the Action Email was Sent

Source

GetAllQueryParameters

The Optional Query Parameters for the getAll Function

Type

  • Object

Properties

  • accountId string <optional>

    The Account this Action Token belongs to

  • companyId string <optional>

    The Company this Action Token belongs to

  • action string <optional>

    The Action that can be Performed using this Action Token

  • issueTimestamp Date <optional>

    When the Action Token was issued

  • expireTimestamp Date <optional>

    When the Action Token will expire

Source

UpdateData

The Update Data for a User Account Action Token

Type

  • Object

Properties

  • activityTimestamp Date <optional>
    <nullable>

    When the last API call using this Action Token was made

  • completedTimestamp Date <optional>
    <nullable>

    When the Action was Completed

  • emailTimestamp Date <optional>
    <nullable>

    When the Action Email was Sent

Source