You can create roles in you system and assign them to users , a user can have many
roles .
Each role has a group of permissions and they must be created before creating a
role.
Create a New Role
{Tenant endpoint}/roles
type :
headers
Name
required
type
description
referer
YES
string
The root of the application that is sending the request
(your
website at jusoorlabs.com)
accept
YES
string
the basic accept header (always send it as application/json)
token
YES
string
The token provided to you once you've registerd with
Jusoor Labs API.
parameters
Name
required
type
description
name
YES
string
the name of the role to be created.
permissions
OPTIONAL
array
array of integers , which are the id's of the permissions in
your system (already exist)
Get all roles
{Tenant endpoint}/roles
type :
headers
Name
required
type
description
referer
YES
string
The root of the application that is sending the request
(your
website at jusoorlabs.com)
accept
YES
string
the basic accept header (always send it as application/json)
token
YES
string
The token provided to you once you've registerd with
Jusoor Labs API.
parameters
Name
required
type
description
No parameters required for this request.
Get all roles with their permissions
{Tenant endpoint}/roles/permissions
type :
headers
Name
required
type
description
referer
YES
string
The root of the application that is sending the request
(your
website at jusoorlabs.com)
accept
YES
string
the basic accept header (always send it as application/json)
token
YES
string
The token provided to you once you've registerd with
Jusoor Labs API.
parameters
Name
required
type
description
No parameters required for this request.
Get all roles with their users
{Tenant endpoint}/roles/users
type :
headers
Name
required
type
description
referer
YES
string
The root of the application that is sending the request
(your
website at jusoorlabs.com)
accept
YES
string
the basic accept header (always send it as application/json)
token
YES
string
The token provided to you once you've registerd with
Jusoor Labs API.
parameters
Name
required
type
description
No parameters required for this request.
Get specific role
{Tenant endpoint}/roles/{role_id}
type :
headers
Name
required
type
description
referer
YES
string
The root of the application that is sending the request
(your
website at jusoorlabs.com)
accept
YES
string
the basic accept header (always send it as application/json)
token
YES
string
The token provided to you once you've registerd with
Jusoor Labs API.
parameters
Name
required
type
description
role_id
YES
Integer
the id of the desired role to get (send in the url not in the body of the
request).
Get specific role with permissions
{Tenant endpoint}/roles/{role_id}/permissions
type :
headers
Name
required
type
description
referer
YES
string
The root of the application that is sending the request
(your
website at jusoorlabs.com)
accept
YES
string
the basic accept header (always send it as application/json)
token
YES
string
The token provided to you once you've registerd with
Jusoor Labs API.
parameters
Name
required
type
description
role_id
YES
Integer
the id of the desired role to get (send in the url not in the body of the
request).
Get specific role with users
{Tenant endpoint}/roles/{role_id}/users
type :
headers
Name
required
type
description
referer
YES
string
The root of the application that is sending the request
(your
website at jusoorlabs.com)
accept
YES
string
the basic accept header (always send it as application/json)
token
YES
string
The token provided to you once you've registerd with
Jusoor Labs API.
parameters
Name
required
type
description
role_id
YES
Integer
the id of the desired role to get (send in the url not in the body of the
request).
Update a role
{Tenant endpoint}/roles/{role_id}
type : or (if you send data as form data)
headers
Name
required
type
description
referer
YES
string
The root of the application that is sending the request
(your
website at jusoorlabs.com)
accept
YES
string
the basic accept header (always send it as application/json)
token
YES
string
The token provided to you once you've registerd with
Jusoor Labs API.
parameters
Name
required
type
description
role_id
YES
Integer
the id of the desired role to get (send in the url not in the body of the
request).
name
YES
string
the name that the role's name will be update to.
permissions
YES
string
array of integers , which are the id's of the permissions in
your system (that already exist)
Delete a role
{Tenant endpoint}/roles/{role_id}
type :
headers
Name
required
type
description
referer
YES
string
The root of the application that is sending the request
(your
website at jusoorlabs.com)
accept
YES
string
the basic accept header (always send it as application/json)
token
YES
string
The token provided to you once you've registerd with
Jusoor Labs API.
parameters
Name
required
type
description
role_id
YES
Integer
the id of the desired role to get (send in the url not in the body of the
request).