Template APIs

This section contains detail about the service APIs in the Template Masterdata module

These APIs includes create, update and fetch APIs. Create and Update API is used by the Administrator Portal for the Create and Update Template functionality. Fetch API is used by all the modules across MOSIP (Pre-Registration, Registration Processor, IDA, Resident Services) to fetch a Template based on a given Language Code and a Template type. This template is then used by the different modules to either generate an Acknowledgement page or send a notification.

This API is used to create a Template Type.

This API is used by the Administrator Portal to fetch the list of Templates based on a given filter criteria to display the list of Templates on the Portal UI.

This API is used by the Administrator Portal UI to populate filter dropdowns on the Template List View UI Screen.

Template API

POST /templates

This service will create the list of Template which are used in the MOSIP platform.

Resource URL

POST /templates

Resource details

Parameters

Example Request

{
  "id": "string",
  "version": "string",
  "metadata": {},
  "requesttime": "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",
  "request":  {
    "description": "string",
    "fileFormatCode": "string",
    "fileText": "string",
    "id": "string",
    "isActive": true,
    "langCode": "string",
    "model": "string",
    "moduleId": "string",
    "moduleName": "string",
    "name": "string",
    "templateTypeCode": "string"
  }
}
}

Example Response

{
  "id": "string",
  "version": "string",
  "metadata": {},
  "responsetime": "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",
  "errors": null,
  "response":  {
     "id": "string"
  }
}

PUT /templates

This service will update the list of Template which are used in the MOSIP platform.

Resource URL

PUT /templates

Resource details

Parameters

Example Request

{
  "id": "string",
  "version": "string",
  "metadata": {},
  "requesttime": "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",
  "request":  {
    "description": "string",
    "fileFormatCode": "string",
    "fileText": "string",
    "id": "string",
    "isActive": true,
    "langCode": "string",
    "model": "string",
    "moduleId": "string",
    "moduleName": "string",
    "name": "string",
    "templateTypeCode": "string"
  }
}

Example Response

{
  "id": "string",
  "version": "string",
  "metadata": {},
  "responsetime": "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",
  "errors": null,
  "response":  {
      "id": "string"
   }
}

DELETE /templates/{id}

Master data is required across the platform.

This service will deletes a list of Template from the Template master module.

Resource URL

DELETE /templates/{id}

Resource details

Parameters

Success Response

{
  "id": "string",
  "version": "string",
  "metadata": {},
  "responsetime": "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",
  "errors": null,
  "response"  : {
      "id": "string"
  }
}

Example Response

{
  "id": "string",
  "version": "string",
  "metadata": {},
  "responsetime": "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",
  "errors": [{
      "errorCode": "string",
      "message": "string"
    }],
  "response":  null
}

GET /templates

Master data is required across the platform.

This service will fetch a list of Template from the Template master module.

Resource URL

GET /templates

Resource details

Parameters

Example Response

{
  "errors": [
    {
      "errorCode": "string",
      "message": "string"
    }
  ],
  "id": "string",
  "metadata": {},
  "response": {
    "templates": [
      {
        "createdBy": "string",
        "description": "string",
        "fileFormatCode": "string",
        "fileText": "string",
        "id": "string",
        "isActive": true,
        "isDeleted": true,
        "langCode": "string",
        "model": "string",
        "moduleId": "string",
        "moduleName": "string",
        "name": "string",
        "templateTypeCode": "string",
        "updatedBy": "string"
      }
    ]
  },
  "responsetime": "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",
  "version": "string"
}

GET /templates/{langcode}

Master data is required across the platform.

This service will fetch a list of Templates as per the language code from the Template master module.

Resource URL

GET /templates/{langcode}

Resource details

Parameters

Example Response

{
  "errors": [
    {
      "errorCode": "string",
      "message": "string"
    }
  ],
  "id": "string",
  "metadata": {},
  "response": {
    "templates": [
      {
        "createdBy": "string",
        "description": "string",
        "fileFormatCode": "string",
        "fileText": "string",
        "id": "string",
        "isActive": true,
        "isDeleted": true,
        "langCode": "string",
        "model": "string",
        "moduleId": "string",
        "moduleName": "string",
        "name": "string",
        "templateTypeCode": "string",
        "updatedBy": "string"
      }
    ]
  },
  "responsetime": "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",
  "version": "string"
}

GET /templates/{langcode}/{templatetypecode}

Master data is required across the platform.

This service will fetch a list of Templates as per the language code and template type code from the Template master module.

Resource URL

GET /templates/{langcode}/{templatetypecode}

Resource details

Parameters

Example Response

{
  "errors": [
    {
      "errorCode": "string",
      "message": "string"
    }
  ],
  "id": "string",
  "metadata": {},
  "response": {
    "templates": [
      {
        "createdBy": "string",
        "description": "string",
        "fileFormatCode": "string",
        "fileText": "string",
        "id": "string",
        "isActive": true,
        "isDeleted": true,
        "langCode": "string",
        "model": "string",
        "moduleId": "string",
        "moduleName": "string",
        "name": "string",
        "templateTypeCode": "string",
        "updatedBy": "string"
      }
    ]
  },
  "responsetime": "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",
  "version": "string"
}

GET /templates/all

Master data is required across the platform.

This service will fetch all Templates from the Template master module.

Resource URL

GET /templates/all

Resource details

Parameters

Example Response

{
  "errors": [
    {
      "errorCode": "string",
      "message": "string"
    }
  ],
  "id": "string",
  "metadata": {},
  "response": {
    "data": [
      {
        "createdBy": "string",
        "description": "string",
        "fileFormatCode": "string",
        "fileText": "string",
        "id": "string",
        "isActive": true,
        "isDeleted": true,
        "langCode": "string",
        "model": "string",
        "moduleId": "string",
        "moduleName": "string",
        "name": "string",
        "templateTypeCode": "string",
        "updatedBy": "string"
      }
    ],
    "pageNo": 0,
    "totalItems": 0,
    "totalPages": 0
  },
  "responsetime": "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",
  "version": "string"
}

GET /templates/templatetypecode/{code}

Master data is required across the platform.

This service will fetch all Templates as per the template type code from the Template master module.

Resource URL

GET /templates/templatetypecode/{code}

Resource details

Parameters

Example Response

{
  "errors": [
    {
      "errorCode": "string",
      "message": "string"
    }
  ],
  "id": "string",
  "metadata": {},
  "response": {
    "templates": [
      {
        "createdBy": "string",
        "description": "string",
        "fileFormatCode": "string",
        "fileText": "string",
        "id": "string",
        "isActive": true,
        "isDeleted": true,
        "langCode": "string",
        "model": "string",
        "moduleId": "string",
        "moduleName": "string",
        "name": "string",
        "templateTypeCode": "string",
        "updatedBy": "string"
      }
    ]
  },
  "responsetime": "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",
  "version": "string"
}

Failure details

Template Types API

POST /templatetypes

This service creates template type based on provided.

Resource URL

POST /templatetypes

Resource details

Parameters

Example Request

{
  "id": "string",
  "metadata": {},
  "request": {
    "code": "string",
    "description": "string",
    "isActive": true,
    "langCode": "string"
  },
  "requesttime": "2018-12-10T06:12:52.994Z",
  "version": "string"
}

Example Response

{
  "errors": [
    {
      "errorCode": "string",
      "message": "string"
    }
  ],
  "id": "string",
  "metadata": {},
  "response": {
    "code": "string",
    "langCode": "string"
  },
  "responsetime": "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",
  "version": "string"
}

Response codes

201

Description: Successfully created

400

Description: Request body passed is null or invalid

401

Description: Unauthorized

403

Description: Forbidden

404

Description: Not Found

500

Description: any error occured while creating

Failure details

Resource URL

POST /template/search

Resource details

Parameters

Filter Values

Please find the filter columns used in search

  1. name

  2. moduleId

  3. moduleName

  4. isActive

Example Request

{
	"id": "string",
	"metadata": {},
	"requesttime": "2018-12-10T06:12:52.994Z",
	"version": "string",
	"request": {
		"filters" : [
			{
				"columnName": "",
				"type": "in",
				"value": "",  
				"fromValue": "",    
				"toValue": ""				
			}
		],
		"sort":[
			{
				"sortfield":"string",
				"sorttype":"ASC"
			}
		],
		"pagination":{
			"pageStart":"number",
			"pageFetch":"number"
		},
                "languageCode":""
		
	}
}

Example Response

{
  "id": "string",
  "version": "string",
  "metadata": {},
  "responsetime": "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",
  "errors": null,
  "response": {
  "templates": [
      {
        "description": "string",
        "fileFormatCode": "string",
        "fileText": "string",
        "id": "string",
        "isActive": true,
        "langCode": "string",
        "model": "string",
        "moduleId": "string",
        "moduleName": "string",
        "name": "string",
        "templateTypeCode": "string"
      }
    ],
	"fromRecord" : "number",
	"toRecord":"number",
	"totalRecord":"number"
 }
}

Templatefilter values

POST /template/filtervalues

This service returns the filter values which are required in the dropdown entries of the filter screen.

Resource URL

POST /template/filtervalues

Resource details

Parameters

Example Request

{
	"id": "string",
	"metadata": {},
	"requesttime": "2018-12-10T06:12:52.994Z",
	"version": "string"
	"request": {
		"filters" : [
			{
				"columnName": ""
				"type": "unique"
			}
		],
		"languageCode": "string",
	}
}

Example Response

{
  "id": "string",
  "version": "string",
  "metadata": {},
  "responsetime": "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",
  "errors": null,
  "response": {
  "filters": [
	{
		"fieldID": "string",
		"fieldValue": "string"
	}
   ]
 }
}

Last updated