Skip to main content

Access Control (REST) API - LDAP Role Mappings

This section includes REST APIs for working with Access Control LDAP Role Mapping tasks.

Get All LDAP Role Mapping - GET /LDAPRoleMappings

Get details of all LDAP role mapping.

Notice

The ‘Manage Authentication Providers’ permission is required to execute this API.

Usage:

  1. GET /LDAPServers and get details of all LDAP Servers

  2. GET /LDAPRoleMappings?ldapServerId={id} and get the specific LDAP role mapping

URL

/cxrestapi/auth/LDAPRoleMappings

Method:

GET

Media Type (header):

Authorization: Bearer <access token value>

Accept: application/json;v=1.0

Parameters

Optional:

ldapServerId=[integer] - Unique Id of the LDAP Server. LDAP Server Id (ldapServerId) is retrieved using LDAP Servers API

Success Response:

Code: 200 Success

Error Response:

Code: 401 Unauthorized

Code: 403 Forbidden

Sample Response:

[
  {
    "id": 1,
    "ldapServerId": 1,
    "roleId": 3,
    "ldapGroupDn": "CN=sales,OU=Groups,DC=domain,DC=com",
    "ldapGroupDisplayName": sales
  },
  {
    "id": 2,
    "ldapServerId": 1,
    "roleId": 1,
    "ldapGroupDn": "CN=marketing,OU=Groups,DC=domain,DC=com",
    "ldapGroupDisplayName": marketing
  }
]

Notes:

Retrieves details of all LDAP role mapping. LDAP Server Id (ldapServerId) result is used in the LDAP Servers API, Role Id (roleId) result is used in the Roles API and LDAP Group DN (ldapGroupDn) results is used in the LDAP Servers API. If the request fails, it returns an error response.

Update LDAP Role Mapping - PUT /LDAPServers/{id}/RoleMappings

Update LDAP role mapping details according to LDAP Server Id.

Notice

The ‘Manage Authentication Providers’ permission is required to execute this API.

Usage:

  1. GET /LDAPServers and get details of all LDAP Servers

  2. GET /LDAPRoleMappings?ldapServerId={id} to get the specific LDAP server mappings

  3. PUT /LDAPServers/{id}/RoleMappings and update LDAP role mapping details

URL

/cxrestapi/auth/LDAPServers/{id}/RoleMappings

Method:

PUT

Media Type (header):

Authorization: Bearer <access token value>

Content-Type: application/json;v=1.0

Parameters

Required:

id=[integer] - Unique Id of the LDAP Server. LDAP Server Id (id) is retrieved using the LDAP Servers API.

editLdapRoleMappingViewModel=[body]: Specifies the LDAP role mapping details to update

roleId=[integer] – Role Id. Role Id (roleId) is retrieved using the Roles API

ldapGroupDn=[string] - LDAP group distinguished name (DN)

ldapGroupDisplayName=[string] - LDAP group display name

Success Response:

Code: 204 Success

Error Response:

Code: 400 Bad request

Code: 401 Unauthorized

Code: 403 Forbidden

Code: 404 Not Found

Sample Response:

no content

Notes:

Updates LDAP role mapping details according to LDAP Server Id. Once the request is successful, it does not return any content. If the request fails, it returns an error response.

Delete LDAP Role Mapping – DELETE /LDAPRoleMappings/{id}

Delete LDAP role mapping according to LDAP role mapping Id.

Notice

The ‘Manage Authentication Providers’ permission is required to execute this API.

Usage:

  1. GET /LDAPRoleMappingsand get details of all LDAP role mapping

  2. DELETE /LDAPRoleMappings/{id} and delete the LDAP role mapping details

URL

/cxrestapi/auth/LDAPRoleMappings/{id}

Method:

DELETE

Media Type (header):

Authorization: Bearer <access token value>

Content-Type: application/json;v=1.0

Parameters

Required:

id=[integer] - LDAP role mapping Id

Success Response:

Code: 204 Success

Error Response:

Code: 400 Bad request

Code: 401 Unauthorized

Code: 403 Forbidden

Code: 404 Not found

Sample Response:

no content

Notes:

Removes LDAP role mapping according to LDAP role mapping Id. Once the request is successful, it does not return any content. If the request fails, it returns an error response.