The Save API is a versatile endpoint used to create or update data objects within the Nirvahak platform. This API works across multiple modules like Appointments, Orders, Users, and more by passing structured data in the request.
The save API is typically used after authentication and is called via JSONP to support frontend frameworks like Angular.
API Endpoint
POST https://server.nirvahak.com/studio/jsonp/save
Request Structure
The request is sent as a JSON object in the query parameters (JSONP), and should include:-
objectNameapplicationCodeorganizationCodedata(actual data to be saved)apiTokencallback
Parameter Breakdown
| Parameter | Type | Required | Description |
| objectName | String | Yes | Fully qualified object name to save (e.g., com.tsb.services.studio.Appointment) |
| data | Object | Yes | Actual content/data to be saved |
| apiToken | String | Yes | Authorization token returned after login |
| applicationCode | String | Yes | Application identifier (e.g., studio) |
| organizationCode | String | Yes | Organization code from login or org fetch |
| callback | String | Yes | JSONP callback function name (used by Angular HTTP JSONP) |
API Call
POST https://server.nirvahak.com/studio/jsonp/save?callback=ng_jsonp_callback_1
Request Body (Sent as JSONP Data):
{
"objectName": "com.tsb.services.studio.Appointment",
"applicationCode": "studio",
"organizationCode": "xyz",
"apiToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"data": {
"name": "Joe",
"email": "joe@example.com",
"mobileNo": "9999999999",
"date": "2025-07-01",
"location": "Hyderabad"
}
}
Success Response
{
"status": "success",
"message": "Object saved successfully",
"savedObjectId": "APT12345"
}
Error Response
{
"status": "error",
"message": "Invalid token or missing fields",
"error_code": "SAVE_ERR_401"
}