Skip to main content

Validate User

To start using the LikeMinds Feed and enable personalized experiences for your users, you need to initiate 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 initiate User

  1. Create a ValidateUserRequest object using ValidateUserRequest.Builder class by passing all the required parameters.
  2. Call validateUser() function using the instance of LMFeedClient.
  3. Process the response LMResponse<ValidateUserResponse> as per your requirement.
CoroutineScope(Dispatchers.IO).launch {
// object of ValidateUserRequest
val validateUserRequest = ValidateUserRequest.Builder()
.accessToken("ENTER ACCESS TOKEN")
.refreshToken("ENTER REFRESH TOKEN")
.build()
// get response (LMResponse<ValidateUserResponse>)
val response = LMFeedClient.getInstance().validateUser(validateUserRequest)
if (response.success) {
// your function to process the response data
processValidateUserResponse(response.data)
} else {
// your function to process error message
processError(response.errorMessage)
}
}

Models

ValidateUserRequest

VARIABLETYPEDESCRIPTIONOPTIONAL
accessTokenStringaccess token for the user
refreshTokenStringrefresh token for the user

ValidateUserResponse

VARIABLETYPEDESCRIPTIONOPTIONAL
userUserObject of the user initiated.
communityCommunityObject of the community.
appAccessBooleanObject of the user initiated.
logoutResponseLMResponse<Nothing>Logout response in case the user doesn't have the access.