Skip to main content

Get a group by name

Log in to add to favourites

Get a group by id

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

getById(groupId: string): Promise<Group>

Returns

A Promise that will resolve with a Group object.

Example

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

A group resource can be retrieved by its name.

getByName(username: string): Promise<Group>

Example

JavaScript
client.security.groups.getByNme('Test Group')
  .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