Moogsoft Docs

getUser

A MoogDb v2 method that returns details of a user.

Back to MoogDb V2 API Method Reference.

Request arguments

Method getUser takes the following request arguments:

Name

Type

Required

Description

userId

Number

No, if you specify username.

A valid user ID.

username

String

No, if you specify userId.

A valid username.

Response

Method getUser returns the following response:

Type

Description

CEvent

A CEvent object containing the user information.

Examples

The following examples demonstrate typical use of method getUser:

Request example

Example request to return the details of user ID 6:

var cevent = moogdb.getUser(6);

Response example

Example response returning the details of user ID 6:

{
    active=true, competencies=[],
    contact_num=,
    department=null,
    description=Online,
    email=, fullname=cyber,
    groupname=End-User,
    invitations=[],
    joined=1516963803,
    only_ldap=0,
    photo=-1,
    primary_group=1,
    profile_image=null,
    realms=[DB],
    roles=[1, 3, 4, 5],
    session_expiry=null,
    status=1,
    teams=[],
    timezone=SYSTEM,
    uid=6,
    username=cyber
}