# 6.3 Get Unjoined Public Groups

The `getUnjoinedPublicGroups` function returns all the public groups of the company the employee is not a member of.

The function takes the following parameters :

* **sessionId** : Unique SessionId which is received in the registration/login function response.

{% tabs %}
{% tab title="C++" %}
```cpp
#include "BayunCore.h"

Bayun::ShUnjoinedPublicGroupsResponse response = bayunCore->unjoinedPublicGroups("<sessionId>");
if (response != nullptr) {
   std::vector<Bayun::ShGroupInfo> groups = response->getGroups();
}
```
{% endtab %}
{% endtabs %}
