<?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: Retrieving Data with REST API in SAS Data Science</title>
    <link>https://communities.sas.com/t5/SAS-Data-Science/Retrieving-Data-with-REST-API/m-p/335820#M5015</link>
    <description>&lt;P&gt;You need SAS Viya .&lt;/P&gt;</description>
    <pubDate>Sat, 25 Feb 2017 06:34:53 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2017-02-25T06:34:53Z</dc:date>
    <item>
      <title>Retrieving Data with REST API</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Retrieving-Data-with-REST-API/m-p/335806#M5014</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;I need to send and receive data using REST API. Can someone help me where should I start at. I am very good at SAS coding, but not familiar with API.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Sat, 25 Feb 2017 05:00:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Retrieving-Data-with-REST-API/m-p/335806#M5014</guid>
      <dc:creator>mlogan</dc:creator>
      <dc:date>2017-02-25T05:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving Data with REST API</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Retrieving-Data-with-REST-API/m-p/335820#M5015</link>
      <description>&lt;P&gt;You need SAS Viya .&lt;/P&gt;</description>
      <pubDate>Sat, 25 Feb 2017 06:34:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Retrieving-Data-with-REST-API/m-p/335820#M5015</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-02-25T06:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving Data with REST API</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Retrieving-Data-with-REST-API/m-p/335843#M5016</link>
      <description>&lt;P&gt;I use PROC HTTP for this. It has all the bells and whistles needed. If you receive json and you have SAS 9.4M4 (the latest maintenance release) you can then you can use the json libname engine to conveniently transform that intake a dataset. Otherwise there are a few alternative suggestions to accomplish that, using Groovy, DS2 or datasatep.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;- Jan.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Feb 2017 08:49:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Retrieving-Data-with-REST-API/m-p/335843#M5016</guid>
      <dc:creator>jklaverstijn</dc:creator>
      <dc:date>2017-02-25T08:49:53Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving Data with REST API</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Retrieving-Data-with-REST-API/m-p/335978#M5017</link>
      <description>Hi Ksharp, Thanks for your suggestion. Can you please tell me why SAS Viya? I hear some people saying PROC HTTP, JSON, DS2. How SAS Viya differ from them? What/How SAS Viya can accomplish better that Base SAS 9.4 can't do? &lt;BR /&gt;&lt;BR /&gt;Thanks,</description>
      <pubDate>Sun, 26 Feb 2017 13:22:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Retrieving-Data-with-REST-API/m-p/335978#M5017</guid>
      <dc:creator>mlogan</dc:creator>
      <dc:date>2017-02-26T13:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving Data with REST API</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Retrieving-Data-with-REST-API/m-p/336050#M5019</link>
      <description>&lt;P&gt;I think the reference to SAS Viya is for the other way: if you need to use REST APIs to access SAS analytics features from other applications, that's where SAS Viya comes in. &amp;nbsp;If you want to use SAS to access other APIs (like Google Analytics, Qualtrics, GitHub, and many others) -- then PROC HTTP provides a robust method.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Feb 2017 22:34:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Retrieving-Data-with-REST-API/m-p/336050#M5019</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2017-02-26T22:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving Data with REST API</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Retrieving-Data-with-REST-API/m-p/336085#M5020</link>
      <description>Hi Chris, All I need to do is retrieve 1000s of records through REST APIs. Analyse the dataset with product "SAS base with Access to ODBC" that I already have. Would you please tell me if I can accomplish my task with the product that I have which can support PROC HTTP and REST APIS? Thanks,</description>
      <pubDate>Mon, 27 Feb 2017 02:15:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Retrieving-Data-with-REST-API/m-p/336085#M5020</guid>
      <dc:creator>mlogan</dc:creator>
      <dc:date>2017-02-27T02:15:55Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving Data with REST API</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Retrieving-Data-with-REST-API/m-p/336178#M5026</link>
      <description>&lt;P&gt;Base SAS has what you need.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are a couple of papers from SAS Global Forum that provide explanations and examples.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/resources/papers/proceedings15/SAS1927-2015.pdf" target="_self"&gt;REST at Ease with SAS®: How to Use SAS to Get Your REST&lt;/A&gt;&amp;nbsp;(2015 SAS Global Forum)&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/resources/papers/proceedings16/SAS6363-2016.pdf" target="_self"&gt;REST at Ease with SAS®: How to Use SAS to Get Your REST&lt;/A&gt;&amp;nbsp;(2016 SAS Global Forum)&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2017 13:07:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Retrieving-Data-with-REST-API/m-p/336178#M5026</guid>
      <dc:creator>M_EEddlestone</dc:creator>
      <dc:date>2017-02-27T13:07:57Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving Data with REST API</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Retrieving-Data-with-REST-API/m-p/431453#M6603</link>
      <description>&lt;P&gt;&lt;img id="robotwink" class="emoticon emoticon-robotwink" src="https://communities.sas.com/i/smilies/16x16_robot-wink.png" alt="Robot wink" title="Robot wink" /&gt;&lt;/P&gt;&lt;P&gt;From what I understand, if you can&amp;nbsp;make&amp;nbsp;the web service call from a single string in a browser, then PROC HTTP can do it...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a really good reference without authentication:&lt;/P&gt;&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sasdummy/2016/12/02/json-libname-engine-sas/&amp;nbsp;" target="_blank"&gt;https://blogs.sas.com/content/sasdummy/2016/12/02/json-libname-engine-sas/&amp;nbsp;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are two examples with authentication:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) Here is a JSON example that uses a token:&lt;/P&gt;&lt;P&gt;/*GET A LIST OF SURVEYS IN JSON FORMAT - This example is for the Qualtrics API*/&lt;BR /&gt;/*Running from BASE 9.4 M5 on Windows PC in Unicode Support - See Qualtrics API documentation for details on calls and formats*/&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;filename response temp encoding="utf-8" lrecl=1000000;&lt;BR /&gt;proc http&lt;BR /&gt;url="https://YOURQUALATRICSACCOUNTHERE/WRAPI/ControlPanel/api.php?Request=getSurveys&amp;amp;User=YOURUSERNAME&amp;amp;Token=YOURTOKEN&amp;amp;Version=2.4&amp;amp;Format=JSON"&lt;BR /&gt;method= "GET"&lt;BR /&gt;out=response;&lt;BR /&gt;run;&lt;BR /&gt;libname SURVEYS JSON fileref=response;&lt;BR /&gt;Data SURVEYS (KEEP= ID NAME STATUS);&lt;BR /&gt;set SURVEYS.ALLDATA;&lt;BR /&gt;Retain ID Name STATUS;&lt;BR /&gt;if P3 = 'ID' then ID = Value;&lt;BR /&gt;if P3 = 'Name' then Name = Value;&lt;BR /&gt;if P3 = 'Status' then do;&lt;BR /&gt;Status = Value;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) This API also can output in XML. To read XML you need to use the SAS XML mapper and refer to the XML file in your script; However, you must have an XML file to map-HaHa...which is probably why JSON is better&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*GET A SURVEY QUESTIONS IN XML FORMAT - I run this from a macro which gets the survey names from a call e.g. EXECUTE('%MACRONAMEHERE(SURVEY)') - Well sort of...see macro documentation for real syntax*/&lt;BR /&gt;filename quest temp encoding="utf-8" lrecl=1000000;&lt;BR /&gt;proc http&lt;BR /&gt;url="https://YOURQUALATRICSACCOUNTHERE/WRAPI/ControlPanel/api.php?Request=getSurvey&amp;amp;User=YOURUSERNAME&amp;amp;Token=YOURTOKEN&amp;amp;Version=2.4&amp;amp;Format=XML&amp;amp;SurveyID=&amp;amp;SURVEY"&lt;BR /&gt;method= "GET"&lt;BR /&gt;out=quest;&lt;BR /&gt;run;&lt;BR /&gt;filename MAP 'C:\YOURPCFOLDER\SURVEYXML.map';&lt;BR /&gt;libname quest xmlv2 xmlmap=MAP;&lt;BR /&gt;data WORK.Question;&lt;BR /&gt;set quest.Question;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;These actually work for me...so this is possible&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- Bread Crumbs and Circuses for all&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2018 20:50:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Retrieving-Data-with-REST-API/m-p/431453#M6603</guid>
      <dc:creator>mich1</dc:creator>
      <dc:date>2018-01-26T20:50:53Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving Data with REST API</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Retrieving-Data-with-REST-API/m-p/577355#M7923</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4"&gt;@ChrisHemedinger&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is using the &lt;STRONG&gt;SAS Viya&lt;/STRONG&gt; the only way of publishing a REST API to let's say trigger a SAS procedure from an external application?&lt;/P&gt;&lt;P&gt;If so, what is the &lt;STRONG&gt;SAS Integration Technologies&lt;/STRONG&gt;&amp;nbsp;for? (&lt;A href="https://www.sas.com/sk_sk/software/integration-technologies.html" target="_blank" rel="nofollow noopener noreferrer"&gt;https://www.sas.com/sk_sk/software/integration-technologies.html&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you know what is the difference between those two in terms of API publishing?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2019 14:07:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Retrieving-Data-with-REST-API/m-p/577355#M7923</guid>
      <dc:creator>smikl</dc:creator>
      <dc:date>2019-07-29T14:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving Data with REST API</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Retrieving-Data-with-REST-API/m-p/577436#M7925</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/283243"&gt;@smikl&lt;/a&gt;&amp;nbsp;No, you don't&amp;nbsp;&lt;STRONG&gt;need&lt;/STRONG&gt; SAS Viya.&amp;nbsp; You can use SAS BI Web Services with stored processes.&amp;nbsp; &lt;A href="http://support.sas.com/kb/60/964.html" target="_self"&gt;See this example&lt;/A&gt;.&amp;nbsp; &lt;A href="https://go.documentation.sas.com/?docsetId=wbsvcdg&amp;amp;docsetTarget=using.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;And the SAS documentation&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2019 16:44:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Retrieving-Data-with-REST-API/m-p/577436#M7925</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2019-07-29T16:44:10Z</dc:date>
    </item>
  </channel>
</rss>

