Get Logged-in User

Get Logged-in User - kintone.getLoginUser()

Retrieves the user information of the user that is currently viewing the page.

Function

kintone.getLoginUser()

Returns

PROPERTY TYPE VALUE & DESCRIPTION
id String User ID. Auto incremented by the service.
code String Login name. For guest users, this will be their email.
name String Display name.
email String E-mail Address.
url String URL. Blank for guest users.
employeeNumber String Employee ID. Blank for guest users.
phone String Phone.
mobilePhone String Mobile Phone. Blank for guest users.
extensionNumber String Extension. Blank for guest users.
timezone String Time Zone.
isGuest Boolean true for guest users, false for non-guest users.
language String Language selected in the Language & Time Zone settings
  • en: English
  • ja: Japanese
  • zh: Chinese
  • es: Spanish
If the user has selected Use Web browser settings, the returned string will be dependent on the language settings of the browser.

Sample Request

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
var user = kintone.getLoginUser();
console.log(user);

// returns
// {
//   'id': '7',
//   'code': 'john-d',
//   'name': 'John Doe',
//   'email': 'johndoe@kintone.com',
//   'url': 'http://www.kintone.com',
//   'employeeNumber': '100',
//   'phone': '415-000-0000',
//   'mobilePhone': '400-000-0000',
//   'extensionNumber': '1001',
//   'timezone': 'America/Los_Angeles',
//   'isGuest': false
//   'language': 'en'
// }

Limitations

  • This API can be used on any page.
  • This API can be used on both Desktops and Smartphones.
  • This API cannot be initiated from apps attached to bodies of Spaces/Threads/Announcements.