Getting Started
Step 1: Sign Up
Data Fiduciaries (DFs) must register on the Consent Manager portal using the appropriate environment:
- Staging Environment (for testing):
https://staging.indiaconsent.com - Production Environment (live system):
https://www.indiaconsent.com
Please ensure you register in the correct environment based on whether you are testing or going live.
Step 2: Get Credentials
After completing the signup process:
- Log in using your registered email ID and password.
- Navigate to the “Credentials” page:
- Staging: https://staging.indiaconsent.com/credentials
- Production: https://www.indiaconsent.com/credentials
- Click the “Create Client” button.
- Provide a Client Name and submit.
- Your Client ID and Client Secret will be generated.
Why Are Client Credentials Required?
Client Credentials are used for secure API authentication.
You will need:
- Client ID
- Client Secret
These credentials are required to:
- Generate an Access Token using the Token API.
- Use that Access Token to securely call:
- Consent Request API
- Consent Verify API
- Other protected APIs
In short:
Client Credentials → Generate Access Token → Call Consent APIs
All Consent Manager APIs are protected and require a valid access token in the Authorization header.
⚠️ Important Security Note
The Client Secret is displayed only once at the time of creation and cannot be retrieved again.
- Copy it immediately.
- Store it securely in a secrets manager or vault.
- Do not expose it in frontend or mobile applications.
Step 3: Generate Access Token
All Consent Manager APIs are protected and require a valid Access Token.
You must generate an access token using your Client ID and Client Secret via HTTP Basic Authentication.
🔐 Authentication Mechanism
The token API uses Basic Authentication.
Your client_id and client_secret must be:
-
Concatenated using a colon
client_id:client_secret
-
Base64 encoded
-
Sent in the
Authorizationheader:Authorization: Basic <base64_encoded_value>
Token Endpoint
Method: GET
Staging
https://staging.indiaconsent.com/api/v1/auth/df/token
Production
https://www.indiaconsent.com/api/v1/auth/df/token
Request Headers
| Header | Value |
|---|---|
| Content-Type | application/json |
| Authorization | Basic base64(client_id:client_secret) |
⚠️ No request body is required.
Sample Request (Conceptual)
GET /api/v1/auth/df/token
Authorization: Basic ZGYteHh4eHh4eDp5eXl5eXl5eXk=
Content-Type: application/json
Sample Response
{
"token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"tokenType": "Bearer",
"expiresInSeconds": 900
}
🔹 Sample Code
- Java
- Python
- NodeJS
- Curl
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.Base64;
public class TokenExample {
public static void main(String[] args) throws IOException, InterruptedException {
String clientId = "your_client_id";
String clientSecret = "your_client_secret";
String tokenUrl = "https://api.example.com/oauth/token";
// Create Basic Auth header
String auth = clientId + ":" + clientSecret;
String encodedAuth = Base64.getEncoder().encodeToString(auth.getBytes());
// Create request body
String requestBody = "grant_type=client_credentials";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(tokenUrl))
.header("Authorization", "Basic " + encodedAuth)
.header("Content-Type", "application/x-www-form-urlencoded")
.POST(HttpRequest.BodyPublishers.ofString(requestBody))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println("Response: " + response.body());
}
}
# PYTHON TOKEN CODE HERE
// NODE TOKEN CODE HERE
# CURL COMMAND HERE
Step 4: Generate Consent Request Payload
Before calling the Consent Creation API, you must construct a Consent Request Payload in your backend application.
This payload defines:
-
Who is requesting consent
-
What data will be processed
-
For what purpose
-
Duration of consent
-
Any additional metadata
📌 Important
-
The payload must strictly follow the Consent Request JSON Schema defined by Consent Manager.
-
Payload creation must happen on your backend server.
-
This payload will be used in Step 5: Call Consent Creation API.
What Should Be Included?
The Consent Request Payload typically contains:
-
Unique request reference ID
-
Data Fiduciary (DF) details
-
Purpose of processing
-
Data categories
-
Consent validity period
-
Redirect / callback information
-
Optional metadata
Refer to the full JSON Schema below to understand mandatory and optional fields.
📄 Consent Request JSON Schema
// CONSENT REQUEST SCHEMA HERE
🧾 Sample Payload
// SAMPLE CONSENT REQUEST PAYLOAD HERE
⚠️ Validation Requirements
Before sending the payload in Step 5:
-
Ensure all required fields are populated.
-
Validate field formats (dates, enums, identifiers).
-
Ensure reference IDs are unique.
-
Avoid sending null or unexpected attributes.
Failure to follow the schema may result in:
-
400 Bad Request -
Schema validation errors
-
Rejected consent creation
🔒 Security Considerations
-
Do not generate this payload in frontend/mobile applications.
-
Avoid exposing internal identifiers.
-
Sanitize user-provided values before embedding them into the payload.
➡ Next Step
In the next step, you will:
-
Use this generated payload
-
Attach your Access Token
-
Call the Consent Creation API
Step 5: Call Consent Creation API
Once you have:
-
✅ Generated the Access Token (Step 3)
-
✅ Prepared the Consent Request Payload (Step 4)
You are now ready to create a Consent Request.
Endpoint
Method: POST
URL:
/api/v1/df/consent-requests
Environment Base URLs
Staging:
https://staging.indiaconsent.com/api/v1/df/consent-requests
Production:
https://www.indiaconsent.com/api/v1/df/consent-requests
Request Headers
| Header | Value |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer <accessToken> |
Request Body
The request body must contain the Consent Request Payload generated in Step 4.
// INSERT CONSENT REQUEST PAYLOAD HERE
Sample Request (Conceptual)
POST /api/v1/df/consent-requests
Authorization: Bearer <accessToken>
Content-Type: application/json
{
// Consent Request Payload
}
🔹 Sample Code Placeholder
- Java
- Python
- NodeJS
- Go
- Curl
// JAVA CONSENT CREATION CODE
# PYTHON CONSENT CREATION CODE
// NODE JS CONSENT CREATION CODE
// GO CONSENT CREATION CODE
# CURL CONSENT CREATION CODE
Sample Response
The API will generate a new Consent Request and return a response containing multiple attributes.
{
"requestId": "CR-20240218-12345",
"fidId": "FID-987654",
"dpHash": "a8f5f167f44f4964e6c998dee827110c",
"status": "CREATED",
"createdAt": "2026-02-18T10:15:30Z",
"expiresAt": "2026-03-18T10:15:30Z",
"redirectUrl": "https://consent.indiaconsent.com/notice/CR-20240218-12345"
}
Important Response Attributes
| Attribute | Description |
|---|---|
| requestId | Unique identifier of the Consent Request |
| fidId | Data Fiduciary identifier |
| dpHash | Hash representing the Data Principal context |
| status | Current state of consent request |
| redirectUrl | URL to display the consent notice to the user |
🚀 Most Important Field: redirectUrl
The redirectUrl is the key output of this step.
This URL must be used by the Data Fiduciary’s UI to display the Consent Notice to the user.
What Happens Next?
-
In Step 6, you will extract the
redirectUrlfrom this response. -
In Step 7, your application will open this URL to allow the user to Grant or Revoke consent.
Step 6: Extract Redirect URL
After successfully calling the Consent Creation API (Step 5), the response will include multiple attributes related to the created consent request.
The most important field in the response is:
{
"redirectUrl": "https://consent.indiaconsent.com/notice/CR-20240218-12345"
}
What is redirectUrl?
The redirectUrl is a unique, system-generated URL that:
-
Displays the Consent Notice to the Data Principal
-
Allows the user to Grant or Revoke consent
-
Is securely mapped to the created consent request
Each consent request will generate a unique redirect URL.
What You Must Do
-
Extract the
redirectUrlvalue from the API response. -
Store it temporarily in your backend or pass it securely to your frontend.
-
Use this URL in the next step to present the consent notice to the user.