Skip to main content

ListUserProfiles

Lists all user_profiles accessible to the caller.

Returns a collection of all user_profiles within the caller's access scope based on group ownership and role permissions.

Returns a ListUserProfilesResponse containing all accessible user_profiles.

Method Options​

Authorisation specification of the ListUserProfiles method.

TypeMETHOD_TYPE_READ
Access LevelMETHOD_ACCESS_LEVEL_AUTHORISED
Roles
  • ROLE_IAM_ADMIN
  • ROLE_IAM_VIEWER
  • ROLE_IAM_USER_PROFILE_ADMIN
  • ROLE_IAM_USER_PROFILE_VIEWER

Parameters​

Request and response parameter message overview:

Input: ListUserProfilesRequest Message​

No parameters required.

Returns: ListUserProfilesResponse Message​

FieldTypeDescription
UserProfiles

meshtrade.iam.user_profile.v1.UserProfile[]

The list of user profiles. Ordered by creation time, with most recent first.

Code Examples​

Select supported SDK in the language of your choice for a full example of how to invoke the this method:

package main

import (
"context"
"log"

user_profilev1 "github.com/meshtrade/api/go/iam/user_profile/v1"
)

func main() {
ctx := context.Background()

// Default configuration is used and credentials come from MESH_API_CREDENTIALS
// environment variable or default discovery methods. Zero config required
// unless you want custom configuration.
service, err := user_profilev1.NewUserProfileService()
if err != nil {
log.Fatalf("Failed to create service: %v", err)
}
defer service.Close()

// Create request - no parameters needed for simple list
request := &user_profilev1.ListUserProfilesRequest{}

// Call the ListUserProfiles method
response, err := service.ListUserProfiles(ctx, request)
if err != nil {
log.Fatalf("ListUserProfiles failed: %v", err)
}

// Process the user profile directory
log.Printf("Found %d user profiles in the accessible hierarchy:", len(response.UserProfiles))
for i, profile := range response.UserProfiles {
log.Printf("User Profile %d:", i+1)
log.Printf(" Name: %s", profile.Name)
log.Printf(" First Name: %s", profile.FirstName)
log.Printf(" Last Name: %s", profile.LastName)
log.Printf(" User: %s", profile.GetUser())
log.Printf(" Owner: %s", profile.Owner)
log.Println()
}
}

Advanced Configuration​

For advanced client configuration options (custom endpoints, TLS settings, timeouts), see the SDK Configuration Guide.

Other Methods​