Get Role Templates

To get a list of role templates, use the following request:

GET /template_roles.xml
GET /template_roles.json

XML Request Example

curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/template_roles.xml

JSON Request Example

curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' -u 'user:userpass' --url http://onapp.test/template_roles.json

XML Output Example

<template_role type="array">
<template_role>
	<id type="integer">15</id>
	<label>Administrator template</label>
	<identifier>admin_template</identifier>
	<created_at type="dateTime">2020-10-07T12:49:57+03:00</created_at>
	<updated_at type="dateTime">2020-10-07T12:49:57+03:00</updated_at>
	<system type="boolean">true</system>
	<type>TemplateRole</type>
</template_role>
<template_role>
	<id type="integer">16</id>
	<label>User template</label>
	<identifier>user_template</identifier>
	<created_at type="dateTime">2020-10-07T12:49:58+03:00</created_at>
	<updated_at type="dateTime">2020-10-07T12:49:58+03:00</updated_at>
	<system type="boolean">true</system>
	<type>TemplateRole</type>
</template_role>
<template_role>
	<id type="integer">17</id>
	<label>Reseller template</label>
	<identifier>reseller_template</identifier>
	<created_at type="dateTime">2020-10-07T12:49:59+03:00</created_at>
	<updated_at type="dateTime">2020-10-07T12:49:59+03:00</updated_at>
	<system type="boolean">true</system>
	<type>TemplateRole</type>
</template_role>
</template_role>

Where:

id – the role template's ID

label – role title

identifier – role identifier

created_at - time in [YYYY][MM][DD]T[hh][mm][ss]Z format

updated_at - time in [YYYY][MM][DD]T[hh][mm][ss]Z format

system - true if a role cannot be changed otherwise, false


To get a list of role templates by ID, use the following request:

GET /template_roles/:template_roles_id.xml
GET /template_roles/:template_roles_id.json

XML Request Example

curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/template_roles/:template_roles_id.xml

JSON Request Example

curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' -u 'user:userpass' --url http://onapp.test/template_roles/:template_roles_id.json

XML Output Example

<template_role>
	<id type="integer">15</id>
	<label>Administrator template</label>
	<identifier>admin_template</identifier>
	<created_at type="dateTime">2020-10-07T12:49:57+03:00</created_at>
	<updated_at type="dateTime">2020-10-07T12:49:57+03:00</updated_at>
	<system type="boolean">true</system>
	<type>TemplateRole</type>
</template_role>