<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to send JSON request using SAS BI WEB services in Administration and Deployment</title>
    <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-send-JSON-request-using-SAS-BI-WEB-services/m-p/835652#M25138</link>
    <description>&lt;P&gt;We've never deployed or recommended BIWS so I can't answer your question, however I can let you know about an alternative option that may / may not be helpful in your situation (if neither regular Stored Processes nor Viya are amenable options):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://server.sasjs.io" target="_blank"&gt;https://server.sasjs.io&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is an MIT open source REST API, with session manager, over Foundation SAS.&amp;nbsp; Works perfectly with Postman and any other client you can think of.&amp;nbsp; And if there's something missing, you can of course fork the project and add any features yourself.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Disclosure - it's a product built by &lt;A href="https://sasapps.io" target="_self"&gt;my team&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Sep 2022 15:42:59 GMT</pubDate>
    <dc:creator>AllanBowe</dc:creator>
    <dc:date>2022-09-28T15:42:59Z</dc:date>
    <item>
      <title>How to send JSON request using SAS BI WEB services</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-send-JSON-request-using-SAS-BI-WEB-services/m-p/835569#M25137</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;I have created a stored process with input and output parameters that I'm trying to call using SAS BI Web Services. See the SAS stp code below:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;*ProcessBody; 
 
%global BANK 
        CALCULATIONTYPE 
        COMPANYID 
        CUSTOMERID 
        MODELCODE 
        PREVIOUSCALCULATIONDATE 
        PREVIOUSEXPECTEDLOSS 
        PREVIOUSLOSSGIVENDEFAULT 
        PREVIOUSPROBABILITYOFDEFAULT 
        QUESTIONNAIREGRADE; 
 
%STPBEGIN; 
 
*  End EG generated code (do not edit this line); 
 
 
proc printto log=" D:\RiskModels\RestLogs\web_service_test_%sysfunc(today(),yymmdd10.)-%sysfunc(compress(%sysfunc(time( ),time.),":")).log";
   run;

libname srcdata "D:\RiskModels\SourceData";

proc sql noprint;
select distinct Client_LGD format=16.8 into :lgd from srcdata.lgd_table where 
ID =&amp;amp;customerID;
quit;

%let probabilityOfDefault=0.5;
%let lossGivenDefault = &amp;amp;lgd;
%let expectedLoss = %sysevalf(&amp;amp;lgd. * &amp;amp;probabilityOfDefault.);
%let commentCodes = 1,2,3;


*  Begin EG generated code (do not edit this line); 
;*';*";*/;quit; 
%STPEND; 
 
*  End EG generated code (do not edit this line); &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using Postman to call the stored process in POST method. My endpoint is (I omitted the server name for this example):&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://server:443/SASBIWS/json/storedProcesses/RiskModels/web_test1" target="_blank" rel="noopener"&gt;https://server:443/SASBIWS/json/storedProcesses/RiskModels/web_service_test&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The format of the request is JSON. See an example of a request below:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;Body:{"bank":"bank_name","customerID":"12345678","companyID":"12345678","calculationType":"1","modelCode":"111","questionnaireGrade":70.5,"previousCalculationDate":"2022-08-09","previousProbabilityOfDefault":0.6,"previousLossGivenDefault":0.5,"previousExpectedLoss":0.3}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I'm sending the JSON request with the header: "&lt;SPAN&gt;Content-Type:&amp;nbsp;application/json "&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;the response is: "&lt;/SPAN&gt;&lt;SPAN&gt;HTTP&amp;nbsp;Status&amp;nbsp;415&amp;nbsp;–&amp;nbsp;Unsupported&amp;nbsp;Media&amp;nbsp;Type".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My request never reaches the storedprocess server, it gets an error from the webserver.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="inherit"&gt;So I guess my question is: What is the correct way to call SASBIWS in POST &lt;/FONT&gt;method&lt;FONT face="inherit"&gt;&amp;nbsp;using a JSON request.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Thank you very much,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Nufar.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2022 10:43:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-send-JSON-request-using-SAS-BI-WEB-services/m-p/835569#M25137</guid>
      <dc:creator>NY</dc:creator>
      <dc:date>2022-09-28T10:43:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to send JSON request using SAS BI WEB services</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-send-JSON-request-using-SAS-BI-WEB-services/m-p/835652#M25138</link>
      <description>&lt;P&gt;We've never deployed or recommended BIWS so I can't answer your question, however I can let you know about an alternative option that may / may not be helpful in your situation (if neither regular Stored Processes nor Viya are amenable options):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://server.sasjs.io" target="_blank"&gt;https://server.sasjs.io&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is an MIT open source REST API, with session manager, over Foundation SAS.&amp;nbsp; Works perfectly with Postman and any other client you can think of.&amp;nbsp; And if there's something missing, you can of course fork the project and add any features yourself.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Disclosure - it's a product built by &lt;A href="https://sasapps.io" target="_self"&gt;my team&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2022 15:42:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-send-JSON-request-using-SAS-BI-WEB-services/m-p/835652#M25138</guid>
      <dc:creator>AllanBowe</dc:creator>
      <dc:date>2022-09-28T15:42:59Z</dc:date>
    </item>
  </channel>
</rss>

