> For the complete documentation index, see [llms.txt](https://docs.bayunsystems.com/bayuncoresdk-python/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bayunsystems.com/bayuncoresdk-python/groups/get-group-by-id.md).

# 6.5 Get Group By Id

The `getGroupById` returns details of a group. Details include groupId, name, type, groupMembers. Any existing member of the group can retrieve details of the group, including the list of all the group members.

The function takes the following parameters :

* **sessionId** : Unique SessionId which is received in the authenticate function response.
* **groupId** : Group Id of the Group.

{% tabs %}
{% tab title="Python" %}

```python
response = bayunCore.getGroupById("<sessionId>", "<groupId>")
print("\nGroup Id : " + response.groupId)
print("Group Name : " + response.name)

if response.type == bayunCore.GroupTypePublic:
    print("Group Type : Public")
else:
    print("Group Type : Private")
    
groupMembers = response.getGroupMembers()
for member in groupMembers:
    print("\nCompany EmployeeId : " + member.companyEmployeeId)
    print("Company Id : " + member.companyId)
    print("Company Name : " + member.companyName)
```

{% endtab %}
{% endtabs %}
