GCXONEDocumentatie

Rapport

Op deze pagina
  1. POST /reports
  2. Verzoekbody
  3. Responses
  4. POST /reports/execute
  5. Verzoekbody
  6. Responses
  7. POST /reports/filter
  8. Verzoekbody
  9. Responsen
  10. POST /reports/sendEmail
  11. Verzoekbody
  12. Responsen
  13. GET /reports/{reportId}
  14. Parameters
  15. Responsen
  16. PUT /reports/{reportId}
  17. Parameters
  18. Verzoekbody
  19. Responsen
  20. DELETE /reports/{reportId}
  21. Parameters
  22. Responses
  23. GET /reports/{reportId}/preview
  24. Parameters
  25. Responses

Operaties op rapportresources. 8 eindpunten, elk relatief ten opzichte van https://api.nxgen.cloud/api/v1 en geauthenticeerd zoals beschreven onder Authentication.

POST /reports

Voeg een rapport toe

Verzoekbody

json
{
  "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"
}

Responses

Status

Beschrijving

Body

200

Success

400

Ongeldige invoer

401

Niet toegestaan

403

Forbidden

404

Niet gevonden

Voorbeeld 200 respons:

json
{
  "result": "reportId"
}

POST /reports/execute

Activeer een rapport of haal voorbeeldgegevens op die in de sjabloon worden gebruikt

Verzoekbody

json
{
  "jobId": "string",
  "startTime": "number",
  "endTime": "number",
  "onlySampleData": "boolean",
  "cronSchedule": "string",
  "jobConfig": {
    "any": "string"
  }
}

Responses

Status

Beschrijving

Body

200

Success

400

Ongeldige invoer

401

Niet toegestaan

403

Verboden

404

Niet gevonden

Voorbeeld 200 respons:

json
{
  "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

Rapportenlijst ophalen met filteren, sorteren en paginering.

Verzoekbody

Rapportfiltering en sortering

json
{
  "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"
}

Responsen

Status

Beschrijving

Body

200

Succes

object

204

Geen inhoud

400

Ongeldige invoer

401

Niet toegestaan

403

Verboden

Voorbeeld 200 respons:

json
{
  "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

E‑mail verzenden

Verzoekbody

json
{
  "subject": "string",
  "emailBody": "string",
  "emailList": "string",
  "type": "string",
  "emailAttachment": {
    "fileName": "string",
    "file": "string"
  }
}

Responsen

Status

Beschrijving

Body

200

Succes

400

Ongeldige invoer

401

Niet toegestaan

403

Verboden

404

Niet gevonden

500

Interne Server Fout

Voorbeeld 200 respons:

json
{
  "message": "Accepted for email transfer"
}

GET /reports/{reportId}

Rapport ophalen

Parameters

Naam

In

Type

Verplicht

Beschrijving

reportId

pad

string

ja

Responsen

Status

Beschrijving

Body

200

Succes

400

Ongeldige invoer

401

Niet geautoriseerd

403

Verboden

404

Niet gevonden

Voorbeeld 200 respons:

json
{
  "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}

Werk een rapport bij

Parameters

Naam

In

Type

Verplicht

Beschrijving

reportId

path

string

ja

Verzoekbody

json
{
  "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"
}

Responsen

Status

Beschrijving

Body

200

Succes

400

Ongeldige invoer

401

Niet geautoriseerd

403

Verboden

404

Niet gevonden

Voorbeeld 200 respons:

json
{
  "result": "reportId"
}

DELETE /reports/{reportId}

Verwijder een rapport

Parameters

Naam

In

Type

Verplicht

Beschrijving

reportId

path

string

ja

Responses

Status

Beschrijving

Body

200

Succes

400

Ongeldige invoer

401

Niet toegestaan

403

Verboden

404

Niet gevonden

Voorbeeld 200 respons:

json
{
  "result": "reportId"
}

GET /reports/{reportId}/preview

Voorvertoning voor een rapport

Parameters

Naam

In

Type

Verplicht

Beschrijving

reportId

pad

string

ja

Responses

Status

Beschrijving

Body

200

Succes

400

Ongeldige invoer

401

Niet toegestaan

403

Verboden

404

Niet gevonden

Voorbeeld 200respons:

json
{
  "fileUrl": "https://nxgen.cloud/file"
}
Was deze pagina nuttig?

Bedankt — uw feedback gaat naar het team dat deze pagina beheert.