Roles APIs
In Bigin, Administrators assign roles to the users. Roles, such as Managers, Sales Reps, Supervisors, Product Management Staff, etc., denote the different levels of employees in a company. Use this API to retrieve information about various roles in Bigin.
Get Roles
Purpose
To retrieve the details about roles in your organization.
Request Details
Request URL
https://www.zohoapis.com/bigin/v1/settings/roles
Scope
scope=ZohoBigin.settings.roles.{operation_type}
Possible operation types
ALL - Full access to roles data
READ - Retrieve roles data
Sample Request
Copiedcurl "https://www.zohoapis.com/bigin/v1/settings/roles"
-X GET
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
CopiedZBiginRestClient restClient = ZBiginRestClient.getInstance();
BulkAPIResponse response = restClient.getOrganizationInstance().getAllRoles();
List<ZBiginRole> roles = (List<ZBiginRole>) response.getData(); // roles - list of ZBiginRole instance
Copieddef get_roles(self):
try:
resp = ZBiginOrganization.get_instance().get_all_roles()
roles = resp.data
print(resp.status_code)
for role in roles:
print("\n\n")
print(role.name)
print(role.id)
print(role.display_label)
print(role.is_admin)
if role.reporting_to is not None:
print(role.reporting_to.id)
print(role.reporting_to.name)
except ZBiginException as ex:
print(ex.status_code)
print(ex.error_message)
print(ex.error_code)
print(ex.error_details)
print(ex.error_content)
CopiedZBiginRestClient restClient = ZBiginRestClient.GetInstance();
BulkAPIResponse<ZBiginRole> response = restClient.GetOrganizationInstance().GetAllRoles();
List<ZBiginRole> roles = response.BulkData; // roles - list of ZBiginRole instance
Copiedresponse = invokeurl
[
url: "https://www.zohoapis.com/bigin/v1/settings/roles"
type: GET
connection:"bigin_oauth_connection"
];
info response;
Sample Response
Copied{
"roles": [
{
"display_label": "CEO",
"share_with_peers": true,
"name": "CEO",
"description": "Users with this role have access to the data owned by all other users.",
"id": "4150868000000026005",
"reporting_to": null,
"admin_user": true
},
{
"display_label": "Manager",
"share_with_peers": false,
"name": "Manager",
"description": "Users belonging to this role cannot see data for admin users.",
"id": "4150868000000026008",
"reporting_to": {
"name": "Sales department Head",
"id": "4150868000000231921"
},
"admin_user": false
},
{
"display_label": "Sales rep",
"share_with_peers": true,
"name": "Sales rep",
"description": "Lowest in the heirarchy",
"id": "4150868000000231917",
"reporting_to": {
"name": "Manager",
"id": "4150868000000026008"
},
"admin_user": false
},
{
"display_label": "Sales department Head",
"share_with_peers": true,
"name": "Sales department Head",
"description": "Sales department head",
"id": "4150868000000231921",
"reporting_to": {
"name": "CEO",
"id": "4150868000000026005"
},
"admin_user": false
}
]
}