GCXONEDocumentation

Report Template

On this page
  1. GET /report-templates
  2. Parameters
  3. Responses
  4. POST /report-templates/execute
  5. Request body
  6. Responses
  7. GET /report-templates/{reportTemplateId}
  8. Parameters
  9. Responses

Operations on report template resources. 3 endpoints, each relative to https://api.nxgen.cloud/api/v1 and authenticated as described under Authentication.

GET /report-templates

Get all the report templates

Parameters

Name

In

Type

Required

Description

hierarchyLevel

query

string

yes

Responses

Status

Description

Body

200

Success

400

Invalid input

401

Unauthorized

403

Forbidden

404

Not Found

Example 200 response:

json
{
  "data": [
    {
      "uniqueId": "f8715fd9a65b473580d787a63dca6a5e",
      "type": "HealthReport",
      "serviceProviderIds": [],
      "hierarchyLevel": "site",
      "template": "<!DOCTYPE html>",
      "isActive": true,
      "userLevel": false,
      "cronSchedule": "0 4 * * *",
      "emailSubject": "{{reportName}}",
      "emailBody": "Dear Customer,,<br><br>We hope this message finds you well.<br><br>We are 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."
    }
  ]
}

POST /report-templates/execute

Get report sample based on template

Request body

json
{
  "reportTemplateId": "string",
  "hierarchyId": "string",
  "startTime": "number",
  "endTime": "number",
  "onlySampleData": "boolean"
}

Responses

Status

Description

Body

200

Success

400

Invalid input

401

Unauthorized

403

Forbidden

404

Not Found

Example 200 response:

json
{
  "data": {}
}

GET /report-templates/{reportTemplateId}

Get report template by Id

Parameters

Name

In

Type

Required

Description

reportTemplateId

path

string

yes

Responses

Status

Description

Body

200

Success

400

Invalid input

401

Unauthorized

403

Forbidden

404

Not Found

Example 200 response:

json
{
  "data": {
    "uniqueId": "f8715fd9a65b473580d787a63dca6a5e",
    "type": "HealthReport",
    "serviceProviderIds": [],
    "hierarchyLevel": "site",
    "template": "<!DOCTYPE html>",
    "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"
            }
          ]
        }
      }
    ],
    "emailSubject": "{{reportName}}",
    "emailBody": "Dear Customer,,<br><br>We hope this message finds you well.<br><br>We are 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."
  }
}
Was this page helpful?

Thank you — your feedback goes to the team that owns this page.