Rapport
Sur cette page
- POST /reports
- Corps de la demande
- Réponses
- POST /reports/execute
- Corps de la demande
- Réponses
- POST /reports/filter
- Corps de la demande
- Réponses
- POST /reports/sendEmail
- Corps de la demande
- Réponses
- GET /reports/{reportId}
- Paramètres
- Réponses
- PUT /reports/{reportId}
- Paramètres
- Corps de la demande
- Réponses
- DELETE /reports/{reportId}
- Paramètres
- Réponses
- GET /reports/{reportId}/preview
- Paramètres
- Réponses
Opérations sur les ressources de rapport. 8 points de terminaison, chacun relatif à https://api.nxgen.cloud/api/v1 et authentifié comme décrit sous Authentication.
POST /reports
Ajouter un rapport
Corps de la demande
{
"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"
}Réponses
Statut | Description | Corps |
|---|---|---|
200 | Succès | |
400 | Entrée invalide | |
401 | Non autorisé | |
403 | Interdit | |
404 | Pas trouvé |
Exemple 200 réponse :
{
"result": "reportId"
}POST /reports/execute
Déclencher un rapport ou obtenir des données d’échantillon à utiliser dans le modèle
Corps de la demande
{
"jobId": "string",
"startTime": "number",
"endTime": "number",
"onlySampleData": "boolean",
"cronSchedule": "string",
"jobConfig": {
"any": "string"
}
}Réponses
Statut | Description | Corps |
|---|---|---|
200 | Succès | |
400 | Entrée invalide | |
401 | Non autorisé | |
403 | Interdit | |
404 | Non trouvé |
Exemple 200 réponse :
{
"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
Obtenir la liste des rapports avec filtrage, tri et pagination.
Corps de la demande
Filtrage et tri du rapport
{
"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"
}Réponses
Statut | Description | Corps |
|---|---|---|
200 | Succès | objet |
204 | Pas de contenu | |
400 | Entrée invalide | |
401 | Non autorisé | |
403 | Interdit |
Exemple 200 réponse :
{
"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
Envoyer un courriel
Corps de la demande
{
"subject": "string",
"emailBody": "string",
"emailList": "string",
"type": "string",
"emailAttachment": {
"fileName": "string",
"file": "string"
}
}Réponses
Statut | Description | Corps |
|---|---|---|
200 | Succès | |
400 | Entrée invalide | |
401 | Non autorisé | |
403 | Interdit | |
404 | Pas trouvé | |
500 | Erreur Interne du Serveur |
Exemple 200 réponse:
{
"message": "Accepted for email transfer"
}GET /reports/{reportId}
Obtenir un rapport
Paramètres
Nom | Dans | Type | Obligatoire | Description |
|---|---|---|---|---|
reportId | chemin | chaîne | oui |
Réponses
Statut | Description | Corps |
|---|---|---|
200 | Succès | |
400 | Entrée invalide | |
401 | Non autorisé | |
403 | Interdit | |
404 | Pas trouvé |
Exemple 200 réponse:
{
"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}
Mettre à jour un rapport
Paramètres
Nom | Dans | Type | Obligatoire | Description |
|---|---|---|---|---|
reportId | path | chaîne | oui |
Corps de la demande
{
"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"
}Réponses
Statut | Description | Corps |
|---|---|---|
200 | Succès | |
400 | Entrée invalide | |
401 | Non autorisé | |
403 | Interdit | |
404 | Pas trouvé |
Exemple 200 réponse:
{
"result": "reportId"
}DELETE /reports/{reportId}
Supprimer un rapport
Paramètres
Nom | Dans | Type | Obligatoire | Description |
|---|---|---|---|---|
reportId | path | chaîne | oui |
Réponses
Statut | Description | Corps |
|---|---|---|
200 | Succès | |
400 | Entrée invalide | |
401 | Non autorisé | |
403 | Interdit | |
404 | Pas trouvé |
Exemple 200 réponse:
{
"result": "reportId"
}GET /reports/{reportId}/preview
Aperçu d'un rapport
Paramètres
Nom | Dans | Type | Obligatoire | Description |
|---|---|---|---|---|
reportId | path | string | oui |
Réponses
Statut | Description | Corps |
|---|---|---|
200 | Succès | |
400 | Entrée invalide | |
401 | Non autorisé | |
403 | Interdit | |
404 | Pas trouvé |
Exemple 200 réponse:
{
"fileUrl": "https://nxgen.cloud/file"
}Merci — votre retour est transmis à l’équipe responsable de cette page.