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;
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>
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>
It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.
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.
Ready to level-up your skills? Choose your own adventure.