To retrieve details about a specific RoleId use the following query:
https://directory.spineservices.nhs.uk/ORD/2-0-0/roles/RO197
{"Roles": [{"id": "RO197", "code": "197", "displayName": "NHS TRUST", "primaryRole": "true"}]}
To return an XML representation:
https://directory.spineservices.nhs.uk/ORD/2-0-0/roles/RO197?_format=xml
<?xml version="1.0"?>
<CodeSystem oid="2.16.840.1.113883.2.1.3.2.4.17.507" name="OrganisationRole">
<Roles>
<Role>
<id>RO197</id>
<code>197</code>
<displayName>NHS TRUST</displayName>
<primaryRole>true</primaryRole>
</Role>
</Roles>
</CodeSystem>
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.
https://directory.spineservices.nhs.uk/ORD/2-0-0/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.