Generate Report¶
To generate a report in multiple formats based on the report templates.
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)¶
Note
reportId, reportKey, and originalId are all optional, but you must use at least one of the parameters in the request.
Name |
Mandatory/Optional |
Data Type |
Description |
|---|---|---|---|
dynamicParameters |
Optional |
Parameter Struct |
The dynamic parameter. If this parameter is not provided, default parameters will be used. Query template parameters>> |
reportKey |
Optional |
String |
The custom ID of the report template, specified by the caller. How to get reportKey>> |
reportId |
Optional |
String |
The unique ID of each version of the report template, generated when you create or update the report template. How to get reportId>> |
originalId |
Optional |
String |
The original ID of the report template, generated when you create the template. The value of originalId remains unchanged regardless of modifications to the template. How to get originalId>> |
outputFormat |
Optional |
String |
Format of the generated report, can be |
local |
Optional |
String |
Language. Use |
Parameter Struct¶
Name |
Mandatory/Optional |
Data Type |
Description |
|---|---|---|---|
paramKey |
Mandatory |
String |
Parameter name. Query Template Parameter>> |
paramValue |
Mandatory |
String |
The value of paramKey . |
Response Parameters¶
Name |
Data Type |
Description |
|---|---|---|
outputFileId |
String |
The uuid of the output template。 |
outputFilePath |
String |
The encoded URL for retrieving the generated report. Decode the |
generateTaskId |
String |
The operation uuid of the task. |
createTime |
String |
The generation time of the template. |
outputFormat |
String |
The output format of the template. |
validTime |
String |
The valid time of the template. |
Response Content Type¶
application/json
Response Codes¶
Samples¶
Request Sample¶
#requestURI:
POST https://{api-gateway}/report-runtime-service/v1.0/report?orgId=yourOrgId&action=create
#requestBody:
{
"reportId": "ddaa91a6723c9d111758c1cf52b14d8f",
"reportKey": "yourReportKey",
"originalId: "ddaa91a6723c9d111758c1cf52b14d8f",
"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
}
}