» Portal Module SDK Documentation

Portal Login

Functionportal_login()

Purpose

This endpoint is used to authenticate a user on the Exsited portal. It validates the user's email and password credentials and returns basic profile information along with accessible portal details. This login process enables secure access to the Exsited platform and associated modules.

Parameters

Parameter Type Description
email string The email address of the user attempting to log in.
password string The password associated with the user’s email account.

Use Case

The portal login API is typically used when a user attempts to access the Exsited portal. By providing a valid email and password, the SDK initiates a login request to the system and retrieves authentication details, which include user type, name, and accessible portals. This is a primary authentication step required for accessing restricted reports, dashboards, and related portal features. Below are example implementations for both Python and PHP SDKs.

def portal_login():
    SDKConfig.PRINT_REQUEST_DATA = True
    SDKConfig.PRINT_RAW_RESPONSE = False

    token_file_path = "shared_token.json"
    file_token_mgr = FileTokenManager(token_file_path)

    exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(
        request_token_dto=CommonData.get_request_token_dto(),
        file_token_mgr=file_token_mgr
    )

    try:
        request_data = ReportLoginRequestDTO(email="<USER_EMAIL>", password="<USER_PASSWORD>")
        response = exsited_sdk.portal.portal_login(request_data=request_data)
        print(response)
    except ABException as ab:
        print(ab)
        print(ab.get_errors())
        print(ab.raw_response)

Response

The response returns a user object containing profile and portal access details. It confirms that the provided credentials are valid and the user has permission to access specific Exsited portals. The returned data includes user type, display name, email address, and a list of portals with their UUIDs and display names.

ReportLoginResponseDTO(
    user=ReportLoginUserDTO(
        type="<USER_TYPE>",
        name="<USER_NAME>",
        emailAddress="<USER_EMAIL>",
        imageUri="<USER_IMAGE_URI>",
        grantAccessPortal="<BOOLEAN_VALUE>",
        portals=[
            ReportLoginPortalDTO(
                account="<ACCOUNT_ID>",
                displayName="<DISPLAY_NAME>",
                uuid="<PORTAL_UUID>"
            )
        ]
    )
)

Portal Change Password

Functionportal_change_password()

Purpose

This endpoint allows an authenticated portal user to securely change their existing password. It requires the user's registered email, current password, and new password. This function is typically used to enhance account security by enabling users to update their login credentials regularly or when they suspect unauthorized access.

Parameters

Parameter Type Description
email string The registered email address of the user whose password is being changed.
currentPassword string The current active password of the user. This is required for authentication before updating the password.
newPassword string The new password the user wishes to set. It must follow the platform’s password policy for strength and complexity.

Use Case

The change password API is used when a portal user wants to update their login credentials for security or personal reasons. The SDK sends the user’s current and new passwords to the server for validation. If the provided credentials are correct, the system updates the password and returns a success message. This operation ensures secure management of user credentials and prevents unauthorized password updates. Below are example implementations for both Python and PHP SDKs.

def portal_change_password():
    SDKConfig.PRINT_REQUEST_DATA = True
    SDKConfig.PRINT_RAW_RESPONSE = False

    token_file_path = "shared_token.json"
    file_token_mgr = FileTokenManager(token_file_path)

    exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(
        request_token_dto=CommonData.get_request_token_dto(),
        file_token_mgr=file_token_mgr
    )

    try:
        request_data = ReportChangePasswordRequestDTO(
            email="<USER_EMAIL>",
            currentPassword="<CURRENT_PASSWORD>",
            newPassword="<NEW_PASSWORD>"
        )
        response = exsited_sdk.portal.portal_change_password(request_data=request_data)
        print(response)
    except ABException as ab:
        print(ab)
        print(ab.get_errors())
        print(ab.raw_response)

Response

The response confirms the outcome of the password change request. If the operation is successful, the response returns a confirmation message indicating that the password was changed successfully. In case of invalid credentials or other validation errors, an error message will be returned instead.

ReportChangePasswordResponseDTO(
    message="<SUCCESS_MESSAGE>"
)