# NIC SMS Integration

## Overview

Integrate the NIC SMS Gateway for secure, DLT-compliant SMS delivery in DIGIT.

**Why use NIC SMS?**

* Secure (TLS 1.2 + certificate)
* DLT-compliant (template IDs)
* Government sender ID
* Customizable message parameters

## Steps

{% stepper %}
{% step %}

### Add NIC SMS Service Code

**File:** [`egov-notification-sms/src/main/java/org/egov/web/notification/sms/service/impl/NICSMSServiceImpl.java`](https://github.com/upyog/UPYOG/blob/master/core-services/egov-notification-sms/src/main/java/org/egov/web/notification/sms/service/impl/NICSMSServiceImpl.java)

* Create this file.
* Paste the NIC SMS integration Java class code.
* This code:
  * Sends SMS securely to NIC via HTTPS.
  * Handles DLT template IDs.
  * Uses SSL certificate for authentication.
    {% endstep %}

{% step %}

### Place the NIC Certificate

**File:** [`egov-notification-sms/src/main/resources/smsgwsmsgovin.cer`](https://github.com/upyog/UPYOG/tree/master/core-services/egov-notification-sms/src/main/resources)

* Put the NIC `.cer` certificate file here.
* Needed for a secure connection if `sms.verify.certificate=true`.
  {% endstep %}

{% step %}

### Update Environment Config

**File:** Your environment YAML file (like `values.yaml` or `dev.yaml`)

* Add/update these configs under `egov-notification-sms`:

  ```
  sms-provider-url: "https://smsgw.sms.gov.in/failsafe/MLink"
  sms.provider.class: "NIC"
  sms.verify.certificate: "true"
  sms.senderid: "IUPYOG"
  sms.provider.entityid: "1201160648389652723"
  sms.default.tmplid: "1"
  sms.enabled: "true"
  # ...other required parameters
  ```
* Ensure that only the NIC is active as the SMS provider.
  {% endstep %}

{% step %}

### Build & Deploy

* Run:

  ```
  mvn clean install
  ```
* Deploy the updated egov-notification-sms service to your environment (e.g., Kubernetes).
  {% endstep %}
  {% endstepper %}

### Summary - Checklist

* [x] &#x20;NIC SMS Java class added
* [x] &#x20;NIC certificate placed in resources
* [x] &#x20;Config updated in YAML
* [x] &#x20;Project built
* [x] &#x20;Service deployed


---

# 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/deploy/configure/sms-and-email/nic-sms-integration.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.
