Skip to main content

A user resource can be retrieved by it's GUID identifier.

getById(userId: string): Promise<User>

Returns

A Promise that will resolve with a User object.

Example

JavaScript
client.security.users.getById('bd8f92eb-d137-49d8-9e7a-560078a8a530')
  .then(result => {      
    console.log('API call result: ', result);              
  })
  .catch(error => {
    console.log('API call error: ', error);      
});

A user resource can be retrieved by its username.

getByUsername(username: string): Promise<User>

Example

JavaScript
client.security.users.getByUsername('testuser')
  .then(result => {      
    console.log('API call result: ', result);              
  })
  .catch(error => {
    console.log('API call error: ', error);      
});

A user resource can be retrieved by it's email address.

getByEmail(email: string): Promise<User>

Example

JavaScript
client.security.users.getByEmail('testuser@test.com')
  .then(result => {      
    console.log('API call result: ', result);              
  })
  .catch(error => {
    console.log('API call error: ', error);      
});

Still need help?

If you still need help after reading this article, don't hesitate to reach out to the Contensis community on Slack or raise a support ticket to get help from our team.
New support request