<?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: Connect to REST API and Get Data From Oracle Cloud Services in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Connect-to-REST-API-and-Get-Data-From-Oracle-Cloud-Services/m-p/611388#M178176</link>
    <description>&lt;P&gt;Sometimes &lt;A href="https://www.getpostman.com/" target="_self"&gt;I use Postman&lt;/A&gt; (free tool for testing/building REST API calls) to build a prototype of the API calls I want -- easier to test and see results outside of SAS.&amp;nbsp; Once that's working, it's easy to transcribe into SAS code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Chris&lt;/P&gt;</description>
    <pubDate>Thu, 12 Dec 2019 16:55:10 GMT</pubDate>
    <dc:creator>ChrisHemedinger</dc:creator>
    <dc:date>2019-12-12T16:55:10Z</dc:date>
    <item>
      <title>Connect to REST API and Get Data From Oracle Cloud Services</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Connect-to-REST-API-and-Get-Data-From-Oracle-Cloud-Services/m-p/611265#M178125</link>
      <description>&lt;P&gt;I'm need to connect to Oracle Cloud Services using a REST API and extract data into a data set.&lt;/P&gt;&lt;P&gt;Does anyone have a code example for this?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2019 12:14:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Connect-to-REST-API-and-Get-Data-From-Oracle-Cloud-Services/m-p/611265#M178125</guid>
      <dc:creator>BillSut</dc:creator>
      <dc:date>2019-12-12T12:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: Connect to REST API and Get Data From Oracle Cloud Services</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Connect-to-REST-API-and-Get-Data-From-Oracle-Cloud-Services/m-p/611283#M178139</link>
      <description>&lt;P&gt;You could try&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC HTTP&lt;/P&gt;
&lt;P&gt;+&lt;/P&gt;
&lt;P&gt;LIBNAME 's&amp;nbsp; JSON engine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4"&gt;@ChrisHemedinger&lt;/a&gt;&amp;nbsp; wrote a couple of blogs about it.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/" target="_blank"&gt;https://blogs.sas.com/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2019 13:13:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Connect-to-REST-API-and-Get-Data-From-Oracle-Cloud-Services/m-p/611283#M178139</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-12-12T13:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: Connect to REST API and Get Data From Oracle Cloud Services</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Connect-to-REST-API-and-Get-Data-From-Oracle-Cloud-Services/m-p/611290#M178142</link>
      <description>&lt;P&gt;Thank you for the response.&amp;nbsp; That is what I'm trying to use but I can't find any examples with a user name and password.&amp;nbsp; These are required for the API that I'm required to use.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2019 13:36:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Connect-to-REST-API-and-Get-Data-From-Oracle-Cloud-Services/m-p/611290#M178142</guid>
      <dc:creator>BillSut</dc:creator>
      <dc:date>2019-12-12T13:36:49Z</dc:date>
    </item>
    <item>
      <title>Re: Connect to REST API and Get Data From Oracle Cloud Services</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Connect-to-REST-API-and-Get-Data-From-Oracle-Cloud-Services/m-p/611296#M178146</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/302431"&gt;@BillSut&lt;/a&gt;&amp;nbsp;- I see you asked this question in another board, but ran into a dead end -- maybe due to your org proxy.&amp;nbsp; PROC HTTP supports PROXY* options that you can use to punch through that -- you might need to get the proper settings from your IT.&amp;nbsp; I recommend &lt;A href="https://blogs.sas.com/content/sasdummy/2018/01/23/check-json-and-http/" target="_self"&gt;you use this standalone test first&lt;/A&gt; to make sure things are working.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In using any REST service with PROC HTTP, I often work backwards by starting with API doc that offers examples in cURL.&amp;nbsp; You can find &lt;A href="https://docs.oracle.com/en/cloud/saas/service/18a/cxsvc/c_osvc_testing_rest_apis.html" target="_self"&gt;some of these for Oracle Cloud Services here&lt;/A&gt;&amp;nbsp;(If I have done my Google searching correctly).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Beginning with this example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt; curl 
     -u service_cloud_user -X GET 
     -H "OSvC-CREST-Application-Context:Retrieve all incidents" 
     https://mysite.example.com/services/rest/connect/v1.4/incidents &lt;/PRE&gt;
&lt;P&gt;The PROC HTTP version would look like:&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;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename resp "path-to-json-response-to-create";

proc http
 method="GET"
 url="https://mysite.example.com/services/rest/connect/v1.4/incidents"
 out=resp
 webusername='service_cloud_user'
 webpassword='your-password'
 /* proxy options if needed */
 /* proxyhost='host' proxyport=8080 */
;
 headers
  "OSvC-CREST-Application-Context"="Retrieve all incidents";
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The result would be a JSON response in the file you specify.&amp;nbsp; You can then use LIBNAME JSON to parse this as data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think it's likely that you won't authenticate with user/password though, and that instead you'll use an auth token.&amp;nbsp; That's pretty standard these days.&amp;nbsp; I see &lt;A href="https://docs.oracle.com/en/cloud/saas/service/18a/cxsvc/c_osvc_authentication_and_authorization.html" target="_self"&gt;Oracle Cloud Services supports a variety of different schemes&lt;/A&gt;.&amp;nbsp; I &lt;A href="https://blogs.sas.com/content/sasdummy/tag/rest-api/" target="_self"&gt;have several examples of using OAuth2-supported services&lt;/A&gt;, including Microsoft Office 365 and Google.&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2019 13:45:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Connect-to-REST-API-and-Get-Data-From-Oracle-Cloud-Services/m-p/611296#M178146</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2019-12-12T13:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: Connect to REST API and Get Data From Oracle Cloud Services</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Connect-to-REST-API-and-Get-Data-From-Oracle-Cloud-Services/m-p/611307#M178156</link>
      <description>&lt;P&gt;Thanks Chris.&amp;nbsp; My Proc HTTP that I've written looks like yours except the header part.&amp;nbsp; It's not working though.&amp;nbsp; I'm new to SAS so this is way over my head.&amp;nbsp; Thanks for your input.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2019 14:03:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Connect-to-REST-API-and-Get-Data-From-Oracle-Cloud-Services/m-p/611307#M178156</guid>
      <dc:creator>BillSut</dc:creator>
      <dc:date>2019-12-12T14:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: Connect to REST API and Get Data From Oracle Cloud Services</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Connect-to-REST-API-and-Get-Data-From-Oracle-Cloud-Services/m-p/611388#M178176</link>
      <description>&lt;P&gt;Sometimes &lt;A href="https://www.getpostman.com/" target="_self"&gt;I use Postman&lt;/A&gt; (free tool for testing/building REST API calls) to build a prototype of the API calls I want -- easier to test and see results outside of SAS.&amp;nbsp; Once that's working, it's easy to transcribe into SAS code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2019 16:55:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Connect-to-REST-API-and-Get-Data-From-Oracle-Cloud-Services/m-p/611388#M178176</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2019-12-12T16:55:10Z</dc:date>
    </item>
  </channel>
</rss>

