This page documents the Action Exporter service API endpoints. Apart from the Service Information endpoint, all these endpoints are secured using HTTP basic authentication. All endpoints return an HTTP 200 OK status code except where noted otherwise.
GET /infowill return information about this service, collated from when it was last built.
{
"name": "actionexportersvc",
"version": "10.42.0",
"origin": "git@github.com:ONSdigital/rm-actionexporter-service.git",
"commit": "a59450c6b028824bc59ef33be6d697f1a75262ac",
"branch": "master",
"built": "2017-07-12T15:20:07Z"
}GET /templateswill return a list of all Action Exporter templates.
[
{
"name": "initialPrint",
"content": "<#list actionRequests as actionRequest>\n ${(actionRequest.address.sampleUnitRef)!}|${actionRequest.iac?trim}|${(actionRequest.contact.forename?trim)!}|${(actionRequest.contact.emailaddress)!}\n </#list>",
"dateModified": "2017-07-14T12:00:00Z"
}
]An HTTP 204 No Content status code is returned if there are no Action Exporter templates.
GET /templates/{templateName}will return the details of the Action Exporter template with the nameinitialPrint.
{
"name": "initialPrint",
"content": "<#list actionRequests as actionRequest>\n ${(actionRequest.address.sampleUnitRef)!}|${actionRequest.iac?trim}|${(actionRequest.contact.forename?trim)!}|${(actionRequest.contact.emailaddress)!}\n </#list>",
"dateModified": "2017-07-14T12:00:00Z"
}An HTTP 404 Not Found status code is returned if the Action Exporter template with the specified name could not be found.
POST /templates/{templateName}will upload a FreeMarker template to the Action Exporter template with the nameinitialPrint.
Required parameters: file as the FreeMarker template form-data.
{
"name": "initialPrint",
"content": "<#list actionRequests as actionRequest>\n ${(actionRequest.address.sampleUnitRef)!}|${actionRequest.iac?trim}|${(actionRequest.contact.forename?trim)!}|${(actionRequest.contact.emailaddress)!}\n </#list>",
"dateModified": "2017-07-14T12:00:00Z"
}An HTTP 201 Created status code is returned if the FreeMarker template upload was a success. An HTTP 400 Bad Request is returned if the input data was invalid.
GET /templatemappingswill return a list of all mappings for Action Exporter templates.
[
{
"actionType": "BSNOT",
"template": "initialPrint",
"file": "BSNOT",
"dateModified": "2017-07-14T12:00:00Z"
},
{
"actionType": "BSREM",
"template": "initialPrint",
"file": "BSREM",
"dateModified": "2017-07-14T12:00:00Z"
}
]An HTTP 204 No Content status code is returned if there are no Action Exporter template mappings.
GET /templatemappings/{actionType}will return the details of the Action Exporter template mapping with the action typeBSNOT.
{
"actionType": "BSNOT",
"template": "initialPrint",
"file": "BSNOT",
"dateModified": "2017-07-14T12:00:00Z"
}An HTTP 404 Not Found status code is return if the Action Exporter template mapping with the specified action type could not be found.
POST /templatemappings/{actionType}will upload FreeMarker template JSON to the Action Exporter template mapping with the specified action type.
Required parameters: template as the FreeMarker template name. fileNamePrefix as the intended prefix of the template file.
[
{
"actionType": "BSNOT",
"template": "initialPrint",
"fileNamePrefix": "ICL1_2003",
"dateModified": "2017-09-18T15:42:41.473+0100"
}
]An HTTP 201 Created status code is returned if the FreeMarker template upload was a success. An HTTP 400 Bad Request is returned if the input data was invalid.
GET /reports/typeswill return a list of all Action Exporter report types.
[
{
"reportType": "PRINT_VOLUMES",
"displayOrder": 10,
"displayName": "Print Volumes"
}
]An HTTP 204 No Content status code is returned if there are no report types.
GET /reports/types/PRINT_VOLUMESwill return a list of all reports with the typePRINT_VOLUMES.
[
{
"id": "16280cb1-a1e4-47ac-9e99-d050e6db06d3",
"reportType": "PRINT_VOLUMES",
"createdDateTime": "2017-08-04T14:19:04.707+0000"
}
]An HTTP 404 Not Found status code is returned if the report type could not be found. An HTTP 204 No Content status code is returned if there are no reports for the specified report type.
GET /reports/16280cb1-a1e4-47ac-9e99-d050e6db06d3will return the details of the report with an ID of16280cb1-a1e4-47ac-9e99-d050e6db06d3.
{
"id": "16280cb1-a1e4-47ac-9e99-d050e6db06d3",
"reportType": "PRINT_VOLUMES",
"contents": "filename,rowcount,datesent\nBSREM_221_201712_04082017_1411.csv,799,2017-08-04 14:15:25.686+00\nBSNOT_221_201712_04082017_1411.csv,399,2017-08-04 14:17:53.093+00\nBSREM_221_201711_04082017_1417.csv,100,2017-08-04 14:18:00.908+00\nBSNOT_221_201711_04082017_1417.csv,50,2017-08-04 14:18:10.514+00\nBSREM_221_201710_04082017_1418.csv,101,2017-08-04 14:18:19.205+00\nBSNOT_221_201710_04082017_1418.csv,51,2017-08-04 14:19:02.281+00",
"createdDateTime": "2017-08-04T14:19:04.707+0000"
}An HTTP 404 Not Found status code is returned if the report with the specified ID could not be found.