<?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 Qualtrics to SAS API in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Qualtrics-to-SAS-API/m-p/537457#M147819</link>
    <description>&lt;DIV&gt;&lt;FONT&gt;&lt;FONT&gt;Hi, I am trying to get qualtrics surveys to read into SAS directly using the PROC HTTP method. I am having trouble getting SAS to destinguish between surveys from qualtrics and call them in, so I moved to R. My R code is below and allows me to call in both surveys into R just fine. However, I need to do this in SAS, so can someone help me translate this into SAS please? I also have my preliminary SAS code below, but it isn't complete or working (seems like there needs to be a way to call each individual survey as well).&amp;nbsp;&lt;FONT&gt;Thank you!&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename response temp encoding="utf-8" lrecl= 1000000;
proc http
url="https://HOSTNAME.ca1.qualtrics.com/WRAPI/ControlPanel/api.php?Request=getSurveys&amp;amp;User=USERID$Token=TOKEN&amp;amp;version=2.4&amp;amp;Format=JSON"
method="GET"
out= response;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;#############R CODE############################&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;&lt;FONT&gt;## qualtRics required (in R CRAN archives)&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;require(qualtRics)&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;# sets path so R knows where to look for my files&lt;BR /&gt;setwd("C/Users/#########PATH##########")&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;# print the current directory&lt;BR /&gt;getwd()&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;## Input appropriate API token and URL&lt;BR /&gt;registerOptions(api_token="TOKEN", root_url="&lt;A href="https://ROOT.ca1.qualtrics.com" target="_blank" rel="noopener"&gt;https://ROOT.ca1.qualtrics.com&lt;/A&gt;")&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;## gets specific surveys&lt;BR /&gt;Survey1&amp;lt;- getSurvey(surveyID = "SURVEYID")&lt;BR /&gt;Survey2&amp;lt;- getSurvey(surveyID ="SURVEYID" )&lt;BR /&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;#########################################&lt;/FONT&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 21 Feb 2019 16:52:37 GMT</pubDate>
    <dc:creator>meckssh0</dc:creator>
    <dc:date>2019-02-21T16:52:37Z</dc:date>
    <item>
      <title>Qualtrics to SAS API</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Qualtrics-to-SAS-API/m-p/537457#M147819</link>
      <description>&lt;DIV&gt;&lt;FONT&gt;&lt;FONT&gt;Hi, I am trying to get qualtrics surveys to read into SAS directly using the PROC HTTP method. I am having trouble getting SAS to destinguish between surveys from qualtrics and call them in, so I moved to R. My R code is below and allows me to call in both surveys into R just fine. However, I need to do this in SAS, so can someone help me translate this into SAS please? I also have my preliminary SAS code below, but it isn't complete or working (seems like there needs to be a way to call each individual survey as well).&amp;nbsp;&lt;FONT&gt;Thank you!&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename response temp encoding="utf-8" lrecl= 1000000;
proc http
url="https://HOSTNAME.ca1.qualtrics.com/WRAPI/ControlPanel/api.php?Request=getSurveys&amp;amp;User=USERID$Token=TOKEN&amp;amp;version=2.4&amp;amp;Format=JSON"
method="GET"
out= response;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;#############R CODE############################&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;&lt;FONT&gt;## qualtRics required (in R CRAN archives)&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;require(qualtRics)&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;# sets path so R knows where to look for my files&lt;BR /&gt;setwd("C/Users/#########PATH##########")&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;# print the current directory&lt;BR /&gt;getwd()&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;## Input appropriate API token and URL&lt;BR /&gt;registerOptions(api_token="TOKEN", root_url="&lt;A href="https://ROOT.ca1.qualtrics.com" target="_blank" rel="noopener"&gt;https://ROOT.ca1.qualtrics.com&lt;/A&gt;")&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;## gets specific surveys&lt;BR /&gt;Survey1&amp;lt;- getSurvey(surveyID = "SURVEYID")&lt;BR /&gt;Survey2&amp;lt;- getSurvey(surveyID ="SURVEYID" )&lt;BR /&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;#########################################&lt;/FONT&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 21 Feb 2019 16:52:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Qualtrics-to-SAS-API/m-p/537457#M147819</guid>
      <dc:creator>meckssh0</dc:creator>
      <dc:date>2019-02-21T16:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: Qualtrics to SAS API</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Qualtrics-to-SAS-API/m-p/537468#M147826</link>
      <description>&lt;P&gt;R is using a package that someone else prebuilt so it's actually masking the work that's being done in that package there. This makes it harder to replicate without looking up the Qualtrics API.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It appears that type of functionality was specifically written by an R user, but not something Qualtrics supports. The Qualtrics API seems to support downloading all responses at once or adding filters, but what happens is:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Request a data download -&amp;gt; qualtrics preps the file&lt;/P&gt;
&lt;P&gt;2. Wait for file to be created&lt;/P&gt;
&lt;P&gt;3. Download file as zip&lt;/P&gt;
&lt;P&gt;4. Unzip file&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is that an approach that will work for you?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://api.qualtrics.com/docs/common-use-case-examples" target="_blank"&gt;https://api.qualtrics.com/docs/common-use-case-examples&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/263269"&gt;@meckssh0&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT&gt;&lt;FONT&gt;Hi, I am trying to get qualtrics surveys to read into SAS directly using the PROC HTTP method. I am having trouble getting SAS to destinguish between surveys from qualtrics and call them in, so I moved to R. My R code is below and allows me to call in both surveys into R just fine. However, I need to do this in SAS, so can someone help me translate this into SAS please? I also have my preliminary SAS code below, but it isn't complete or working (seems like there needs to be a way to call each individual survey as well).&amp;nbsp;&lt;FONT&gt;Thank you!&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename response temp encoding="utf-8" lrecl= 1000000;
proc http
url="https://HOSTNAME.ca1.qualtrics.com/WRAPI/ControlPanel/api.php?Request=getSurveys&amp;amp;User=USERID$Token=TOKEN&amp;amp;version=2.4&amp;amp;Format=JSON"
method="GET"
out= response;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT&gt;#############R CODE############################&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT&gt;&lt;FONT&gt;## qualtRics required (in R CRAN archives)&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT&gt;require(qualtRics)&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT&gt;# sets path so R knows where to look for my files&lt;BR /&gt;setwd("C/Users/#########PATH##########")&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT&gt;# print the current directory&lt;BR /&gt;getwd()&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT&gt;## Input appropriate API token and URL&lt;BR /&gt;registerOptions(api_token="TOKEN", root_url="&lt;A href="https://ROOT.ca1.qualtrics.com" target="_blank" rel="noopener"&gt;https://ROOT.ca1.qualtrics.com&lt;/A&gt;")&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT&gt;## gets specific surveys&lt;BR /&gt;Survey1&amp;lt;- getSurvey(surveyID = "SURVEYID")&lt;BR /&gt;Survey2&amp;lt;- getSurvey(surveyID ="SURVEYID" )&lt;BR /&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT&gt;#########################################&lt;/FONT&gt;&lt;/DIV&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Feb 2019 17:20:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Qualtrics-to-SAS-API/m-p/537468#M147826</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-02-21T17:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: Qualtrics to SAS API</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Qualtrics-to-SAS-API/m-p/538638#M148296</link>
      <description>&lt;P&gt;I appreciate your response. Yes, the zipfile might work, but I am unsure of how to get SAS to run the import as a zipfile. Does it then turn it to XML format or JSON? All the qualtrics code is in Python, so any help with SAS would be much appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 14:52:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Qualtrics-to-SAS-API/m-p/538638#M148296</guid>
      <dc:creator>meckssh0</dc:creator>
      <dc:date>2019-02-26T14:52:17Z</dc:date>
    </item>
    <item>
      <title>Re: Qualtrics to SAS API</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Qualtrics-to-SAS-API/m-p/538699#M148301</link>
      <description>&lt;P&gt;I think the zip file is CSV so that should make it easier to analyze. So once you have the file, you can unzip and read it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This may help you get started:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sasdummy/2015/05/11/using-filename-zip-to-unzip-and-read-data-files-in-sas/?utm_source=feedburner&amp;amp;utm_medium=feed&amp;amp;utm_campaign=Feed%3A+ASasBlogForTheRestOfUs+%28The+SAS+Dummy%29" target="_blank"&gt;https://blogs.sas.com/content/sasdummy/2015/05/11/using-filename-zip-to-unzip-and-read-data-files-in-sas/?utm_source=feedburner&amp;amp;utm_medium=feed&amp;amp;utm_campaign=Feed%3A+ASasBlogForTheRestOfUs+%28The+SAS+Dummy%29&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 16:37:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Qualtrics-to-SAS-API/m-p/538699#M148301</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-02-26T16:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: Qualtrics to SAS API</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Qualtrics-to-SAS-API/m-p/538744#M148313</link>
      <description>&lt;P&gt;These zip files are not read over an API though, right? I need it to be called in over an API.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 18:19:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Qualtrics-to-SAS-API/m-p/538744#M148313</guid>
      <dc:creator>meckssh0</dc:creator>
      <dc:date>2019-02-26T18:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: Qualtrics to SAS API</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Qualtrics-to-SAS-API/m-p/538810#M148355</link>
      <description>&lt;P&gt;My assumption has been that you'd like to get either a refresh of survey responses or new survey responses on a regular schedule and are trying to access the survey responses automatically. Is this correct?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;The proposed approach is the Qualtrics API suggestion, not mine.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would not recommend building something on their old API because at some point they will stop supporting it. That's ultimately your choice, however. At this point, from what I've seen, the Qualtrics API creates a zip file with the requested data and you can download that.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://api.qualtrics.com/docs/common-tasks" target="_blank"&gt;https://api.qualtrics.com/docs/common-tasks&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The zip files are downloaded via the API and then you can read them once they're local.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I recently build something similar using the Statistics Canada 'API' which also downloads ZIP files.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Download file&lt;/P&gt;
&lt;P&gt;2. Store in Work library&lt;/P&gt;
&lt;P&gt;3. Find element name in file&lt;/P&gt;
&lt;P&gt;4. Read file directly from ZIP - no need to unzip in SAS at least&lt;/P&gt;
&lt;P&gt;5. When my SAS session ends, the file will be deleted automatically, or I could have added this to my process.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code for this is here:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://gist.github.com/statgeek/5c8f4e769e898353d7e8115610f5ad5e" target="_blank"&gt;https://gist.github.com/statgeek/5c8f4e769e898353d7e8115610f5ad5e&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;IMO, these aren't great API functions (StatCan or Qualtrics) but it is the reality.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/263269"&gt;@meckssh0&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;These zip files are not read over an API though, right? I need it to be called in over an API.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 21:08:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Qualtrics-to-SAS-API/m-p/538810#M148355</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-02-26T21:08:24Z</dc:date>
    </item>
  </channel>
</rss>

