Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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 reports/group 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

  • Indicates the Report ID.

Note

While generating the (RUN_REPORT) reports, the Report ID is mandatory, while the Group Report ID is optional.

Info

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.

  • Group Report ID.

Note

While generating the (EXEC_REPORT_GROUP) report groups, a Group Report ID is mandatory.

  • sampel0925bccf-29f0-42f2-8896-77c57a-dde-ea2198

  • AccountTransaction

accessToken

Indicates the access token.

sample61d74837-2e77-4ede-a967-2c84b30-dws-b3b4f 7

reportFilter

If filterId is Number or String datatype:

  • For Contains operator use STR_CONTAINS

  • For in operator use STR_IN

  • For Equals operator use STR_EQUALS

If filterId is Date datatype:

  • For Equals Timestamp operator use TDT_EQUALS

  • For Equals operator use TDT_EQUALS_DATE

  • For Financial Year operator use TDT_FINANCIAL_YEAR

  • For Financial Year (w) Quarter operator use TDT_FINANCIAL_YEAR_QUARTER

  • For Greater than operator use TDT_GT

  • For Greater than or Equal to operatoruse TDT_GTEQUALTO

  • For Less than operator use TDT_LT

  • For Less than or Equal to operator use TDT_LTEQUALTO

  • For From operator use TDT_RANGE

  • For Relative Range operator use TDT_RELATIVE_RANGE

  • For YTD operator use TDT_YTD

If filterId is Long datatype:

  • For < operator use NUM_LONG_LT

  • For <= operator use NUM_LONG_LTEQUALTO

  • For != operator use NUM_LONG_NOTEQUALTO

  • For = operator use NUM_LONG_EQUALS

  • For > operator use NUM_LONG_GT

  • For >= operator use NUM_LONG_GTEQUALTO

Code Block
"reportFilter" : {         

"preHookParams":{"NAME":["SIGMA"]},"procedureParams":{"NAME":["SIGMA"]},"additionalParams":{"ADD_INP":["DEMO1"]}, "bindParams":{"NAME":["DEMO1"]}, "filterDef": [{"columnId": "ACCOUNT_TYPE", "filterId": "STR_CONTAINS","filterDataType": "string"     ,"filterValues": "savings","filterDescriptions":"savings"}]        

 }

...

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:

Code Block
"reportFilter" : {"filterDef": [
{
"columnId": "ACCOUNT_TYPE", "filterId": "STR_CONTAINS","filterDataType": "string","filterValues": "savings"
}]}
}