Sigma provides a mechanism to generate the configured reports using REST APIs. You can use the Sigma APIs to perform the following operations:
- Generating access tokens for the reports
- Running a report
- Running a group report
- Checking status of a report
- Checking status of a group report
- Downloading generated report
Generating access tokens for the Reports
To use the Sigma Report APIs, you need to generate a personal access token. Access token is like password and you need to keep it confidential. Do not hardcode the access token in your application code.
Sigma enables you to generate tokens for the reports by using API Key or BASIC methodology.
1. Generating access tokens – API Key method
In order to generate access tokens using API key method, it is necessary to provide Client ID and client token details while passing the payload request.
Resource URL
POST Method Resource URL: http://localhost:9081/sigma/rest/reports/generate-token
Query Parameters are as follows:
...
Name
...
Description
...
Sample Values
...
action
...
String indicating the action to be executed. GENERATE_TOKEN is the default action value for generating tokens.
...
GENERATE_TOKEN
...
authType
...
Generating access token method.
...
APIKEY
...
clientId
...
Client ID shared by the team.
...
8HIG1002H6
...
clitentToken
...
Client Token provided by the team for report generation.
...
sample72695bf9-3932-4f60-88b5-2f-2hjd
...
Parameter
...
Type
...
Description
...
replyType
...
string
...
For reply type, the report status will be returned as 'SUCCESS' if generating token is successful or 'FAILURE' if generating token is a failure.
...
accessToken
...
string
...
Access token for using Sigma Report APIs.
Sample Response
Code Block |
---|
{
"headerMap": {
"replyType": "success",
"success": "true",
"accessToken": " sample61d74837-2e77-4ede-a967-2c84b30-dws-b3b4f 7"
}
} |
2. Generating access tokens – BASIC method
...
Name
...
Description
...
Sample Values
...
action
...
String indicating the action to be executed. GENERATE_TOKEN is the default action value for generating tokens.
...
GENERATE_TOKEN
...
authType
...
Generating access token method.
...
BASIC
...
username
...
Provided user name.
...
terrim
...
password
...
Provided password.
...
canvas
...
Parameter
...
Type
...
Description
...
replyType
...
string
...
For reply type, the report status will be returned as 'SUCCESS' if generating token is successful or 'FAILURE' if generating token is a failure.
...
accessToken
...
string
...
Access token for using Sigma Report APIs.
Sample Response
Code Block |
---|
{
"headerMap": {
"replyType": "success",
"success": "true",
"accessToken": " sample61d74837-2e77-4ede-a967-2c84b30-dws-b3b4f 7"
}
} |
Running Individual Reports
...
Name
...
Description
...
Sample Values
...
action
...
String indicating the action to be executed. RUN_REPORT is the default action value for running Sigma reports.
...
RUN_REPORT
...
reportId
...
Indicates the Report ID.
...
sampel0925bccf-29f0-42f2-8896-77c57a-dde-ea2198
...
accessToken
...
Indicates the access token.
...
sample61d74837-2e77-4ede-a967-2c84b30-dws-b3b4f 7
Note |
---|
In order to obtain the Report ID log-on to Sigma application and right click the report on the left-hand side of the page and click Copy Report ID. |
...
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:
200 - Success
204 - Request is successful but the requested data is not available.
400 - Request syntax is incorrect or the parameters supplied were invalid.
401 - Unauthorized API.
500 - Server encountered an unexpected condition, which prevented it from fulfilling the request.
Sample Response
Code Block |
---|
{
"headerMap": {
"replyType": "SUCCESS",
"reportId": " samplejk34-0925bccf-29f0-42f2-8896-77c57aea2198",
"referenceNumber": " sample2djj-6c394d0e-9802-49ae-bdd3-9ccaed431ecd ",
"success": "true",
"statusCode": 200,
"status": "SUCCESS"
}
} |
Running Group Reports
...
Name
...
Description
...
Sample Values
...
action
...
String indicating the action to be executed. EXEC_REPORT_GROUP is the default action value for generating group reports.
...
EXEC_REPORT_GROUP
...
reportId
...
Group Report ID.
...
AccountTransaction
...
accessToken
...
Indicates the access token.
...
sample61d74837-2e77-4ede-a967-2c84b30-dws-b3b4f
...
Parameter
...
Type
...
Description
...
replyType
...
string
...
For reply type, the report status will be returned as 'SUCCESS' if the running group report is successful or 'FAILURE' if the groupreport is a failure.
...
reportGroupId
...
string
...
Generating reports ID.
...
referenceNumber
...
sting
...
A unique reference number provided for downloading group reports.
...
statusCode
...
int
...
Code for report status. The response error details for each HTTP code are as follows:
200 - Success
204 - Request is successful but the requested data is not available.
400 - Request syntax is incorrect or the parameters supplied were invalid.
401 - Unauthorized API.
500 - Server encountered an unexpected condition, which prevented it from fulfilling the request.
Sample Response
Code Block |
---|
{
"headerMap": {
"replyType": "SUCCESS",
"success": "true",
"reportGroupStatus": {
"referenceNumber": " sample2djj-6c394d0e-9802-49ae-bdd3-9ccaed431ecd ",
"reportGroupId": " AccountTransaction ",
"statusCode": 200,
"status": "SUCCESS"
}
}
} |
Checking Individual Report Status
...
Name
...
Description
...
Sample Values
...
action
...
String indicating the action to be executed. REPORT_INSTANCE_STATUS_CHECK is the default action value for checking status for individual reports.
...
REPORT_INSTANCE_STATUS_CHECK
...
referenceNumber
...
Unique number provided as the response for running reports API request.
...
sample2djj-6c394d0e-9802-49ae-bdd3-9ccaed431ecd
...
accessToken
...
Obtained access token as the response for generate token API request.
...
sample61d74837-2e77-4ede-a967-2c84b30-dws-b3b4f
...
Parameter
...
Type
...
Description
...
replyType
...
string
...
For reply type, the report status will be returned as 'SUCCESS' if the report status checking is successful or 'FAILURE' if the report status checking is a failure.
...
reportId
...
string
...
Generating reports ID.
...
reportName
...
sting
...
Name of the report.
...
reportStatus
...
string
...
Provides the report status as 'NOTIFIED' if the report is generated successfully or an error message is displayed.
...
statusCode
...
int
...
Code for report status. The response error details for each HTTP code are as follows:
200 - Success
204 - Request is successful but the requested data is not available.
400 - Request syntax is incorrect or the parameters supplied were invalid.
401 - Unauthorized API.
500 - Server encountered an unexpected condition, which prevented it from fulfilling the request.
Sample Response
Code Block |
---|
{
"headerMap": {
"replyType": "SUCCESS",
"reportId": " samplejk34-0925bccf-29f0-42f2-8896-77c57aea2198",
"reportName": " AccountTransaction ",
"success": "true",
"reportStatus": "NOTIFIED",
"errorCode": "",
"statusCode": "200",
"errorMsg": ""
}
} |
...
You can also add filters while generating the report by passing "reportFilter" parameter as shown in the following sample code snippet:
Code Block |
---|
"reportFilter" : {"filterDef": [
{
"columnId": "ACCOUNT_TYPE", "filterId": "STR_CONTAINS","filterDataType": "string","filterValues": "savings"
}]}
} |
Checking Group Report Status
...
Name
...
Description
...
Sample Values
...
action
...
String indicating the action to be executed. REPORT_GROUP_INSTANCE_STATUS_CHECK is the default action value for checking status for group reports.
...
REPORT_GROUP_INSTANCE_STATUS_CHECK
...
referenceNumber
...
Unique number provided as the response for running group reports API request.
...
sample2djj-6c394d0e-9802-49ae-bdd3-9ccaed431ecd
...
accessToken
...
Obtained access token as the response for generate token API request.
...
sample61d74837-2e77-4ede-a967-2c84b30-dws-b3b4f
...
Parameter
...
Type
...
Description
...
replyType
...
string
...
For reply type, the report status will be returned as 'SUCCESS' if the group reports status checking is successful or 'FAILURE' if the report status checking is a failure.
...
ReferenceNumber
...
string
...
Unique number provided as the response for running group reports API request.
...
reportGroupId
...
string
...
Generating group reports ID.
...
reportName
...
sting
...
Name of the report.
...
reportStatus
...
string
...
Provides the report status as 'NOTIFIED' if the group report is generated successfully or an error message is displayed.
...
statusCode
...
int
...
Code for report status. The response error details for each HTTP code are as follows:
200 - Success
204 - Request is successful but the requested data is not available.
400 - Request syntax is incorrect or the parameters supplied were invalid.
401 - Unauthorized API.
500 - Server encountered an unexpected condition, which prevented it from fulfilling the request.
...
Code Block |
---|
{
"headerMap": {
"reportFailureCount": "0",
"reports": [
{
"reportId": "samplejk34-0925bccf-29f0-42f2-8896-77c57aea2198",
"reportName": " AccountTransaction ",
"reportTitle": "",
"reportStatus": "NOTIFIED",
"errorCode": "",
"reportGroupId": " AccountTransaction ",
"errorMsg": ""
}
],
"replyType": "SUCCESS",
"reportSuccessCount": "1",
"referenceNumber": "sample2djj-6c394d0e-9802-49ae-bdd3-9ccaed431ecd",
"success": "true",
"reportGroupId": " AccountTransaction ",
"noOfReports": "1",
"statusCode": "200"
}
} |
Downloading Reports
...
Name
...
Description
...
Sample Values
...
action
...
String indicating the action to be executed. DOWNLOAD_REPORT is the default action value for downloading the generated individual/group reports.
...
DOWNLOAD_REPORT
...
referenceNumber
...
Unique number provided as the response for running report API request.
...
sample2djj-6c394d0e-9802-49ae-bdd3-9ccaed431ecd
...
accessToken
...
Obtained access token as the response for generate token API request.
...
sample61d74837-2e77-4ede-a967-2c84b30-dws-b3b4f
The report gets generated automatically in Sigma.
Page Tree | ||
---|---|---|
|