hrms-report-template/api.http

130 lines
3.7 KiB
HTTP

@api_host = http://localhost:3001/api/v1/report-template
############### docx
### templates/docx
GET {{api_host}}/docx
### template docx docx libreoffice accept
# accept: application/msword , image/png, image/jpeg, application/pdf
# accept: application/vnd.oasis.opendocument.text,application/vnd.openxmlformats-officedocument.wordprocessingml.document
#POST {{api_host}}/docx?folder=test
POST {{api_host}}/docx
Content-Type: application/json
Accept: application/pdf
{
"template": "hello",
"reportName": "docx-report",
"data": {
"docNo": "",
"me": "",
"prefix": "",
"name": "",
"surname": "",
"position": "Chief Technology Officer",
"org": {
"type": "",
"name": "",
"url": "https://frappet.com"
},
"employees": [
{
"name": "",
"surname": ""
},
{
"name": "",
"surname": ""
}
]
}
}
############### xlsx
### templates/xlsx
GET {{api_host}}/xlsx
### template docx docx libreoffice accept
# accept: application/msword , image/png, image/jpeg, application/pdf
# accept: application/vnd.oasis.opendocument.text,application/vnd.openxmlformats-officedocument.wordprocessingml.document
#POST {{api_host}}/docx?folder=test
POST {{api_host}}/xlsx
Content-Type: application/json
Accept: application/pdf
{
"template": "hello",
"reportName": "xlsx-report",
"data": {
"docNo": "",
"me": "",
"prefix": "",
"name": "",
"surname": "",
"position": "Chief Technology Officer",
"org": {
"type": "",
"name": "",
"url": "https://frappet.com"
},
"employees": [
{
"id": 1,
"name": "",
"surname": "",
"score": 80
},
{
"id": 2,
"name": "",
"surname": "",
"score": 50
},
{
"id": 3,
"name": "",
"surname": "",
"score": 90
},
{
"id": 4,
"name": " ",
"surname": "",
"score": 99
}
]
}
}
### convert Grafana dashboard to pdf
POST {{api_host}}/html
Content-Type: application/json
Accept: application/pdf
{
"template": "https://bma-dashboard.frappet.synology.me/d/ANtkJay4z/4Lic4Li54LmJ4Lie4Li04LiB4Liy4Lij?orgId=1&kiosk",
"reportName": "html-grafana",
"htmlOption": {
"querySelector": ".scrollbar-view"
}
}
### convert blognone to png
POST {{api_host}}/html
Content-Type: application/json
Accept: image/png
{
"template": "https://www.blognone.com",
"reportName": "html-blognone"
}
### convert blognone to pdf
POST {{api_host}}/html
Content-Type: application/json
Accept: application/pdf
{
"template": "https://pantip.com",
"reportName": "html-pantip.com"
}