> For the complete documentation index, see [llms.txt](https://rc.sunbird.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rc.sunbird.org/use/integrations/digilocker-integration.md).

# Digilocker Integration

Covers pulling Sunbird RC-issued credentials into the DigiLocker wallet.

{% hint style="info" %}
**Prerequisites**

* A [DigiLocker partner account](https://www.digilocker.gov.in/web/partners/)
* Familiarity with the [DigiLocker Issuer API spec](https://cf-media.api-setu.in/resources/DigiLocker-Issuer-APISpecification-v1-13.pdf)
  {% endhint %}

{% hint style="warning" %}
DigiLocker has no sandbox — all testing happens against production. Be careful with changes in the partner portal.
{% endhint %}

## Onboarding Sunbird RC in DigiLocker

{% stepper %}
{% step %}

### Add a Pull URI Request

Log in to the partner account → **Pull URI Request** section → **+ Add**.
{% endstep %}

{% step %}

### Fill in the callback details

The VC pull URL, e.g. `https://<host>/digilocker/v1/digilocker/pullUriRequest`, and the HMAC key used to verify DigiLocker's request signatures. Then Next.
{% endstep %}

{% step %}

### Define the user parameters

Which parameters get sent to your backend to fetch the VC — existing profile fields like Aadhaar, or custom parameters like a Certificate ID. Then Next.
{% endstep %}

{% step %}

### Add the document type

Add the document type being fetched → Update.
{% endstep %}

{% step %}

### Test and publish

Test via **Test Service** — a correct config returns the VC certificate. Then publish; only published configs are visible to users in the DigiLocker portal.
{% endstep %}
{% endstepper %}

## Configure Sunbird RC to serve VCs to DigiLocker

Requires a JSON mapping file per document type:

```json
{
  "docType": {
    "schema": "Schema",
    "template": "html",
    "searchFilter": { "filters": { "osid": { "eq": "{{.certificate_id}}" } } }
  }
}
```

| Key            | Meaning                                                                                  |
| -------------- | ---------------------------------------------------------------------------------------- |
| `docType`      | The document type configured in DigiLocker                                               |
| `schema`       | The schema the VC is fetched from                                                        |
| `template`     | The rendering template key                                                               |
| `searchFilter` | Search parameters (matching DigiLocker's Add New API step) used to locate the credential |

Sunbird RC fetches the credential as a PDF and returns an XML response to DigiLocker.

{% code title="Example — Pre-Matric Scholarship" %}

```json
{
  "SACER": {
    "schema": "PreMatricScholarship",
    "template": "html",
    "searchFilter": { "filters": { "osid": { "eq": "{{.certificate_id}}" } } }
  }
}
```

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://rc.sunbird.org/use/integrations/digilocker-integration.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
