I have been reading post on conversion of CURL syntax to PROC HTTP for a while now and cannot crack this one. I am using Base SAS 9.4 TS Level 1M7 on the X64_10PRO platform. (latest version). The follow curl statement works fine: x(curl -i -X POST --header "Content-Type: application/json" --header "Accept: application/json" --header "X-Accellion-Version: 16" --header "Authorization: Bearer &token." -d "{\"notify\": true,\"emails\": [\"croftie@tpg.com.au\"],\"roleId\": 7,\"notifyFileAdded\": false}" "https://pluto.acara.edu.au/rest/folders/100/members"); I've tried mimicking a lot of the code snippets on this site, but as the following attempt suggest, nothing works yet. /* Attempt 1. / filename json_in temp;
data _null_;
file json_in;
put '{';
put '"notify": true,';
put '"emails": [';
put ' "croftie@tpg.com.au"';
put ' ],';
put ' "roleId": 7,';
put ' "notifyFileAdded": false';
put '}';
run;
proc http
method="POST"
url="https://pluto.acara.edu.au/rest/folders/100/members"
ct="application/json"
in="S:\My School QA\2021 Data Collection\SBD_Independents\FTP_Account_Creation\Requests\test1.json"
out=resp;
headers "Authorization"="Bearer &token.";
run;
/* NOTE: 400 Bad Request */ /* Attempt 2. / proc http
url="https://pluto.acara.edu.au/rest/folders/100/members"
method=POST
in = FORM ("notify"="true"
"emails"="[croftie@tpg.com.au]"
"roleID"="7"
"notifyFileAdded"="false");
headers "Authorization"="Bearer &token.";
run;
/* NOTE: 422 Unprocessable Entity */ /* Attempt 3. / proc http
url="https://pluto.acara.edu.au/rest/folders/100/members"
method=POST
in = "{'notify':'true','emails':'['croftie@tpg.com.au'],'roleId':'7','notifyFileAdded':'false'}";
headers "Authorization"="Bearer &token.";
run;
/* NOTE: 422 Unprocessable Entity */ /* Attempt 4. / /* EXTERNAL JSON TEXT FILE CONTAINING: { "notify": true, "emails": [ "croftie@tpg.com.au" ], "roleId": 7, "notifyFileAdded": false } */ proc http
method="POST"
url="https://pluto.acara.edu.au/rest/folders/100/members"
ct="application/json"
in="S:\My School QA\2021 Data Collection\SBD_Independents\FTP_Account_Creation\Requests\test1.json"
out=resp;
headers "Authorization"="Bearer &token.";
run;
/* NOTE: 400 Bad Request */ /* Attempt 5. / proc http
url="https://pluto.acara.edu.au/rest/folders/100/members"
method=POST
in = "notify=true,emails=[croftie@tpg.com.au],roleID=7,notifyFileAdded=false";
headers "Authorization"="Bearer &token.";
run;
/* NOTE: 422 Unprocessable Entity */ Any help would be very gratefully accepted at this stage. Thanks in advance Steve
... View more