<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: API zip file is empty in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/API-zip-file-is-empty/m-p/679008#M205031</link>
    <description>&lt;P&gt;Set option MPRINT and rerun the code.&lt;/P&gt;
&lt;P&gt;Copy from the log the result and paste the code and all the messages into a code box opened with the &amp;lt;/&amp;gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 24 Aug 2020 22:25:13 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2020-08-24T22:25:13Z</dc:date>
    <item>
      <title>API zip file is empty</title>
      <link>https://communities.sas.com/t5/SAS-Programming/API-zip-file-is-empty/m-p/678997#M205029</link>
      <description>&lt;P&gt;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?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;%macro testq;
	%let rootpath=/dcri/cdm/DEV;
	%include "&amp;amp;rootpath/httperrorcatch.sas";
	%let base_url=https://ca1.qualtrics.com;
	%let logpath=/dcri/cdm/DEV/Qualtrics;
	filename resp zip "&amp;amp;logpath/resp.zip";

	proc http
		url="&amp;amp;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=&amp;amp;logpath/restatus.txt);
%mend testq;

%testq;&lt;/PRE&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 24 Aug 2020 20:40:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/API-zip-file-is-empty/m-p/678997#M205029</guid>
      <dc:creator>evaleah</dc:creator>
      <dc:date>2020-08-24T20:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: API zip file is empty</title>
      <link>https://communities.sas.com/t5/SAS-Programming/API-zip-file-is-empty/m-p/679008#M205031</link>
      <description>&lt;P&gt;Set option MPRINT and rerun the code.&lt;/P&gt;
&lt;P&gt;Copy from the log the result and paste the code and all the messages into a code box opened with the &amp;lt;/&amp;gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Aug 2020 22:25:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/API-zip-file-is-empty/m-p/679008#M205031</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-08-24T22:25:13Z</dc:date>
    </item>
    <item>
      <title>Re: API zip file is empty</title>
      <link>https://communities.sas.com/t5/SAS-Programming/API-zip-file-is-empty/m-p/679145#M205072</link>
      <description>&lt;P&gt;I had MPRINT on already. Nothing there helped. BUT, I figured out the issue.&lt;/P&gt;&lt;P&gt;I declared the file with this statement:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;filename resp zip "&amp;amp;logpath/resp.zip";&lt;/PRE&gt;&lt;P&gt;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.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2020 13:25:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/API-zip-file-is-empty/m-p/679145#M205072</guid>
      <dc:creator>evaleah</dc:creator>
      <dc:date>2020-08-25T13:25:28Z</dc:date>
    </item>
  </channel>
</rss>

