Get User Profile
To retrieve the user profile information in the LikeMinds Feed, use the getProfile() function.
Steps to Get User Profile
Build a
GetProfileRequestobject using theGetProfileRequestBuilderclass.Call the
getProfile()function using the instance of theLMFeedClientclass.Use the response as per your requirement.
// Provide user details for fetching the profile
String userUniqueId = "user_unique_id_here";
// Build the request object
GetProfileRequest request = (GetProfileRequestBuilder()
..userUniqueId(userUniqueId))
.build();
// Get the response from calling the function
final GetProfileResponse response = await lmFeedClient.getProfile(request);
// Process the response, as per requirement
if(response.success){
// your function to process user profile
processUserProfile(response);
}else{
// your function to process error message
processError(response.errorMessage);
}
tip
Fetching user profile provides detailed information about a specific user in the LikeMinds Feed.
Models
GetProfileRequest
List of parameters for the GetProfileRequest class
| Variable | Type | Description | Optional |
|---|---|---|---|
| userUniqueId | String | Unique ID of the user | ✔ |
GetProfileResponse
List of parameters for the GetProfileResponse class
| Variable | Type | Description | Optional |
|---|---|---|---|
| success | bool | API success status | |
| errorMessage | String | Error message in case of failure | ✔ |
| communityName | String | Name of the community | ✔ |
| member | User | Details of the member | ✔ |
| menu | List<MemberAction> | List of member actions | ✔ |
| questionAnswer | List<QuestionAnswer> | List of question answers | ✔ |
| widgets | Map<String, WidgetModel> | Map of widget models (key: widget ID) | ✔ |