Here is an example of a complex API transaction using SAS and PROC HTTP
/*POST A REQUEST FOR SURVEY DATA*/
/****************************************************************************/
/* Qualtrics API Request to get export of survey response data
/****************************************************************************/
filename rsp temp;
proc http
method= "POST"
in='{"format" : "csv","surveyId" : "yoursurveyID"}'
out=rsp;
headers
"X-API-Token"="yourAPItoken"
"Content-Type"="application/json"
;
run;
libname RSP JSON fileref=rsp;
/*Check Status of request*/
filename dwnld temp;
proc http
method= "GET"
out=dwnld;
headers
"X-API-Token"="yourAPItoken";
run;
libname dwnld JSON fileref=dwnld;
/*Download request - You can view json dwnld for status and filename (same as yourresultID above)*/
filename dwnld '/yourPathHere/GOTDATA';
proc http
method= "GET"
out=dwnld;
headers
"X-API-Token"="yourAPItoken";
run;
Bread Crumbs and Circuses for All