Workbook templates API Resource

Abstract class for REST webservices

POST /api/admin/reporttemplate

Add workbook template to repository

Request Parameters
name type description constraints
classId query - id of classId for template long
headerIndex query - index of row with header columns long
outputType query - type of destination output format (xls/pdf) int
Request Body
media type data type description
multipart/form-data (custom) - request containing uploaded template file
Response Body
media type data type description
application/json HdcSuccessTO (JSON) JSON Response with the information, whether operation has been succeeded.

Example

Request
POST /api/admin/reporttemplate
Content-Type: multipart/form-data
Accept: application/json

                

                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
{ }
                
              

GET /api/admin/reporttemplate/json

Get Workbook Templates from templates repository.

Response Body
media type data type description
application/json object (JSON) JSON Response with Workbook templates information

Example of response:

{"list":[{"type":"Pdf","classId":"130","className":"hdv_h3_struct","classLabel":"Anlaggning","id":0,"headerIndex":0,"name":"Blue expense report1.xlsx"},{"type":"Xls","classId":"461","className":"equipment","classLabel":"Equipment","id":0,"headerIndex":0,"name":"simple1111test.xlsx"},{"type":"Pdf","classId":"102","className":"org3grp","classLabel":"Affärsomrade","id":0,"headerIndex":0,"name":"simple1111test.xlsx"}]}

Example

Request
GET /api/admin/reporttemplate/json
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
...
                
              

POST /api/admin/reporttemplate/{id}

Request Parameters
name type description constraints
id path long
Response Body
media type data type description
application/json object (JSON)

Example

Request
POST /api/admin/reporttemplate/{id}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
...
                
              

DELETE /api/admin/reporttemplate/{templateId}

delete Workbook Template from Workbook Template repository

Request Parameters
name type description constraints
templateId path - id of template long
Response Body
media type data type description
application/json HdcSuccessTO (JSON) JSON Response with the information, whether operation has been succeeded.

Example

Request
DELETE /api/admin/reporttemplate/{templateId}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
{ }
                
              

GET /api/admin/reporttemplate/{templateId}

Get binary representation of given Workbook Template

Request Parameters
name type description constraints
templateId path - id of template long
Response Body
media type data type description
application/json object (JSON) Binary representation of workbook template

Example

Request
GET /api/admin/reporttemplate/{templateId}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
...