Roles APIs
In Zoho Vertical Solutions, 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 Vertical Solutions.
Get Roles
Purpose
To retrieve the details about roles in your organization.
Request Details
Request URL
{api-domain}/crm/{version}/settings/roles
To get a specific role:
{api-domain}/crm/{version}/settings/roles/{role_id}
Header
Authorization: Zoho-oauthtoken 100xx.d92d4xxxxxxxxxxxxx15f52
Scope
scope=ZohoCRM.settings.roles.{operation_type}
Possible operation types
ALL - Full access to roles data
READ - Retrieve roles data
Sample Request
Copiedcurl "https://www.zylkercorp.zohoplatform.com/crm/v6/settings/roles/3652397000010189001"
-X GET
-H "Authorization: Zoho-oauthtoken 100xx.d92d4xxxxxxxxxxxxx15f52"Copiedresponse = invokeurl
[
	url: "https://www.zylkercorp.zohoplatform.com/crm/v6/settings/roles/3652397000010189001"
	type: GET
	connection:"crm_oauth_connection"
];
info response;Response JSON Keys
- display_labelstringRepresents the display name of the current role. 
- share_with_peersbooleanRepresents if the users with the current role have the permission to share records. 
 Possible Values -true: The users with the current role can share records with other users.
 false: The users with the current role cannot share records with other users.
- namestringRepresents the name of the current role. 
- descriptionstringRepresents the description of the role, if any. 
- idstringRepresents the unique ID of the role. 
- reporting_toJSON objectRepresents the name and ID of the roles which are higher to the current role in the role hierarchy. 
- created_by__sJSON objectRepresents the name and ID of the user that created this role. 
- modified_by__sJSON objectRepresents the name and ID of the user who modified this role last. 
- created_time__sDateTime in the ISO8601 formatRepresents the date and time at which the role was created. 
Possible Errors
- INVALID_URL_PATTERNHTTP 404Please check if the URL trying to access is a correct one 
 Resolution: The request URL specified is incorrect. Specify a valid request URL. Refer to request URL section above.
- OAUTH_SCOPE_MISMATCHHTTP 401Unauthorized 
 Resolution: Client does not have ZohoCRM.settings.roles.READ scope. Create a new client with valid scope. Refer to scope section above.
- NO_PERMISSIONHTTP 403Permission denied to read 
 Resolution: The user does not have permission to read roles data. Contact your system administrator.
- INTERNAL_ERRORHTTP 500Internal Server Error 
 Resolution: Unexpected and unhandled exception in Server. Contact support team.
- INVALID_REQUEST_METHODHTTP 400The http request method type is not a valid one 
 Resolution: You have specified an invalid HTTP method to access the API URL. Specify a valid request method. Refer to endpoints section above.
- AUTHORIZATION_FAILEDHTTP 400User does not have sufficient privilege to read roles 
 Resolution: The user does not have the permission to retrieve roles data. Contact your system administrator.
Sample Response
Copied{
    "roles": [
        {
            "display_label": "SalesRep",
            "created_by__s": {
                "name": "Patricia Boyle",
                "id": "3652397000000186017"
            },
            "modified_by__s": {
                "name": "Patricia Boyle",
                "id": "3652397000000186017"
            },
            "forecast_manager": null,
            "share_with_peers": true,
            "modified_time__s": "2022-11-10T17:25:02+05:30",
            "name": "SalesRep",
            "description": null,
            "reporting_to": {
                "name": "Manager",
                "id": "3652397000000026008"
            },
            "id": "3652397000010189001",
            "created_time__s": "2022-11-10T17:25:02+05:30"
        }
    ]
}