Get current user

get
https://api.box.com/2.0
/users/me

Retrieves information about the user who is currently authenticated.

In the case of a client-side authenticated OAuth 2.0 application this will be the user who authorized the app.

In the case of a JWT, server-side authenticated application this will be the service account that belongs to the application by default.

Use the As-User header to change who this API call is made on behalf of.

Request

Bearer [ACCESS_TOKEN]
application/json

Query Parameters

string arrayin queryoptional
id,type,name

A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response.

Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested.

Response

application/jsonUser (Standard)

Returns a single user object.

application/jsonClient error

An unexpected client error.

get
Get current user
You can now try out some of our APIs live, right here in the documentation.
Log in

Request Example

cURL
curl -X GET https://api.box.com/2.0/users/me \
     -H 'Authorization: Bearer <ACCESS_TOKEN>'
.NET
BoxUser currentUser = await client.UsersManager.GetCurrentUserInformationAsync();
Java
BoxUser user = BoxUser.getCurrentUser(api);
BoxUser.Info info = user.getInfo();
Python
current_user = client.user().get()
Node
client.users.get(client.CURRENT_USER_ID)
	.then(currentUser => {
		/* currentUser -> {
            type: 'user',
            id: '33333',
            name: 'Example User',
            login: 'user@example.com',
            created_at: '2012-03-26T15:43:07-07:00',
            modified_at: '2012-12-12T11:34:29-08:00',
            language: 'en',
            space_amount: 5368709120,
            space_used: 2377016,
            max_upload_size: 262144000,
            status: 'active',
            job_title: 'Employee',
            phone: '5555555555',
            address: '555 Office Drive',
            avatar_url: 'https://app.box.com/api/avatar/deprecated' }
        */
	});
iOS
client.users.getCurrent(fields: ["name", "login"]) { (result: Result<User, BoxSDKError>) in
    guard case let .success(user) = result else {
        print("Error getting user information")
        return
    }

    print("Authenticated as \(user.name), with login \(user.login)")
}

Response Example

{
  "id": 11446498,
  "type": "user",
  "address": "900 Jefferson Ave, Redwood City, CA 94063",
  "avatar_url": "https://www.box.com/api/avatar/large/181216415",
  "created_at": "2012-12-12T10:53:43-08:00",
  "job_title": "CEO",
  "language": "en",
  "login": "ceo@example.com",
  "max_upload_size": 2147483648,
  "modified_at": "2012-12-12T10:53:43-08:00",
  "name": "Aaron Levie",
  "notification_email": {
    "email": "notifications@example.com",
    "is_confirmed": true
  },
  "phone": 6509241374,
  "space_amount": 11345156112,
  "space_used": 1237009912,
  "status": "active",
  "timezone": "Africa/Bujumbura"
}