The GET APIs in Nirvahak are used to retrieve metadata, single object details, or lists of objects from the platform’s database using structured filters, authentication, and application context.
These APIs follow a JSONP pattern and are accessed via GET requests with required parameters passed in the query string.
Required Parameters
| Parameter | Type | Required | Description |
| username | String | Yes | The username of the logged-in user |
| apiToken | String | Yes | Session token used for authentication |
| applicationCode | String | Yes | Application context (e.g., studio) |
| organizationCode | String | Optional (used only on some APIs) | Organization to which the data belongs |
| callback | String | Yes | JSONP callback function (for Angular apps) |
| objectName | String | Yes | The full qualified name of the Java object class |
| filterCommand | JSON | Yes | Criteria-based filtering for fetching specific data |
Get Object Metadata
Endpoint:-
GET https://studio.nirvahak.com/studio/jsonp/metadata/get/{objectId}/?&username={username}&category=none&applicationCode={appCode}&apiToken={apiToken}&callback={callbackFn}
Parameter Breakdown
| Parameter | Example Value | Description |
| objectId | 6822e011e31f6504b9066ddd | ID of the object whose metadata is being fetched |
| username | joe-user | User performing the request |
| category | none | Metadata category (optional — mostly none) |
| applicationCode | studio | The application identifier |
| apiToken | b82b5a355c98b74 | Token returned from login |
| callback | ng_jsonp_callback_24 | JSONP callback function name |
Example Request
GET https://studio.nirvahak.com/studio/jsonp/metadata/get/6822e011e31f6504b9066ddd/?&username=joe-user&category=none&applicationCode=studio&apiToken=b82b5a355c98b74&callback=ng_jsonp_callback_24
Get a Single Object by Filter
Endpoint:-
GET https://studio.nirvahak.com/studio/jsonp/getObject/?objectName={objectName}&filterCommand={filter}&username={username}&organizationCode={orgCode}&applicationCode={appCode}&apiToken={apiToken}&callback={callbackFn}
Parameter Breakdown
| Parameter | Example Value | Description |
| objectName | com.tsb.services.studio.setup.LoanType | Java class name of the target object |
| filterCommand | JSON stringified filter (see below) | Criteria to match specific object ID |
| username | joe-user | Username from login |
| organizationCode | xyz | Org code for tenant |
| applicationCode | studio | Application scope |
| apiToken | b82b5a355c98b74 | Auth token |
| callback | ng_jsonp_callback_1 | JSONP callback |
FilterCommand
{
"criteria": [
{
"fieldName": "_id",
"operator": "matches",
"value": "65029a730652f03678635db7"
}
]
}
Example Request
GET https://studio.nirvahak.com/studio/jsonp/getObject/?objectName=com.tsb.services.studio.setup.LoanType&filterCommand={"criteria":[{"fieldName":"_id","operator":"matches","value":"65029a730652f03678635db7"}]}&username=ssa-user&organizationCode=xyz&applicationCode=studio&apiToken=b82b5a355c98b74&callback=ng_jsonp_callback_1
Get All Objects by Filter with Pagination
Endpoint:-
GET https://studio.nirvahak.com/studio/jsonp/getAll?objectName={objectName}&pageSize={size}&pageStart={start}&filterCommand={filter}&username={username}&organizationCode={orgCode}&applicationCode={appCode}&apiToken={apiToken}&callback={callbackFn}
Parameter Breakdown
| Parameter | Example Value | Description |
| objectName | com.tsb.services.studio.common.FarmerCrop | Full name of the object class |
| pageSize | 10 | Number of records per page |
| pageStart | 0 | Starting page index (pagination) |
| filterCommand | JSON stringified filter (see below) | Filtering condition |
| username | joe-user | Authenticated user |
| organizationCode | xyz | Org code for tenancy |
| applicationCode | studio | App identifier |
| apiToken | b82b5a355c98b74 | Session token |
| callback | ng_jsonp_callback_19 | JSONP wrapper for Angular |
FilterCommand
{
"criteria": [
{
"fieldName": "farmer.id",
"operator": "matches",
"value": "6854101b4e706274620c83bc"
}
]
}
Example Request
GET https://studio.nirvahak.com/studio/jsonp/getAll?objectName=com.tsb.services.studio.common.FarmerCrop&pageSize=10&pageStart=0&filterCommand={"criteria":[{"fieldName":"farmer.id","operator":"matches","value":"6854101b4e706274620c83bc"}]}&username=ssa-user&organizationCode=xyz&applicationCode=studio&apiToken=b82b5a355c98b74&callback=ng_jsonp_callback_19
Response Format
ng_jsonp_callback_X({
"status": "success",
"data": [
{
"_id": "65029a730652f03678635db7",
"loanType": "Short Term Loan",
"description": "Agriculture loan"
}
],
"totalCount": 1
});
Error Example
ng_jsonp_callback_X({
"status": "error",
"message": "Invalid object name or missing credentials"
});