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
Build a
ValidateUserRequestobject using theValidateUserRequestBuilderclass.Call the
validateUser()function using the instance of theLMFeedClientclass.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
| Variable | Type | Description | Optional |
|---|---|---|---|
| accessToken | String | Access token for validation | |
| refreshToken | String | Refresh token for validation |
ValidateUserResponse
List of parameters for the ValidateUserResponse class
| Variable | Type | Description | Optional |
|---|---|---|---|
| success | bool | API success status | |
| errorMessage | String | Error message in case of failure | ✔ |
| user | User | Details of the validated user | ✔ |
| community | Community | Details of the community | ✔ |
| appAccess | bool | Indicates if the user has access to the app | ✔ |