Skip to main content

GetUserProfile

Retrieves a user profile by its resource name.

Fetches the complete user profile information including all preferences and settings for the specified user profile ID.

Returns the requested UserProfile resource.

Method Options​

Authorisation specification of the GetUserProfile 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: GetUserProfileRequest Message​

FieldTypeRequiredDescription
Name

string

True

The resource name of the user profile to retrieve. Format: iam/user_profiles/{ULIDv2}. This field is required.

Returns: UserProfile Message​

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 with the user profile resource name
// Replace the ULIDv2 with your actual user profile ID
request := &user_profilev1.GetUserProfileRequest{
Name: "iam/user_profiles/01HQZXYZ9ABCDEFGHIJKLMNPQR",
}

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

// Use the retrieved user profile
log.Printf("User Profile Retrieved:")
log.Printf(" Name: %s", userProfile.Name)
log.Printf(" First Name: %s", userProfile.FirstName)
log.Printf(" Last Name: %s", userProfile.LastName)
log.Printf(" User: %s", userProfile.User)
log.Printf(" Locale: %s", userProfile.Locale)
}

Advanced Configuration​

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

Other Methods​