Retrieve security roles of an employee

GET https://api.zenoti.com/v1/employees/{employee_id}/security_roles

The purpose of this API is to list all the security roles of an employee at all levels of the organization.

Before you begin

Permission: Manage API Keys (on the Administrator security object) — Required to access Zenoti APIs.

Endpoint

GET /v1/employees/{employee_id}/security_roles

Base URL: https://api.zenoti.com

Request

Headers

Header Required Description
Authorization Yes bearer {{access_token}}

Path parameters

Parameter Type Required Description
employee_id string Yes Employee id for whom the details are to be fetched.

Query parameters

Parameter Type Required Default Description
view_id string Yes — Id of the center, organization, or zone with which the employee is associated.
view_type enum (0, 1, 2) Yes — Choose any one of the following: Center - 2, Zone - 1, Organization - 0.

Response

Success (200 OK)

{}

Example

curl --request GET \
  --url 'https://api.zenoti.com/v1/employees/{employee_id}/security_roles?view_id={{view_id}}&view_type={{view_type}}' \
  --header 'Authorization: bearer {{access_token}}'
const response = await fetch('https://api.zenoti.com/v1/employees/{employee_id}/security_roles', {
  method: 'GET',
  headers: {
    'Authorization': 'bearer {{access_token}}'
  },
});
const data = await response.json();
import requests

response = requests.get(
    'https://api.zenoti.com/v1/employees/{employee_id}/security_roles',
    headers={
        'Authorization': 'bearer {{access_token}}',
    },
)
data = response.json()
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "bearer {{access_token}}");
var response = await client.GetAsync(
    "https://api.zenoti.com/v1/employees/{employee_id}/security_roles");
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'

uri = URI('https://api.zenoti.com/v1/employees/{employee_id}/security_roles')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['Authorization'] = 'bearer {{access_token}}'
response = http.request(request)
data = JSON.parse(response.body)

Error codes

Status Description
400 400
401 Unauthorized -- invalid or expired access token
429 Too many requests -- rate limit exceeded