Hi,
I'm trying to call the SAS API via Postman after publishing a simple decision flow and I wish to test the how a data grid variable is communicated upon sending a request.
1. I created input and output variables with their corresponding data type, on which SubProduct variable is a data grid.
2. Then I created a simple ruleset to count the records inside the data grid. If there is more than 1 record, then Decision = "No", else Decision = "Yes":
3. I have published and validated the simple flow. And got the expected outputs:
a. Data Grid value from output variable -> DECISION = "No":
b. Data Grid value from output variable -> DECISION = "Yes:
4. I have now copied the published URL to postman and set up the JSON request body for Item 3a.
{ "inputs":[ { "name":"ID_", "value":"A1" }, { "name":"PRODUCTID_", "value":"car1" }, { "name":"SUBPRODUCT_", "value": [ { "metadata": [ { "SP_ID": "string" }, { "COLOR": "string" }, { "VALIDITYDATE": "string" } ] }, { "data": [ [ "10001", "BLUE", "09272022" ], [ "10002", "PINK", "09262022" ] ] } ] } ] }
5. Upon sending the request, this is the response/error that I got.
{ "errorCode": 0, "message": "Cannot execute the step \"execute_skel\" of the module \"sub_flow_dg1_0\".", "details": [ "traceId: 3aaf89e6bbb63491", "path: /microanalyticScore/modules/sub_flow_dg1_0/steps/execute_skel", "Cannot assign the value [{metadata=[{SP_ID=string}, {COLOR=string}, {VALIDITYDATE=string}]}, {data=[[10001, BLUE, 09272022], [10002, PINK, 09262022]]}] to the parameter \"\"SubProduct_\"\" of type string." ], "links": [], "version": 2, "httpStatusCode": 400 }
I am confused on why I did not get the expected output as I did from Item 3 once I did the testing in runtime environment. Any thoughts on why this is happening? Thanks in advance!
Thanks @alexal, the URL worked. Great help!
I am wondering if this is the default template expected for the URL?
I only got the one with "_skel" from the path given from the published code of the decision flow (Scoring tab -> Publishing Validation -> Code):
I thought I had to depend on the URL here, from /microanalyticScore/..., but apparently _skel should be removed as well when testing via Postman.
Yes, unless you want to execute a specific step https://developer.sas.com/apis/rest/DecisionManagement/#operations-4
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!