This section contains details about the service APIs in the Registration Center Masterdata module
Registration Centers API
These APIs includes create, update and fetch APIs. Create and Update API is used by the Administrator Portal for the Create and Update Center functionality. Fetch APIs are used by Pre-Registration to display the List of Registration Centers on the UI for an Applicant to select and book appointments. Registration processor also uses the fetch API to validate if a packet is generated in an Authorized Registration Center or not.
POST /registrationcenters
This service will create the list of Registration Centers which are used in the MOSIP platform. Please find the steps to create primary/secondary languages
POST /registrationcenters
Resource details
Resource Details
Description
Name
Required
Description
Default Value
Example
Name of the registration center
Code of the location of the registration center
Longitude of the registration center
Latitude of the registration center
Contact phone number of the registration center
Working hours of the registration center
Process time per kiosk in the registration center
Office start time of the registration center
Office end time of the registration center
Holiday location of the registration center
Contact person of the registration center
Lunch start time of the registration center
Lunch end time of the registration center
time zone of the registration center
Example Request
Error Response:
Failure details
Error Code
Error Message
Error Description
If unauthorized role detected
If no role/invalid token is detected
Error occurred while Inserting Registration Center details
If any error occur from database
Received data is not present in all Languages supported by MOSIP
If all the mandatory data is not received in all the configured languages
Records with duplicate language code found
if records received contain duplicate language codes
Latitude or Longitude must have minimum 4 digits after decimal
If the Latitude and/or Longitude are in invalid format
Center Lunch Start Time must be smaller than Center Lunch End Time
If Center Lunch start time is bigger than Center Lunch End Time
Center Start Time must be smaller than Center End Time
If Center Start time is bigger than Center End Time
PUT /registrationcenters
This service will update the list of Registration Centers which are used in the MOSIP platform.
PUT /registrationcenters
Resource details
Resource Details
Description
Name
Required
Description
Default Value
Example
Name of the registration center
Id of the registration center
Incase of Primary empty and Generated id incase of Secondary
Code of the location of the registration center
Longitude of the registration center
Latitude of the registration center
Contact phone number of the registration center
Working hours of the registration center
Process time per kiosk in the registration center
Office start time of the registration center
Office end time of the registration center
Holiday location of the registration center
Is the registration center active
Contact person of the registration center
Lunch start time of the registration center
Lunch end time of the registration center
time zone of the registration center
Example Request
Error Response:
Failure details
Error Code
Error Message
Error Description
If unauthorized role detected
If no role/invalid token is detected
Error occurred while updating Registration Center details
If any error occur from database
Received data is not present in all Languages supported by MOSIP
If all the mandatory data is not received in all the configured languages
Center IDs received for all languages is not same
If all the IDs received are not same for data in all the languages
Center ID and Language Code combination is not unique in the request received
If combination of Center ID and Language code in duplicate in request
Records with duplicate language code found
if records received contain duplicate language codes
Latitude or Longitude must have minimum 4 digits after decimal
If the Latitude and/or Longitude are in invalid format
Center Lunch Start Time must be smaller than Center Lunch End Time
If Center Lunch start time is bigger than Center Lunch End Time
Center Start Time must be smaller than Center End Time
If Center Start time is bigger than Center End Time
GET /registrationcenters
This service will provides the service for the List of Registration Centers.
GET /registrationcenters
Resource details
Resource Details
Description
Name
Required
Description
Default Value
Example
Example Response
GET /registrationcenters/{id}/{languagecode}
This service will provides the service for the List of Registration Centers.
GET /registrationcenters/{id}/{languagecode}
Resource details
Resource Details
Description
Name
Required
Description
Default Value
Example
Example Response
GET /getregistrationcenterholidays/{languagecode}/{registrationcenterid}/{year}
This service will list of holidays for a particular registration center for that particular year.
GET /getregistrationcenterholidays/{languagecode}/{registrationcenterid}/{year}
Resource details
Resource Details
Description
Name
Required
Description
Default Value
Example
ID of the registration center
The year for which the list of holidays is listed
Example Response
200
GET /getlocspecificregistrationcenters/{langcode}/{locationcode}
This service will return a list of enrollment center details based on the location code
GET /getlocspecificregistrationcenters/{langcode}/{locationcode}
Resource details
Resource Details
Description
Name
Required
Description
Default Value
Example
The location code for which the list of enrollment centers are needed
Example Response
200
Description: OK
GET /getcoordinatespecificregistrationcenters/{languagecode}/{longitude}/{latitude}/{proximitydistance}
This service will return a list of enrollment center details based on the coordinates
GET /getcoordinatespecificregistrationcenters/{languagecode}/{longitude}/{latitude}/{proximitydistance}
Resource details
Resource Details
Description
Name
Required
Description
Default Value
Example
Language code in Language code in ISO 639-2 format
The longitude for which the list of enrollment centers are needed
The latitude code for which the list of enrollment centers are needed
The proximity diameter in meter
Example Response
200
Description: Success
GET /registrationcentershistory/{id}/{languagecode}/{eff_dtimes}
This service will provides the service for the List of Registration Centers History.
GET /registrationcentershistory/{id}/{languagecode}/{eff_dtimes}
Resource details
Resource Details
Description
Name
Required
Description
Default Value
Example
Example Response
200
Description: Success
GET /getregistrationmachineusermappinghistory/{eff_dtimes}/{registrationcenterid}/{machineid}/{userid}
This service will provides the history of mappings of mapping History of Registration, Machine and User based on Registration Center ID, Machine ID, User ID, Date and Language Code
GET /getregistrationmachineusermappinghistory/{eff_dtimes}/{registrationcenterid}/{machineid}/{userid}
Resource details
Resource Details
Description
Name
Required
Description
Default Value
Example
Language code in Language code in ISO 639-2 format
From which date this change is with effective
ID of the registration center
Example Response
200
Description: Success
GET /getlocspecificregistrationcenters/{hierarchylevel}/{textvalue}/{languagecode}
This service will return a list of enrollment center details based on hierarchy level, text value and language code
GET /getlocspecificregistrationcenters/{hierarchylevel}/{textvalue}/{languagecode}
Resource details
Resource Details
Description
Name
Required
Description
Default Value
Example
The hierarchy level for which the list of enrollment centers are needed
This is a free text. The search will happen with the combination of hierarchy level, language code and this free text. The enrollment centers which satisfy these 3 criteria will be returned
The enrollment center description will be returned in this language code
Example Response
200
Description: Success
Failure Response:
Failure details
Error Code
Error Message
Error Description
Error occurred while fetching Registration Centers
registration center fetch exception
Error occurred while updating Registration Center details
registration center update exception
Error occurred while deleting Registration Center details
registration center delete exception
Registration Center not found
registration center not found
Cannot delete as dependency found
date time parse exception
start/end time Data not configured in database
data to be validated with not found
Registration Center User Machine Mapping API
These APIs includes map and un-map API. Both these APIs are used by the Administrator Portal for the Create and Remove Center-Machine Mapping functionality.
POST /registrationmachineusermappings
This service will create a Registration Center-User-Machine Mapping which are used in the MOSIP platform.
POST /registrationmachineusermappings
Resource details
Resource Details
Description
Name
Required
Description
Default Value
Example
Registration Center Id for request
Example Request
Example Response
200
Description: Success
GET /getregistrationmachineusermappinghistory/{effdtimes}/{registrationcenterid}/{machineid}/{userid}
This service will provides the service for the Center-User-Machine with their history.
GET /getregistrationmachineusermappinghistory/{effdtimes}/{registrationcenterid}/{machineid}/{userid}
Resource details
Resource Details
Description
Name
Required
Description
Default Value
Example
Effective Date and Time of the Machine
Example Response
200
Description: Success
PUT /registrationmachineusermappings
This service will create or update a Registration Center-User-Machine Mapping which are used in the MOSIP platform.
PUT /registrationmachineusermappings
Resource details
Resource Details
Description
Name
Required
Description
Default Value
Example
Registration Center Id for request
Example Request
Example Response
201
Failure Response:
Failure details
Error Code
Error Message
Error Description
Error occurred while inserting mapping of Center, User and Machine details
registration center user machine mapping insert exception
Registration Center, Machine and User Mapping not found
registration center user machine not found
Error occurred while deleting mapping of Center, User and Machine details
registration center user machine delete exception
Error occurred while updating mapping of Center, User and Machine details
registration center user machine update exception
Registration Center Machine API
These APIs includes map and un-map API. Both these APIs are used by the Administrator Portal for the Create and Remove Center-Machine Mapping functionality.
POST /registrationcentermachine
This service will create the mapping of registration canter and machine in the RegistrationCenterMachine Master module.
POST /registrationcentermachine
Resource details
Resource Details
Description
Name
Required
Description
Default Value
Example
Available registration center
Example Request
Example Response
201
Description: Created
DELETE/registrationcentermachine/{regCenterId}/{machineId}
This service will provides the service for delete mapping of Center-Machine.
DELETE /registrationcentermachine/{regCenterId}/{machineId}
Resource details
Resource Details
Description
Name
Required
Description
Default Value
Example
Example Response
200
Description: Success
Failure Response:
Failure details
Error Code
Error Message
Error Description
Error occurred while inserting a mapping of Machine and Center
registration center machine create exception
Mapping for Machine and Center not found
registration center machine data not found
Error occurred while deleting a mapping of Machine and Center
registration center machine delete exception
Registration Center Device API
These APIs includes map and un-map API. Both these APIs are used by the Administrator Portal for the Create and Remove Center-Device Mapping functionality.
GET /registrationcenterdevice/map/{regCenterId}/{deviceId}
This service will create the mapping of registration canter and device in the RegistrationCenterDevice Master module.
GET /registrationcenterdevice/map/{regCenterId}/{deviceId}
Resource details
Resource Details
Description
Name
Required
Description
Default Value
Example
Available registration center
Example Request
https://mosip.io/v1/masterdata/registrationcenterdevice/map/10001/4cb310e3-965a-4afd-a28e-0db6b3db5423
Example Response
200
Failure Response:
Failure details
Error Code
Error Message
Error Description
Admin not authorized to map/un-map this Registration Center
when user zone doesn't belong to the same zone of center
Admin not authorized to map/un-map this Device
when user zone doesn't belong to the same zone of device
Cannot map as the Registration Center/Device is Decommissioned
When center/device trying to map is decomissioned
Cannot map the Device as it is mapped to another Registration Center
When the center/device are already mapped to center
Device cannot be mapped to the Center as Center and Device does not belong to the same Administrative Zone
When the device doesn't belong to same category
PUT /registrationcenterdevice/unmap/{deviceId}/{regCenterId}
This service will provides the service for un map the mapping of Device and Registration Center.
PUT /registrationcenterdevice/unmap/{deviceId}/{regCenterId}
Resource details
Resource Details
Description
Name
Required
Description
Default Value
Example
Example Response
Failure Response:
Failure details
Error Code
Error Message
Error Description
Admin not authorized to map/un-map this Registration Center
when user zone doesn't belong to the same zone of center
Admin not authorized to map/un-map this Device
when user zone doesn't belong to the same zone of device
Device Id %s - Center Id %s mapping does not exist
when center/device trying to unmap doesn't exist
Device-Registration Center un-mapping already exist
When the center/device mapping already exists
Device cannot be mapped to the Center as Center and Device does not belong to the same Administrative Zone
When the device doesn't belong to same category
Error occurred while mapping Device to Registration Center
Exception while mapping device to registration center
Registration Center Machine Device API
These APIs includes map, un-map and fetch mapping APIs. The Map and Un-Map APIs are used to create/remove Center-Machine-Device mapping.
POST /registrationcentermachinedevice
This service will create the mapping of registration center, machine and device in the RegistrationCenterMachineDevice Master module.
POST /registrationcentermachinedevice
Resource details
Resource Details
Description
Name
Required
Description
Default Value
Example
Available registration center
Example Request
Example Response
201
Description: Created
DELETE /registrationcentermachinedevice/{regcenterid}/{machineid}/{deviceid}
This service will delete the mapping of registration center, machine and device in the RegistrationCenter-Machine-Device Master module.
DELETE /registrationcentermachinedevice/{regcenterid}/{machineid}/{deviceid}
Resource details
Resource Details
Description
Name
Required
Description
Default Value
Example
Example Response
200
Description: Success
Failure Response:
Failure details
Error Code
Error Message
Error Description
Error occurred while inserting a mapping of Center, Machine and Device
registration center machine device create exception
Error occurred while deleting a mapping of Center, Machine and Device
registration center machine device delete exception
Mapping for Center, Machine and Device not found
registration center machine device data not found exception
Registration Center search APIs
This API is used by the Administrator Portal to fetch the list of Registration Centers based on a given filter criteria to display the list of Registration Centers on the Portal UI.
POST /registrationcenters/search
This service is for the registration centers search functionality. All the filter parameters are passed and the registration centers are searched and the matching results are returned.
POST /registrationcenters/search
Resource details
Resource Details
Description
Name
Required
Description
Default Value
Example
Array of the filter applied. In case of "list" screen, this array will be empty
The column name in the JSON response
The value have to be in ["contains","startsWith","equals","between"]
Value or id selected in the filter by the end user
If the type is "between", this field is the start value
If the type is "between", this field is the end value
Language code in Language code in ISO 639-2 format
This is an array of the sort field and type
The field on which the sort is applied
This should be either of ['ASC','DESC']
The pagination parameter object
This is the amount of records to be fetched
Please find the filter columns used in search:
Example Request
Example Response
Registration Center filter values
This API is used by the Administrator Portal to fetch the list of Registration Centers based on a given filter criteria to display the list of Registration Centers on the Portal UI.
POST /registrationcenters/filtervalues
This service returns the filter values which are required in the dropdown entries of the filter screen.
POST /registrationcenters/filtervalues
Resource details
Resource Details
Description
Name
Required
Description
Default Value
Example
Array of the filter applied. In case of "list" screen, this array will be empty
The column name in the JSON response
The value have to be in ["unique","all"]
Language code in Language code in ISO 639-2 format
Example Request
Example Response
Registration Center Type Search APIs
This API is used by the Administrator Portal to fetch the list of Registration Center Types based on a given filter criteria to display the list of Registration Center Types on the Portal UI.
POST /registrationcentertypes/search
This service is for the registration center types search functionality. All the filter parameters are passed and the registration center types are searched and the matching results are returned.
POST /registrationcentertypes/search
Resource details
Resource Details
Description
Name
Required
Description
Default Value
Example
Array of the filter applied. In case of "list" screen, this array will be empty
The column name in the JSON response
The value have to be in ["contains","equals","startsWith","between"]
Value or id selected in the filter by the end user
If the type is "between", this field is the value of the start range
If the type is "between", this field is the value of the end range
Language code in Language code in ISO 639-2 format
This is an array of the sort field and type
The field on which the sort is applied
This should be either of ['ASC','DESC']
The pagination parameter object
This is the amount of records to be fetched
["contains","equals","startsWith"]
Example Request
Example Response
Registration Center Types Filter values
This API is used by the Administrator Portal UI to populate filter dropdowns on the Registration Center Type List View UI Screen.
POST /regcentertypes/filtervalues
This service returns the filter values which are required in the dropdown entries of the filter screen.
POST /regcentertypes/filtervalues
Resource details
Resource Details
Description
Name
Required
Description
Default Value
Example
Array of the filter applied. In case of "list" screen, this array will be empty
The column name in the JSON response
The value have to be in ["unique","all"]
Language code in Language code in ISO 639-2 format
Example Request
Example Response
Create/Update API
This API is a utility used by all the Create and Update APIs to perform multi-language data validation on the input received from Administrator Portal UI.
All the Create API's use the common class to create masterdata, Please find the important points to be taken care
Create :
Primary language must be created first and then id must be passed in the secondary language request.
Primary id must be passed blank for primary language request.
Primary language will not be activated unless Secondary language is created.
Primary Id for Center/Machine will be sequential Id's and other masterdata's will be auto generated values.
Update :
Activation and deactivation will be done , If we only pass the primary language with active/deactivate in the request.
This API is a utility used by all the Masterdata Search APIs to accept the filter criteria and form a query to fetch data from the Database.