- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I am making an API call that retrieves a zip file. This was working very nicely when the file was itsy-bitsy. Now it is just tiny and the resulting zip file has nothing in it. I have not changed any code, the zip now just does not contain the one file it should have. My error trap shows I am receiving a 200-ok, so it is not failing there. When I run the exact same API call via Postman it returns with contents as one would expect. What am I missing here?
I am attaching resp.zip which is the result I get from the Postman call and resp(1).zip which is what I am getting from the SAS code below.
%macro testq; %let rootpath=/dcri/cdm/DEV; %include "&rootpath/httperrorcatch.sas"; %let base_url=https://ca1.qualtrics.com; %let logpath=/dcri/cdm/DEV/Qualtrics; filename resp zip "&logpath/resp.zip"; proc http url="&base_url/API/v3/surveys/surveyID/export-responses/fildID/file" method="GET" in='{"format":"json"}' out=resp; HEADERS "x-api-token"="mytoken" "content-type"="application/json"; run; /* catch error */ %prochttp_check_return(code=200,respFile=&logpath/restatus.txt); %mend testq; %testq;
Thanks!
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I had MPRINT on already. Nothing there helped. BUT, I figured out the issue.
I declared the file with this statement:
filename resp zip "&logpath/resp.zip";
The file is a zip but for some reason SAS does not pull it down when it is declared as such. I removed the "zip" keyword and it comes as expected.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Set option MPRINT and rerun the code.
Copy from the log the result and paste the code and all the messages into a code box opened with the </>.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I had MPRINT on already. Nothing there helped. BUT, I figured out the issue.
I declared the file with this statement:
filename resp zip "&logpath/resp.zip";
The file is a zip but for some reason SAS does not pull it down when it is declared as such. I removed the "zip" keyword and it comes as expected.