GET /api/roles
Llista tots els rols

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Must be a Integer

search
optional

filtra els resultats

Validations:

  • Must be a String

order
optional

Sort field and order, eg. ‘id DESC’

Validations:

  • Must be a String

page
optional

Page number, starting at 1

Validations:

  • Must be a number.

per_page
optional

Nombre de resultats per pàgina a retornar

Validations:

  • Must be a number.

Search fields

Field name Tipus Possible values
builtin true, false
description
name
permission string

GET /api/roles/:id
Mostra un rol

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Must be a Integer

id
required

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.

description
optional

Validations:

  • Must be a String


POST /api/roles
Crea un rol

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Must be a Integer

role
required

Validations:

  • Must be a Hash

role[name]
required

Validations:

  • Must be a String

role[description]
optional , nil allowed

Descripció del rol

Validations:

  • Must be a String

role[location_ids]
optional , nil allowed

SUBSTITUEIX les ubicacions amb els ID donats

Validations:

  • Must be an array of any type

role[organization_ids]
optional , nil allowed

SUBSTITUEIX les organitzacions amb els ID donats.

Validations:

  • Must be an array of any type


PUT /api/roles/:id
Actualitza un rol

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Must be a Integer

id
required

Validations:

  • Must be a String

role
required

Validations:

  • Must be a Hash

role[name]
optional

Validations:

  • Must be a String

role[description]
optional , nil allowed

Descripció del rol

Validations:

  • Must be a String

role[location_ids]
optional , nil allowed

SUBSTITUEIX les ubicacions amb els ID donats

Validations:

  • Must be an array of any type

role[organization_ids]
optional , nil allowed

SUBSTITUEIX les organitzacions amb els ID donats.

Validations:

  • Must be an array of any type


DELETE /api/roles/:id
Suprimeix un rol

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Must be a Integer

id
required

Validations:

  • Must be a String


POST /api/roles/:id/clone
Clone a role

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Must be a Integer

id
required

Validations:

  • Must be a String

role
required

Validations:

  • Must be a Hash

role[name]
optional

Validations:

  • Must be a String

role[description]
optional , nil allowed

Descripció del rol

Validations:

  • Must be a String

role[location_ids]
optional , nil allowed

SUBSTITUEIX les ubicacions amb els ID donats

Validations:

  • Must be an array of any type

role[organization_ids]
optional , nil allowed

SUBSTITUEIX les organitzacions amb els ID donats.

Validations:

  • Must be an array of any type