BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
niejung
Obsidian | Level 7

I need help!  I had been trying to make a PROC HTTP POST request by passing a JSON message and kept getting 503 service unavailable.  I did the POST request call in postman and worked successfully and data was returned.    I am running in 9.4m3 SAS linux env.

It is using basic authentication to pass security for URL.  url="https://cash-fulfillment-api-sit01.ext-sit.ocp.paasfhlmcnp.com/api/pricing/cash/v1.0/cashWindowAccou..."

 

json_in file format is 

{
  "PricingRequestMetaData": {
    "CorrelationIdentifier": "949cf51d-3689-4d51-966f-8a193fd1487c",
    "RequestTime": "06/18/2020 09:10:10",
    "PricingRequestUserId": "f254202"
  },
  "PricingRequestPayload": {
    "SifmaSettlementDate": "2020-07-27",
    "PriceAsOfDateTime": "2020-05-31 11:59:59",
    "PricingRequestItems": [
      {
        "BenchmarkSecurityProduct": "FHLMC ARM CMS 3/1 2/2/5"
      }
    ]
  }
}

Program Code 

filename json_in "/fmac/dev/cor/cwa/src/ctrl_arm_setting.json";
filename out TEMP;

proc http   
   url="https://cash-fulfillment-api-sit01.ext-sit.ocp.paasfhlmcnp.com/api/pricing/cash/v1.0/cashWindowAccounting" 
   method="POST"
   webusername="xxxxxxxx"
   webpassword="xxxxxxxx"
   in=json_in
   out=out;
run;

data _null_;
   file in; 
   input;
   put _infile_;
   datalines;
   {"name":"value"}
run;

 

1 ACCEPTED SOLUTION

Accepted Solutions
smantha
Lapis Lazuli | Level 10

can you try the following and see if you are able to access the url

 

curl -v -H "Content-Type: application/json" -X POST --data @params.json -u your_username:your_password <url>

View solution in original post

2 REPLIES 2
smantha
Lapis Lazuli | Level 10

can you try the following and see if you are able to access the url

 

curl -v -H "Content-Type: application/json" -X POST --data @params.json -u your_username:your_password <url>
niejung
Obsidian | Level 7
I just learn how to use curl command today from SAS support and found the root cause. Sever side’s certificate expired. Your information is exactly the same I tried. Thank you!!!!

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1019 views
  • 0 likes
  • 2 in conversation