# CCM User Association Service

User association API can be used to retrieve all the data partitions that a user has access to.

API response includes information related to the data partition(s) that are associated to the user such as-

* Data partition details: partitionId, slbPartitionId, partitionName
* Account details:  billingAccountId, billingAccountName, partitionAccountId, partitionAccountName
* Data Source details:  endpointID, endpointName, instance, repositoryKind
* Data partition association:  departmentId, groupId,


### Steps to access the service

After verifying user’s context and subscription, an application should check for user’s access to the selected data partition. User should be allowed to access a data partition only if they have been granted access to the same by Account Admin.

1) In order to access the service, you are required to have the AppKey and the AccessToken. Below are the steps to get the appKey and AccessToken.
  - [AppKey] can be obtained from [My Apps](/guides/cloud-apis/developer-portal/team-owner-manage-apps). Make sure your App subscribes CCM product.
  - [Access Token] can be obtained by sending request below using SLB Authenticator


SLB Authenticator information can be found in [SAUTH](/solutions/sauth/tutorial/about)

1) Trying out the API


***Example Request***

```bash
  curl -X 'GET' \
    'https://api.delfi.slb.com/ccm/userAssociation/v1/dataPartitions' \
    -H 'Authorization: Bearer [token]' \
    -H 'accept: application/json' \
    -H 'appkey: <your-app-key>'
```

***Example Successful Response***

```
[
  {
    "partitionId": "string",
    "slbPartitionId": "string",
    "partitionName": "string",
    "groupId": "string",
    "departmentId": "string",
    "billingAccountId": "string",
    "billingAccountName": "string",
    "isRegistered": true,
    "partitionAccountId": "string",
    "partitionAccountName": "string",
    "endpointID": "string",
    "endpointName": "string",
    "instance": "string",
    "repositoryKind": "string",
  }
]
```

| **Response Parameters** | **Type** | **Description** |
|  --- | --- | --- |
| partitionId | string | partitionId is the auto-generated or  user provided Id of the registered data partition |
| partitionName | string | name of the Data partition. |
| slbPartitionId | string | unique id representing the data partition registration in SLB Digital Platform |
| groupId | string | user group id from which a user has been granted access to the data partition |
| departmentId | string | departmentId from which a user has been granted access to the data partition |
| billingAccountId | string | billing account Id in which user was granted access to the data partition via department/user group association |
| billingAccountName | string | billing account name in which user was granted access to the data partition via department/user group association |
| isRegistered | boolean | Whether a data partition has been registered in Digital platform. Only registered data partitions are available for users to select while setting up user context |
| partitionAccountId | string | billing account Id in which data partition was registered in SLB Digital Platform |
| partitionAccountName | string | billing account name in which data partition was registered in SLB Digital Platform |
| endpointID | string | unique id representing the data source under which this data partition has been registered |
| endpointName | string | name of the data source represented by endpointID |
| instance | string | URL of the data source represented by endpointID |
| repositoryKind | String | data source type selected at the time of registration |