Informe
En esta página
- POST /reports
- Cuerpo de la solicitud
- Respuestas
- POST /reports/execute
- Cuerpo de la solicitud
- Respuestas
- POST /reports/filter
- Cuerpo de la solicitud
- Respuestas
- POST /reports/sendEmail
- Cuerpo de la solicitud
- Respuestas
- GET /reports/{reportId}
- Parámetros
- Respuestas
- PUT /reports/{reportId}
- Parámetros
- Cuerpo de la Solicitud
- Respuestas
- DELETE /reports/{reportId}
- Parámetros
- Respuestas
- GET /reports/{reportId}/preview
- Parámetros
- Respuestas
Operaciones sobre recursos de informe. 8 puntos finales, cada uno relativo a https://api.nxgen.cloud/api/v1 y autenticado según se describe en Autenticación.
POST /reports
Agregar un informe
Cuerpo de la solicitud
{
"name": "string",
"reportTemplateId": "string",
"description": "string",
"template": "string",
"healthTemplate": "Basic | Plus | Advanced",
"cronSchedule": "string",
"hierarchyId": "string",
"isActive": "boolean",
"userIds": [
"string"
],
"roleIds": [
"string"
],
"emailIds": [
"string"
],
"emailSubject": "string",
"emailBody": "string",
"lang": "string",
"timezone": "string",
"momentsTimeZoneCountryName": "string"
}Respuestas
Estado | Descripción | Cuerpo |
|---|---|---|
200 | Éxito | |
400 | Entrada inválida | |
401 | No autorizado | |
403 | Prohibido | |
404 | No Encontrado |
Ejemplo 200 respuesta:
{
"result": "reportId"
}POST /reports/execute
Activar un informe o obtener datos de muestra para usar en la plantilla
Cuerpo de la solicitud
{
"jobId": "string",
"startTime": "number",
"endTime": "number",
"onlySampleData": "boolean",
"cronSchedule": "string",
"jobConfig": {
"any": "string"
}
}Respuestas
Estado | Descripción | Cuerpo |
|---|---|---|
200 | Éxito | |
400 | Entrada inválida | |
401 | No autorizado | |
403 | Prohibido | |
404 | No Encontrado |
Ejemplo 200 respuesta:
{
"data": {
"response": [
{
"site": "Muster HQ BLR",
"count": 5,
"events": [
{
"key": "camera.health.fail",
"value": 2
},
{
"key": "camera.health.normal",
"value": 3
}
],
"siteId": "0896302cceb04a059fa6aff014e51ac6",
"sensors": [
{
"name": "5N/A",
"deviceType": "camera",
"manafacturer": "HIKVISION",
"s3ImagePath": "",
"event": "camera.health.fail",
"associatedDeviceName": "Network Video Recorder",
"eventTime": 1719964871485
},
{
"name": "IPCamera 04",
"deviceType": "camera",
"manafacturer": "HIKVISION",
"s3ImagePath": "https://nxg-reference-img-upload-test.s3-eu-central-1.amazonaws.com/0896302cceb04a059fa6aff014e51ac6/df0c6f6d4e5e4e9f8e6732121f14b5ee/64d478a78a9a4400ba27876ef71cf84e.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA2B4BNPFBH2CVMGRH%2F20240703%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20240703T082324Z&X-Amz-Expires=604800&X-Amz-Signature=67128d2e4353f760891b4f294dcfc1f1b09b44a8b87cac7fe14497b11ac1c51e&X-Amz-SignedHeaders=host",
"event": "camera.health.fail",
"associatedDeviceName": "Network Video Recorder",
"eventTime": 1719964872557
}
]
}
]
},
"serviceProvider": {
"uniqueId": "e7f417cf4a434b5093a8173cdb50005f",
"email": "admin@web02.io",
"persona": {
"address": {},
"contact": {},
"profile": {
"business": [],
"photos": [
"https://nxg-reference-img-upload-test.s3-eu-central-1.amazonaws.com/e4299bcb77bc4a6780f0473ff03f72fd/e7f417cf4a434b5093a8173cdb50005f.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA2B4BNPFBH2CVMGRH%2F20240703%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20240703T082324Z&X-Amz-Expires=86400&X-Amz-Signature=77f79aee130a8e5083cf88ff9befb0714f5fd2526c115a27db6bbe096ed1799f&X-Amz-SignedHeaders=host"
],
"tags": [],
"followers": [],
"s3ImagePath": "e4299bcb77bc4a6780f0473ff03f72fd/e7f417cf4a434b5093a8173cdb50005f.png"
}
},
"name": "NXG Web 02",
"description": ""
},
"report": {
"name": "Health Check Failure Reports",
"description": "This report provides information about the cameras which are not operational.",
"type": "HealthReport",
"isActive": true
}
}POST /reports/filter
Obtener lista de informes con filtrado, ordenación y paginación.
Cuerpo de la solicitud
Filtrado y ordenación de informes
{
"filters": [
{
"columnName": "string (required)",
"type": "distinctList | date | number | StringConditionFilter (required)",
"filter": "object (required)"
}
],
"sortOrder": [
{
"columnName": "string",
"isAscending": "boolean"
}
],
"primaryColumns": [
"string"
],
"hierarchyLevel": "string",
"hierarchyId": "string",
"nPerPage": "number",
"pageNumber": "number",
"isConfigDetailRequired": "boolean",
"getConfig": "boolean",
"getChildOrParent": "boolean"
}Respuestas
Estado | Descripción | Cuerpo |
|---|---|---|
200 | Éxito | objeto |
204 | Sin contenido | |
400 | Entrada inválida | |
401 | No autorizado | |
403 | Prohibido |
Ejemplo 200 respuesta:
{
"dataResult": [
{
"name": "Health Check Failure Reports",
"type": "HealthReportCustomer",
"isActive": true,
"createdOn": 1719834171704
},
{
"name": "Health Check Failure Reports",
"type": "HealthReportCustomer",
"isActive": true,
"createdOn": 1719822647976
},
{
"name": "Health Check Failure Reports",
"type": "HealthReport",
"isActive": true,
"createdOn": 1719668666364
}
],
"totalRecordsCount": 3
}POST /reports/sendEmail
Enviar correo
Cuerpo de la solicitud
{
"subject": "string",
"emailBody": "string",
"emailList": "string",
"type": "string",
"emailAttachment": {
"fileName": "string",
"file": "string"
}
}Respuestas
Estado | Descripción | Cuerpo |
|---|---|---|
200 | Éxito | |
400 | Entrada inválida | |
401 | No autorizado | |
403 | Prohibido | |
404 | No Encontrado | |
500 | Error interno del servidor |
Ejemplo 200 respuesta:
{
"message": "Accepted for email transfer"
}GET /reports/{reportId}
Obtener un informe
Parámetros
Nombre | En | Tipo | Obligatorio | Descripción |
|---|---|---|---|---|
reportId | ruta | cadena | sí |
Respuestas
Estado | Descripción | Cuerpo |
|---|---|---|
200 | Éxito | |
400 | Entrada inválida | |
401 | No autorizado | |
403 | Prohibido | |
404 | No Encontrado |
Ejemplo 200 respuesta:
{
"data": {
"uniqueId": "2f76ca1411ef439e9d69ad3730ec3408",
"name": "Test Update",
"type": "HealthReportCustomer",
"description": "This report provides information about the cameras which are not operational.",
"serviceProviderId": "e7f417cf4a434b5093a8173cdb50005f",
"template": "",
"cronSchedule": "0 4 * * *",
"hierarchyLevel": "serviceprovider",
"hierarchyId": "e7f417cf4a434b5093a8173cdb50005f",
"isActive": true,
"dataSources": [
{
"parameters": [
"customerId"
],
"_id": "6683e770d05d712a670cee7d",
"query": "[{\"$match\":{\"customerId\":\"{{customerId}}\"}}]",
"collectionName": "Sensors",
"output": "response",
"metadata": {
"fieldsRequiringSignedUrl": [
{
"field": "s3ImagePath",
"bucketName": "nxg-reference-img-upload-test"
}
]
}
}
],
"roleIds": [],
"userIds": [
"70cb24d36f86424b802873af7e78c2d3"
],
"emailIds": [
"dev@nxgen.io"
],
"emailSubject": "{{reportName}}",
"emailBody": "Dear Customer,,<br><br>I hope this message finds you well.<br><br>I am pleased to inform you that the {{reportName}} is now available for download. Please find the details of the report <a href='{{fileUrl}}'>here</a><br><br>Please note that this link will remain active for the next seven days only. Kindly ensure that you download and review the report within this timeframe."
}
}PUT /reports/{reportId}
Actualizar un informe
Parámetros
Nombre | En | Tipo | Obligatorio | Descripción |
|---|---|---|---|---|
reportId | path | string | sí |
Cuerpo de la Solicitud
{
"name": "string",
"reportTemplateId": "string",
"description": "string",
"template": "string",
"healthTemplate": "Basic | Plus | Advanced",
"cronSchedule": "string",
"hierarchyId": "string",
"isActive": "boolean",
"userIds": [
"string"
],
"roleIds": [
"string"
],
"emailIds": [
"string"
],
"emailSubject": "string",
"emailBody": "string",
"lang": "string",
"timezone": "string",
"momentsTimeZoneCountryName": "string"
}Respuestas
Estado | Descripción | Cuerpo |
|---|---|---|
200 | Éxito | |
400 | Entrada inválida | |
401 | No autorizado | |
403 | Prohibido | |
404 | No Encontrado |
Example 200 respuesta:
{
"result": "reportId"
}DELETE /reports/{reportId}
Eliminar un informe
Parámetros
Nombre | En | Tipo | Obligatorio | Descripción |
|---|---|---|---|---|
reportId | path | string | sí |
Respuestas
Estado | Descripción | Cuerpo |
|---|---|---|
200 | Éxito | |
400 | Entrada inválida | |
401 | No autorizado | |
403 | Prohibido | |
404 | No Encontrado |
Ejemplo 200 respuesta:
{
"result": "reportId"
}GET /reports/{reportId}/preview
Vista previa de un informe
Parámetros
Nombre | En | Tipo | Obligatorio | Descripción |
|---|---|---|---|---|
reportId | ruta | cadena | sí |
Respuestas
Estado | Descripción | Cuerpo |
|---|---|---|
200 | Éxito | |
400 | Entrada inválida | |
401 | No autorizado | |
403 | Prohibido | |
404 | No Encontrado |
Ejemplo 200 respuesta:
{
"fileUrl": "https://nxgen.cloud/file"
}Gracias — sus comentarios llegan al equipo responsable de esta página.