Skip to main content

Validate User

To start using the LikeMinds Feed and enable personalized experiences for your users, you need to validate them within the system. This process associates a user in your application with a user in the LikeMinds Feed, allowing for seamless integration and personalized recommendations.

Steps to Validate User Session

  1. Build a ValidateUserRequest object using the ValidateUserRequestBuilder class.

  2. Call the validateUser() function using the instance of the LMFeedClient class.

  3. Use the response as per your requirement.

    // Provide user details for initiating the session
    String accessToken = "access_token_here";
    String refreshToken = "refresh_token_here";

    // Build the request object
    ValidateUserRequest request = (ValidateUserRequestBuilder()
    ..accessToken(accessToken)
    ..refreshToken(refreshToken))
    .build();

    // Get the response from calling the function
    final ValidateUserResponse response = await lmFeedClient.validateUser(request);

    // Process the response, as per requirement
    if(response.success){
    // your function to process post liked action
    processValidateUserSuccess(response);
    }else{
    // your function to process error message
    processError(response.errorMessage);
    }
tip

Initiating a user session allows users to access the LikeMinds community, either as registered users or guests.

Models

ValidateUserRequest

List of parameters for the ValidateUserRequest class

VariableTypeDescriptionOptional
accessTokenStringAccess token for validation
refreshTokenStringRefresh token for validation

ValidateUserResponse

List of parameters for the ValidateUserResponse class

VariableTypeDescriptionOptional
successboolAPI success status
errorMessageStringError message in case of failure
userUserDetails of the validated user
communityCommunityDetails of the community
appAccessboolIndicates if the user has access to the app