# Configure CMS Data Loader

## Overview

The CMS DataLoader is a Jupyter Notebook-based ETL (Extract, Transform, Load) system designed to load master data into the DIGIT CMS after deployment. It enables implementation teams to configure tenants, boundaries, departments, complaint types, and employees through a structured, validated workflow.

#### Key Components

<table><thead><tr><th width="187.3046875">Component</th><th width="208.03515625">File</th><th>Description</th></tr></thead><tbody><tr><td>Jupyter Interface</td><td>DataLoader.ipynb</td><td>User-facing notebook interface</td></tr><tr><td>Core ETL Logic</td><td>unified_loader.py</td><td>Main processing engine (2,919 lines)</td></tr><tr><td>Schema Validator</td><td>mdms_validator.py</td><td>MDMS schema validation (659 lines)</td></tr><tr><td>Configuration</td><td>.env.example</td><td>Environment configuration template</td></tr><tr><td>Templates</td><td>templates/</td><td>Generated Excel templates for data entry</td></tr></tbody></table>

#### Technology Stack

* Frontend: Jupyter Notebook (Python kernel)
* REST APIs: DIGIT microservices (MDMS, Boundary, HRMS, Localisation, Filestore)
* Data Format: Excel (XLSX) → JSON → API
* Validation: 3-layer validation (Excel, MDMS Schema, API)

#### Repository Setup

\# Clone repository

```
git clone https://github.com/egovernments/Citizen-Complaint-Resolution-System.git
git checkout pgr-data-loader
```

\# Navigate to DataLoader directory

```
cd Citizen-Complaint-Resolution-System/utilities/crs_dataLoader
```

\# Launch Jupyter Notebook

```
jupyter notebook
```

\# Access at: <http://localhost:8888/tree>

## Architecture Overview

#### System Architecture

![](/files/5MEk10ke7BhXMnrqPt4X)

#### Data Loading Phases

<table><thead><tr><th width="137.87890625">Phase</th><th width="173.0859375">Name</th><th width="278.00390625">Purpose</th><th>Dependencies</th></tr></thead><tbody><tr><td>Phase 0</td><td>Authentication</td><td>OAuth2 token acquisition</td><td>Admin credentials</td></tr><tr><td>Phase 1</td><td>Tenant &#x26; Branding</td><td>Create tenants and branding info</td><td>Authentication</td></tr><tr><td>Phase 2</td><td>Boundary Management</td><td>Create administrative boundaries</td><td>Tenant ID</td></tr><tr><td>Phase 3</td><td>Common Masters</td><td>Departments, Designations, Complaint Types</td><td>Tenant ID</td></tr><tr><td>Phase 4</td><td>Employee Creation</td><td>Bulk employee creation with roles</td><td>All previous phases</td></tr></tbody></table>

## Phase 0: Authentication Flow

### Overview

Before any data upload, the system must authenticate with the DIGIT gateway using the OAuth2 Password Grant flow.

### Authentication Flow

#### ![](/files/9n0957W21JYwk2cQdkNi)

### API Details

`Endpoint: POST /user/oauth/token`

Headers:

`Content-Type: application/x-www-form-urlencoded`

`Authorization: Basic ZWdvdi11c2VyLWNsaWVudDo= (Base64: egov-user-client:)`

Request Body (with sample data):

`username: DEV_SUPER_ADMIN`

`password: eGov@123`

`userType: EMPLOYEE`

`tenantId: pg`         &#x20;

`scope: read`

`grant_type: password`

Response would look like below

```
{
  "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI...",
  "token_type": "bearer",
  "expires_in": 86400,
  "scope": "read",
  "UserRequest": {
    "id": 123,
    "userName": "DEV_SUPER_ADMIN",
    "name": "Super Admin",
    "tenantId": "pg",
    "uuid": "a1b2c3d4-e5f6-...",
    "roles": [
      {"code": "SUPERUSER", "name": "Super User"},
      {"code": "MDMS_ADMIN", "name": "MDMS Admin"}
    ]
  }
}
```

Use the tenant ID, username and password values according to your configuration.

### Code Implementation

```
# In DataLoader.ipynb (Cell: Phase 0)

from unified_loader import APIUploader

gateway_url = "https://unified-dev.digit.org"
username = "DEV_SUPER_ADMIN"
password = "eGov@123"
tenant_id = "pg"

UPLOADER = APIUploader(
    base_url=gateway_url,
    username=username,
    password=password,
    user_type="EMPLOYEE",
    tenant_id=tenant_id
)

# authenticate() is called automatically in __init__
# UPLOADER.auth_token and UPLOADER.user_info are now available
```

### Key Points

* OAuth2 password grant flow is used
* Client credentials are hardcoded: egov-user-client with an empty secret
* Token is valid for 24 hours (86400 seconds)
* auth\_token is included in ALL subsequent API calls via RequestInfo

***

## Phase 1: Tenant & Branding Flow

### Overview

Phase 1 creates tenant records (cities/ULBs) and their branding information (logos, banners, languages).

### Process Flow

#### ![](/files/W5HDBnspXS6s22tPTjA6)

### Excel Template Structure

**Sheet 1: Tenant Information**

<table><thead><tr><th width="220.78125">Column Name</th><th width="341.09375">Description</th><th>Mandatory</th><th>Example</th></tr></thead><tbody><tr><td>Tenant Display Name</td><td>Name of ULB/State</td><td>Yes</td><td>City A ULB</td></tr><tr><td>Tenant Code</td><td>Unique tenant code (admin only)</td><td>Yes</td><td>PG.CITYA</td></tr><tr><td>Tenant Type</td><td>State or City</td><td>Yes</td><td>City</td></tr><tr><td>Logo File Path</td><td>Public URL of logo</td><td>Yes</td><td>https://.../logo.png</td></tr><tr><td>Latitude</td><td>Geographic latitude</td><td>No</td><td>30.7333</td></tr><tr><td>Longitude</td><td>Geographic longitude</td><td>No</td><td>76.7794</td></tr><tr><td>City Name</td><td>City name</td><td>No</td><td>City A</td></tr><tr><td>District Name</td><td>District name</td><td>No</td><td>District X</td></tr><tr><td>Address</td><td>Registered address</td><td>No</td><td>Main Road, Ward 12</td></tr><tr><td>Tenant Website</td><td>Official website URL</td><td>No</td><td>https://citya.gov.in</td></tr></tbody></table>

**Sheet 2: Branding Details**

<table><thead><tr><th width="156.609375">Column Name</th><th width="229.63671875">Description</th><th width="99.328125">Mandatory</th><th>Example</th></tr></thead><tbody><tr><td>Banner URL</td><td>Application banner URL</td><td>No</td><td>https://.../banner.png</td></tr><tr><td>Logo URL</td><td>Main logo URL</td><td>Yes</td><td>https://.../logo.png</td></tr><tr><td>Logo URL (White)</td><td>White background logo</td><td>Yes</td><td>https://.../logo-white.png</td></tr><tr><td>State Logo</td><td>State emblem URL</td><td>No</td><td>https://.../state-logo.png</td></tr></tbody></table>

### Data Transformation

**Excel Input:**

Tenant Display Name: City A ULB

Tenant Code: PG.CITYA

Tenant Type: City

Logo File Path: <https://example.com/logo.png>

**Transformed API Payload:**

```
{
  "code": "pg.citya",
  "name": "City A ULB",
  "description": "City A ULB",
  "logoId": "https://example.com/logo.png",
  "type": "CITY",
  "city": {
    "name": "City A",
    "code": "CITYA",
    "districtName": "District X",
    "regionName": "Punjab"
  }
}
Auto-Generated Localisation:
{
  "code": "TENANT_TENANTS_PG_CITYA",
  "message": "City A ULB",
  "module": "rainmaker-common",
  "locale": "en_IN"
}
```

### API Calls in Phase 1

<table><thead><tr><th width="78.88671875">#</th><th width="335.1796875">API Endpoint</th><th width="235.79296875">Purpose</th><th>Method</th></tr></thead><tbody><tr><td>1</td><td>/mdms-v2/v2/_create/tenant.tenants</td><td>Create tenant</td><td>POST</td></tr><tr><td>2</td><td>/localization/messages/v1/_upsert</td><td>Create localizations</td><td>POST</td></tr><tr><td>3</td><td>/mdms-v2/v2/_create/common-masters.StateInfo</td><td>Create branding</td><td>POST</td></tr></tbody></table>

## Phase 2: Boundary Management Flow

### Overview

Phase 2 creates hierarchical administrative boundaries (City → Zone → Ward → Block → Locality) for each tenant. This phase involves asynchronous processing via Kafka.

### Process Flow

![](/files/FYfO8BPGV4zy7fFYSEVq)

### Hierarchy Definition

Typical Hierarchy Structure:

<table><thead><tr><th width="134.5234375">Level</th><th width="225.34765625">Boundary Type</th><th>Parent Type</th></tr></thead><tbody><tr><td>1</td><td>City</td><td>null</td></tr><tr><td>2</td><td>Zone</td><td>City</td></tr><tr><td>3</td><td>Ward</td><td>Zone</td></tr><tr><td>4</td><td>Block</td><td>Ward</td></tr><tr><td>5</td><td>Locality</td><td>Block</td></tr></tbody></table>

**Create Hierarchy API:**

Endpoint: POST /boundary-service/boundary-hierarchy-definition/\_create

**Request Body:**

```
{
  "RequestInfo": {...},
  "BoundaryHierarchy": {
    "tenantId": "pg.citya",
    "hierarchyType": "ADMIN",
    "boundaryHierarchy": [
      {"boundaryType": "City", "parentBoundaryType": null, "active": true},
      {"boundaryType": "Zone", "parentBoundaryType": "City", "active": true},
      {"boundaryType": "Ward", "parentBoundaryType": "Zone", "active": true},
      {"boundaryType": "Block", "parentBoundaryType": "Ward", "active": true}
    ]
  }
}
```

### Boundary Template Structure

| Column      | Description          | Mandatory                 | Example          |
| ----------- | -------------------- | ------------------------- | ---------------- |
| Country     | Country name         | Yes                       | India            |
| State       | State name           | Yes                       | Punjab           |
| City        | City name            | Yes                       | City A           |
| Zone        | Zone name            | No                        | Zone 1           |
| Ward        | Ward name/number     | No                        | Ward 12          |
| Block       | Sub-ward division    | No                        | Block A          |
| Locality    | Area/Locality name   | No                        | Shastri Nagar    |
| Code        | Unique boundary code | Yes                       | PG\_CITYA\_ZONE1 |
| Parent Code | Parent boundary code | Required (except Level 1) | PG\_CITYA        |

### API Calls in Phase 2

<table><thead><tr><th width="78.4296875">#</th><th width="296.890625">API Endpoint</th><th width="236.9453125">Purpose</th><th>Method</th></tr></thead><tbody><tr><td>1</td><td>/boundary-service/boundary-hierarchy-definition/_search</td><td>Search hierarchies</td><td>POST</td></tr><tr><td>2</td><td>/boundary-service/boundary-hierarchy-definition/_create</td><td>Create hierarchy</td><td>POST</td></tr><tr><td>3</td><td>/boundary-management/v1/_generate</td><td>Generate template</td><td>POST</td></tr><tr><td>4</td><td>/boundary-management/v1/_generate-search</td><td>Poll template status</td><td>POST</td></tr><tr><td>5</td><td>/filestore/v1/files/url</td><td>Get filestore URL</td><td>GET</td></tr><tr><td>6</td><td>/filestore/v1/files</td><td>Upload Excel</td><td>POST</td></tr><tr><td>7</td><td>/boundary-management/v1/_process</td><td>Process boundaries</td><td>POST</td></tr></tbody></table>

***

## Phase 3: Common Masters Flow

### Overview

Phase 3 creates departments, designations, and complaint types with auto-code generation and localisation.

### Process Flow

#### ![](/files/8SEZtmeIxQQXkvjPEy0h)

### Excel Template Structure

**Sheet 1: Department & Designation Master**

| Column Name        | Description        | Mandatory | Example            |
| ------------------ | ------------------ | --------- | ------------------ |
| Department Name\*  | Name of department | Yes       | WATER DEPARTMENT   |
| Designation Name\* | Designation name   | Yes       | Executive Engineer |

**Sheet 2: Complaint Type Master**

| Column Name               | Description             | Mandatory | Example                |
| ------------------------- | ----------------------- | --------- | ---------------------- |
| Complaint Type\*          | Main complaint category | Yes       | Water not coming       |
| Complaint Sub Type\*      | Sub-category            | Yes       | tap broken             |
| Department Name\*         | Must match Sheet 1      | Yes       | WATER DEPARTMENT       |
| Resolution Time (Hours)\* | SLA in hours            | Yes       | 1                      |
| Search Words              | Keywords for search     | Yes       | water tab,water supply |

### Autogeneration of Code

* **Department Code Generation:**

| Department Name\* | code    |
| ----------------- | ------- |
| WATER DEPARTMENT  | DEPT\_1 |
| SANITATION        | DEPT\_2 |
| ELECTRICITY       | DEPT\_3 |

* **Designation Code Generation:**

<table><thead><tr><th width="209.94140625">Department Name* </th><th width="209.6171875">Designation Name*</th><th>Designation code</th><th>Department Code</th></tr></thead><tbody><tr><td>WATER DEPARTMENT</td><td>engineer</td><td>DESIG_01</td><td>DEPT_1</td></tr><tr><td>WATER DEPARTMENT</td><td>manager</td><td>DESIG_02</td><td>DEPT_1</td></tr><tr><td>SANITIATION</td><td>supervisor</td><td>DESIG_03</td><td>DEPT_2</td></tr></tbody></table>

* **Service Code Generation for Complaints subtype**

| Complaint sub type\*     | ServiceCode           |
| ------------------------ | --------------------- |
| Tap broken               | TAPBROKEN             |
| Water not coming         | WATERNOTCOMING        |
| Street light not working | STREETLIGHTNOTWORKING |

### API Calls in Phase 3

<table><thead><tr><th width="89.84375">#</th><th width="382.25390625">API Endpoint</th><th width="166.40234375">Purpose</th><th>Method</th></tr></thead><tbody><tr><td>1</td><td>/mdms-v2/v2/_create/common-masters.Department</td><td>Create department</td><td>POST</td></tr><tr><td>2</td><td>/mdms-v2/v2/_create/common-masters.Designation</td><td>Create designation</td><td>POST</td></tr><tr><td>3</td><td>/mdms-v2/v2/_create/SERVICEDEFS.ServiceDefinitions</td><td>Create complaint type</td><td>POST</td></tr><tr><td>4</td><td>/localization/messages/v1/_upsert</td><td>Create localizations</td><td>POST</td></tr></tbody></table>

### Relationship Rules

<table><thead><tr><th width="109.69140625">Rule</th><th>Description</th></tr></thead><tbody><tr><td>1</td><td>Complaint Type → Department Name must exist in Department Sheet</td></tr><tr><td>2</td><td>Departments must be created before designations and complaints</td></tr><tr><td>3</td><td>Designation uses exact department name from Department Sheet</td></tr><tr><td>4</td><td>All mandatory fields must be filled</td></tr></tbody></table>

***

## Phase 4: Employee Creation Flow

### Overview

Phase 4 generates a dynamic employee template with live MDMS data, then bulk-creates employees with role and jurisdiction assignments.

### Process Flow

![](/files/UmVCOCeRBZ33DuLobNb0)

### Employee Template Structure

<table><thead><tr><th>Column Name</th><th width="194.19140625">Description</th><th width="95.26171875">Mandatory</th><th>Data Type</th><th>Example</th></tr></thead><tbody><tr><td>User Name*</td><td>Full name</td><td>Yes</td><td>Text</td><td>John Doe</td></tr><tr><td>Mobile Number*</td><td>10-digit unique</td><td>Yes</td><td>Numeric</td><td>9876543210</td></tr><tr><td>Password</td><td>Login password</td><td>No</td><td>Text</td><td>MyPass@123</td></tr><tr><td>Department Name*</td><td>From Phase 3</td><td>Yes</td><td>Dropdown</td><td>WATER DEPARTMENT</td></tr><tr><td>Designation Name*</td><td>From Phase 3</td><td>Yes</td><td>Dropdown</td><td>engineer</td></tr><tr><td>Role Names*</td><td>Comma-separated</td><td>Yes</td><td>Multi-select</td><td>GRO,EMPLOYEE</td></tr><tr><td>Gender</td><td>Male/Female/Other</td><td>No</td><td>Dropdown</td><td>Male</td></tr><tr><td>Employee Status</td><td>Employment status</td><td>No</td><td>Dropdown</td><td>EMPLOYED</td></tr><tr><td>Employee Type</td><td>Type of employee</td><td>No</td><td>Dropdown</td><td>PERMANENT</td></tr><tr><td>Assignment From Date*</td><td>Start date</td><td>Yes</td><td>DD-MM-YYYY</td><td>05-09-2024</td></tr><tr><td>Date of Appointment*</td><td>Joining date</td><td>Yes</td><td>DD-MM-YYYY</td><td>20-06-2024</td></tr><tr><td>Hierarchy Type</td><td>Admin hierarchy</td><td>No</td><td>Text</td><td>ADMIN</td></tr><tr><td>Boundary Type</td><td>Boundary type</td><td>No</td><td>Text</td><td>City</td></tr><tr><td>Boundary Code</td><td>Boundary code</td><td>No</td><td>Text</td><td>PG.CITYA</td></tr></tbody></table>

### System-Generated Fields

<table><thead><tr><th width="192.51171875">Attribute</th><th width="352.390625">Logic</th><th>Example</th></tr></thead><tbody><tr><td>Employee Code</td><td>Name uppercase, spaces → underscores</td><td>JOHN_DOE</td></tr><tr><td>Tenant ID</td><td>From upload session</td><td>pg.citya</td></tr><tr><td>User UUID</td><td>Generated by HRMS</td><td>1fda5623-448a-...</td></tr><tr><td>User Type</td><td>Always "EMPLOYEE"</td><td>EMPLOYEE</td></tr><tr><td>Active Flag</td><td>Always true</td><td>true</td></tr></tbody></table>

### Data Transformation Example

**Excel Input:**

```
User Name: John Doe
Mobile Number: 9876543210
Department Name: WATER DEPARTMENT
Designation Name: engineer
Role Names: GRO, EMPLOYEE
Assignment From Date: 05-09-2024
```

**Transformed API Payload:**

```
{
  "tenantId": "pg.citya",
  "code": "JOHN_DOE",
  "employeeStatus": "EMPLOYED",
  "employeeType": "PERMANENT",
  "dateOfAppointment": 1718841600000, // this is the epoch value of the date of appointment
  "assignments": [{
    "fromDate": 1725494400000, //epoch value
    "isCurrentAssignment": true,
    "department": "DEPT_1",
    "designation": "DESIG_01"
  }],
  "jurisdictions": [{
    "hierarchy": "ADMIN",
    "boundaryType": "City",
    "boundary": "PG_CITYA",
    "tenantId": "pg.citya",
    "roles": [
      {"code": "GRO", "name": "GRO"},
      {"code": "EMPLOYEE", "name": "EMPLOYEE"}
    ]
  }],
  "user": {
    "name": "John Doe",
    "mobileNumber": "9876543210",
    "active": true,
    "type": "EMPLOYEE",
    "tenantId": "pg.citya",
    "roles": [
      {"code": "GRO", "name": "GRO"},
      {"code": "EMPLOYEE", "name": "EMPLOYEE"}
    ],
    "password": "eGov@123" //Password of choice
  }
}
```

### API Calls in Phase 4

<table><thead><tr><th width="92.70703125">#</th><th width="307.296875">API Endpoint</th><th width="234.375">Purpose</th><th>Method</th></tr></thead><tbody><tr><td>1</td><td>/mdms-v2/v2/_search (Departments)</td><td>Fetch departments</td><td>POST</td></tr><tr><td>2</td><td>/mdms-v2/v2/_search (Designations)</td><td>Fetch designations</td><td>POST</td></tr><tr><td>3</td><td>/mdms-v2/v2/_search (Roles)</td><td>Fetch roles</td><td>POST</td></tr><tr><td>4</td><td>/boundary-service/boundary/_search</td><td>Fetch boundaries</td><td>POST</td></tr><tr><td>5</td><td>/mdms-v2/v2/_search (GenderType)</td><td>Fetch gender types</td><td>POST</td></tr><tr><td>6</td><td>/mdms-v2/v2/_search (EmployeeStatus)</td><td>Fetch employee status</td><td>POST</td></tr><tr><td>7</td><td>/mdms-v2/v2/_search (EmployeeType)</td><td>Fetch employee types</td><td>POST</td></tr><tr><td>8</td><td>/mdms-v2/v2/_create/ACCESSCONTROL-ROLES.roles</td><td>Create missing roles</td><td>POST</td></tr><tr><td>9</td><td>/egov-hrms/employees/_create</td><td>Create employee</td><td>POST</td></tr></tbody></table>

***

## Validation Framework

### Status Tracking

After processing, each row gets status columns:

| Column           | Description                | Values                  |
| ---------------- | -------------------------- | ----------------------- |
| \_STATUS         | Processing result          | SUCCESS, EXISTS, FAILED |
| \_STATUS\_CODE   | HTTP response code         | 201, 400, 409, 500      |
| \_ERROR\_MESSAGE | Detailed error description | Error text              |

### Colour Coding

<table><thead><tr><th width="176.75390625">Color</th><th width="194.24609375">Status</th><th>Meaning</th></tr></thead><tbody><tr><td>Green</td><td>SUCCESS</td><td>Record created successfully</td></tr><tr><td>Yellow</td><td>EXISTS</td><td>Record already exists (duplicate)</td></tr><tr><td>Red</td><td>FAILED</td><td>Validation or processing error</td></tr></tbody></table>

## Error Handling

### Common Error Messages

| Error Message                  | Reason                                     | Resolution               |
| ------------------------------ | ------------------------------------------ | ------------------------ |
| Department not found           | Incorrect spelling or missing from Phase 3 | Verify department name   |
| Mobile number already exists   | Duplicate in system                        | Use unique mobile number |
| Role not found                 | Invalid role code                          | Check valid role codes   |
| Invalid date format            | Not in DD-MM-YYYY format                   | Correct date format      |
| Boundary code invalid          | Not matching Phase 2 hierarchy             | Verify boundary code     |
| Parent boundary code not found | Invalid parent reference                   | Check parent code exists |
| Record already exists          | Duplicate entry                            | Skip or update existing  |

## Data Dependencies

Refer to the chart below to understand the data dependency at each phase

![](/files/0oSgglaPHH9vobW8InLA)

***

## Complete API Reference

### All APIs Summary (24 APIs)

<table><thead><tr><th width="88.03515625">#</th><th width="98.72265625">Phase</th><th width="291.44140625">API Endpoint</th><th>Purpose</th><th>Method</th></tr></thead><tbody><tr><td>1</td><td>0</td><td>/user/oauth/token</td><td>OAuth authentication</td><td>POST</td></tr><tr><td>2</td><td>1</td><td>/mdms-v2/v2/_create/tenant.tenants</td><td>Create tenant</td><td>POST</td></tr><tr><td>3</td><td>1</td><td>/localization/messages/v1/_upsert</td><td>Create localizations</td><td>POST</td></tr><tr><td>4</td><td>1</td><td>/mdms-v2/v2/_create/common-masters.StateInfo</td><td>Create branding</td><td>POST</td></tr><tr><td>5</td><td>2</td><td>/boundary-service/boundary-hierarchy-definition/_search</td><td>Search hierarchies</td><td>POST</td></tr><tr><td>6</td><td>2</td><td>/boundary-service/boundary-hierarchy-definition/_create</td><td>Create hierarchy</td><td>POST</td></tr><tr><td>7</td><td>2</td><td>/boundary-management/v1/_generate</td><td>Generate template</td><td>POST</td></tr><tr><td>8</td><td>2</td><td>/boundary-management/v1/_generate-search</td><td>Poll template status</td><td>POST</td></tr><tr><td>9</td><td>2</td><td>/filestore/v1/files/url</td><td>Get filestore URL</td><td>GET</td></tr><tr><td>10</td><td>2</td><td>/filestore/v1/files</td><td>Upload Excel</td><td>POST</td></tr><tr><td>11</td><td>2</td><td>/boundary-management/v1/_process</td><td>Process boundaries</td><td>POST</td></tr><tr><td>12</td><td>3</td><td>/mdms-v2/v2/_create/common-masters.Department</td><td>Create department</td><td>POST</td></tr><tr><td>13</td><td>3</td><td>/mdms-v2/v2/_create/common-masters.Designation</td><td>Create designation</td><td>POST</td></tr><tr><td>14</td><td>3</td><td>/mdms-v2/v2/_create/SERVICEDEFS.ServiceDefinitions</td><td>Create complaint type</td><td>POST</td></tr><tr><td>15</td><td>4</td><td>/mdms-v2/v2/_search (Departments)</td><td>Fetch departments</td><td>POST</td></tr><tr><td>16</td><td>4</td><td>/mdms-v2/v2/_search (Designations)</td><td>Fetch designations</td><td>POST</td></tr><tr><td>17</td><td>4</td><td>/mdms-v2/v2/_search (Roles)</td><td>Fetch roles</td><td>POST</td></tr><tr><td>18</td><td>4</td><td>/boundary-service/boundary/_search</td><td>Fetch boundaries</td><td>POST</td></tr><tr><td>19</td><td>4</td><td>/mdms-v2/v2/_search (GenderType)</td><td>Fetch gender types</td><td>POST</td></tr><tr><td>20</td><td>4</td><td>/mdms-v2/v2/_search (EmployeeStatus)</td><td>Fetch employee status</td><td>POST</td></tr><tr><td>21</td><td>4</td><td>/mdms-v2/v2/_search (EmployeeType)</td><td>Fetch employee types</td><td>POST</td></tr><tr><td>22</td><td>4</td><td>/mdms-v2/v2/_create/ACCESSCONTROL-ROLES.roles</td><td>Create roles</td><td>POST</td></tr><tr><td>23</td><td>4</td><td>/egov-hrms/employees/_create</td><td>Create employee</td><td>POST</td></tr><tr><td>24</td><td>All</td><td>/mdms-v2/schema/v1/_search</td><td>Fetch MDMS schema</td><td>POST</td></tr></tbody></table>

### Common RequestInfo Structure

All APIs use standard RequestInfo:

```
{
  "RequestInfo": {
    "apiId": "Rainmaker",
    "authToken": "<OAuth access_token>",
    "userInfo": {
      "id": 123,
      "userName": "DEV_SUPER_ADMIN",
      "uuid": "...",
      "roles": [...]
    },
    "msgId": "1695889012604|en_IN"
  }
}
```

### Common Response Codes

<table><thead><tr><th width="173.16796875">Code</th><th width="216.93359375">Status</th><th>Description</th></tr></thead><tbody><tr><td>200</td><td>OK</td><td>Search/fetch successful</td></tr><tr><td>201</td><td>Created</td><td>Record created successfully</td></tr><tr><td>400</td><td>Bad Request</td><td>Validation error</td></tr><tr><td>409</td><td>Conflict</td><td>Duplicate record (already exists)</td></tr><tr><td>500</td><td>Internal Server Error</td><td>Server-side error</td></tr></tbody></table>

## Quick Reference Commands

\# Clone repository

```
git clone https://github.com/egovernments/Citizen-Complaint-Resolution-System.git
```

\# Checkout data loader branch

```
git checkout pgr-data-loader
```

\# Navigate to DataLoader

```
cd Citizen-Complaint-Resolution-System/utilities/crs_dataLoader
```

\# Check Jupyter version

```
jupyter --version
```

\# Start Jupyter Notebook

```
jupyter notebook
```

\# Or use Jupyter Lab

```
jupyter lab
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.digit.org/complaints-management/complaints-resolution-v2.10/deploy/setup/production-setup/deploy-complaints-management/configure-cms-data-loader.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
