Skip to main content

Roles endpoint

This page includes the roles endpoint description, parameters and an example.<RoleId>?{parameters}{parameters}


Retrieve CodeSystems information for Roles meta data.




String - case sensitive
Can take xml, json, text/json, text/xml, application/json and application/xml as arguments.
If this parameter is not supplied, the format will default to JSON.
Note that _format specifies the format in which descriptive content is displayed.



To retrieve details about a specific RoleId use the following query:

{"Roles": [{"id": "RO197", "code": "197", "displayName": "NHS TRUST", "primaryRole": "true"}]}

To return an XML representation:

<?xml version="1.0"?>
<CodeSystem oid="2.16.840.1.113883." name="OrganisationRole">
<displayName>NHS TRUST</displayName>

Note that details retrieved from the roles endpoint states whether the Role returned by the query is a Primary Role and is set to true or false for each record.
Use the following query retrieve information relating to all Roles.

{"Roles": [{"id": "RO180", "code": "180", "displayName": "PRIMARY CARE TRUST SITE", "primaryRole": "true"}, {"id": "RO108", "code": "108", "displayName": "CARE TRUST SITE", "primaryRole": "true"}, {"id": "RO122", "code": "122", "displayName": "LOCAL AUTHORITY SITE - LEGACY", "primaryRole": "true"}, {"id": "RO175", "code": "175", "displayName": "PRISON", "primaryRole": "true"}, {"id": "RO24", "code": "24", "displayName": "NHS TRUST DERIVED", "primaryRole": "false"}, {"id": "RO126", "code": "126", "displayName": "GOVERNMENT DEPARTMENT", "primaryRole": "true"}, {"id": "RO161", "code": "161", "displayName": "NHS SUPPORT AGENCY", "primaryRole": "true"}, {"id": "RO200", "code": "200", "displayName": "WELSH ASSEMBLY", "primaryRole": "true"}, {"id": "RO123", "code": "123", "displayName": "LOCAL AUTHORITY DEPARTMENT", "primaryRole": "true"}, {"id": "RO140", "code": "140", "displayName": "ISLE OF MAN GOVERNMENT DIRECTORATE SITE", "primaryRole": "true"}, {"id": "RO90", "code": "90", "displayName": "EXECUTIVE AGENCY SITE", "primaryRole": "true"},…]}

Note that the output will display all Roles but it has been truncated as indicated by ,… in the details returned.  This endpoint also returns all the data as XML when the parameter _format=xml is supplied by the client.

Last edited: 23 August 2019 1:43 pm