The API This API is designed to run reports/report groups by applying the required filters. It returns a unique unique Reference Number that that can be used as a payload for checking report status and downloading reportsto check the status of the report and download the reports/report groups.
Resource URL
POST Method Resource URL: http://localhost:9081/sigma/rest/reports/generate
...
Name | Description | Sample Values | ||||||
action |
| RUN_REPORT, EXEC_REPORT_GROUP | ||||||
reportId |
|
| ||||||
accessToken | Indicates the access token. | sample61d74837-2e77-4ede-a967-2c84b30-dws-b3b4f 7 | ||||||
reportFilter | If filterId is Number or String datatype:
If filterId is Date datatype:
If filterId is Long datatype:
|
|
...
In order to obtain the Report ID log-on to eMACH-Sigma application and right click the report on the left-hand side of the page and click Copy Report ID.
...
Response Parameters are as follows:
Parameter | Type | Description |
replyType | string | For reply type, the report status will be returned as 'SUCCESS' if the running individual report is successful or 'FAILURE' if the report is a failure. |
reportId | string | Generated reports IDs. |
referenceNumber | sting | A unique reference number provided for downloading reports. |
statusCode | int | Code for report status. The response error details for each HTTP code are as follows: |
Anchor | ||||
---|---|---|---|---|
|
Code Block |
---|
{ "headerMap": { "replyType": "SUCCESS", "success": "true", "reportGroupStatus": { "referenceNumber": " sample2djj-6c394d0e-9802-49ae-bdd3-9ccaed431ecd ", "reportGroupId": " AccountTransaction ", "statusCode": 200, "status": "SUCCESS" } } } |
Anchor | ||||
---|---|---|---|---|
|
|
...
Code Block |
---|
username="terrim" password="canvas" resp=$(curl --location --request POST 'http://localhost:9081/sigma/rest/reports/generate-token' \ --header 'Content-Type: application/json' \ --header 'Cookie: JSESSIONID=66582CD7C3C1EEA0711D1DC7ECE8B5E3' \ --data-raw "{ "action":"GENERATE_TOKEN", "authType":"BASIC", "username": $username, "password": $password }") echo $resp responseType=$(echo $resp | jq -r '.headerMap.replyType') atoken=$(echo $resp | jq -r '.headerMap.accessToken') replyType="success" if [ $replyType == $responseType ] then curl --location --request POST 'http://localhost:9081/sigma/rest/reports/generate' \ --header 'Content-Type: application/json' \ --header 'Cookie: JSESSIONID=26233F01ED769AB1485D79AC3421F6C1' \ --data-raw "{ "action": "RUN_REPORT", "reportId": "7bd8091e-c2c3-47a7-a7d4-48ff477ddd28", "accessToken":$atoken }" else echo "The API Authorization failed so we cannot process the request. Kindly check the generate-token payload" fi |
You can also add filters while generating the report by passing "reportFilter" parameter as shown in the following sample code snippet:
|