# `getUserInfo()`

Retrieves personal information for the user associated with the current session.

## Syntax

```java
getUserInfoResult result = connection.getUserInfo();
```

## Usage

Use [`getUserInfo()`](/docs/platform/api/guide/sforce-api-calls-getuserinfo.md) to obtain personal information about the currently logged-in user. This convenience API call retrieves and aggregates common profile information that your client application can use for display purposes, performing currency calculations, and so on.

The `getUserInfo()` call applies only to the username under which your client application has logged in. To retrieve additional personal information not found in the [getUserInfoResult](/docs/platform/api/guide/sforce-api-calls-getuserinfo-getuserinforesult.md) object, you can call [`retrieve()`](/docs/platform/api/guide/sforce-api-calls-retrieve.md) on the [User](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_user.htm) object and pass in the [`userID`](/docs/platform/api/guide/sforce-api-calls-getuserinfo-getuserinforesult.md) returned by this call. To retrieve personal information about other users, you could call `retrieve()` (if you know their user ID) or [`query()`](/docs/platform/api/guide/sforce-api-calls-query.md) on the [User](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_user.htm) object.

## Sample Code—Java

This sample calls `getUserInfo()` and writes information about the current user to the console.

```codesegment
public void doGetUserInfo() {
   try {
      GetUserInfoResult result = connection.getUserInfo();
      System.out.println("\nUser Information");
      System.out.println("\tFull name: " + result.getUserFullName());
      System.out.println("\tEmail: " + result.getUserEmail());
      System.out.println("\tLocale: " + result.getUserLocale());
      System.out.println("\tTimezone: " + result.getUserTimeZone());
      System.out.println("\tCurrency symbol: " + result.getCurrencySymbol());
      System.out.println("\tOrganization is multi-currency: " + 
            result.isOrganizationMultiCurrency());
   } catch (ConnectionException ce) {
      ce.printStackTrace();
   }
}
```

## Sample Code—C\#

This sample calls `getUserInfo()` and writes information about the current user to the console.

```codesegment
public void doGetUserInfo()
{
   try
   {
      GetUserInfoResult result = binding.getUserInfo();
      Console.WriteLine("\nUser Information");
      Console.WriteLine("\tFull name: " + result.userFullName);
      Console.WriteLine("\tEmail: " + result.userEmail);
      Console.WriteLine("\tLocale: " + result.userLocale);
      Console.WriteLine("\tTimezone: " + result.userTimeZone);
      Console.WriteLine("\tCurrency symbol: " + result.currencySymbol);
      Console.WriteLine("\tOrganization is multi-currency: " +
            result.organizationMultiCurrency);
   }
   catch (SoapException e)
   {
      Console.WriteLine("An unexpected error has occurred: " +
                        e.Message + "\n" + e.StackTrace);
   }
}
```

## Arguments

None.

## Response

[getUserInfoResult](/docs/platform/api/guide/sforce-api-calls-getuserinfo-getuserinforesult.md)

## Fault

[`UnexpectedErrorFault`](/docs/platform/api/guide/sforce-api-calls-concepts-core-data-objects.md)

**See Also**

- [Utility Calls](/docs/platform/api/guide/utility-calls.md)
