Generate Report


Generate a report in multiple formats.

Request Format


POST https://{api-gateway}/report-runtime-service/v1.0/report?action=create

Request Parameters (URI)


Name

Location (Path/Query)

Mandatory/Optional

Data Type

Description

orgId

Query

Mandatory

String

The ID of the organization which the report template belongs to. How to get orgID>>

Request Parameters (Body)


Name

Mandatory/Optional

Data Type

Description

dynamicParameters

Optional

List<Object>

The dynamic parameter.

reportKey

Optional

String

The unique key of the new report template. How to get reportKey>> A report template key must meet these requirements:

  • For a custom report template, its key must be unique in the OU.

  • For a standard report template, its key must be unique across all OUs.

reportId

Optional

String

The ID of the report template. How to get reportId>>

originalId

Optional

String

The ID of the root report template. How to get orgID>>

outputFormat

Optional

String

Use pdf, docx, or xlsx. The default value is pdf.

local

Optional

String

Use zh_CN or en_US. The default value is en_US.


If the report generated this time has synchronized private parameters, you can splice the private parameters in the dynamic parameter list of the interface and generate the report.

Response Parameters


Name

Mandatory/Optional

Data Type

Description

outputFileId

Mandatory

String

The uuid of the output template。

outputFilePath

Mandatory

String

The URL of the output template. Use the value of outputFilePath after decryption.

generateTaskId

Mandatory

String

The operation uuid of the task.

createTime

Optional

String

The generation time of the template. Use the yyyy-MM-dd HH:mm:ss format.

outputFormat

Optional

String

The output format of the template.

validTime

Optional

String

The valid time of the template.

Response Content Type


application/json

Response Codes


See Reporting Tool API Response Codes.

Samples

Request Sample


#requestURI:
POST https://{api-gateway}/report-runtime-service/v1.0/report?orgId=yourOrgId&action=create
#requestBody:
{
    "reportId": "uuid(32)",
     "reportKey": "report key",
     "originalId:"original id",
    "outputFormat": "pdf",
    "locale":"en_US",
    "dynamicParameters": [
        {
            "paramKey": "pointList",
            "paramValue": "SITE.RadiationACC,SITE.ActiveProduction,SITE.FullHour,SITE.TBA_TotalTime"
        },
        {
            "paramKey": "orgId",
            "paramValue": "o15910828289691"
        },
        {
            "paramKey": "mdmIds",
            "paramValue": "c5a29074-2a07-4335-9f29-ba751cd82abf"
        },
        {
            "paramKey": "startTime",
            "paramValue": "2020-01-01"
        },
          {
            "paramKey": "endTime",
            "paramValue": "2020-12-31"
        },
        {
            "paramKey": "token",
            "paramValue": "Bearer APP_PORTAL_S_Fpt5XcjQcVYvutRYTCDCcV5H38BDS442"
        },
        {
            "paramKey": "timeGroup",
            "paramValue": "M"
        }
    ]
}

Response Sample


{
    "msg": "OK",
    "code": 0,
    "data": {
        "outputFileId": "0af6ce63375c6c9f876ac1f9632c1ccc",
        "outputFilePath": "https%3A%2F%2Fenossolarcn.blob.core.chinacloudapi.cn%2Fpdc1%2Fnative-report-system%2Foutput-file%2F20201216%2Fo15891646475831%2Fcd7aac80adf7d0689d603e3c1dfe4480_20201216110211.pdf%3Fsig%3DHSPTm1EnJ6xIXJ2PjrIq7kHLIsDW16a%252FExQqx3%252F8w1w%253D%26st%3D2020-12-16T03%253A02%253A44Z%26se%3D2020-12-23T03%253A02%253A44Z%26sv%3D2019-02-02%26sp%3Dracwdl%26sr%3Db",
        "generateTaskId": "46f0fe02256a5a24b23f7bcf4becd07a",
        "createTime": "2020-12-16 03:00:02",
        "outputFormat": "pdf",
        "validTime": 604800
    }
}


Note

You can find the generated report in the returned outputFilePath.