<?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: SAS Proc HTTP call to API Graph.Microsoft. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-Proc-HTTP-call-to-API-Graph-Microsoft/m-p/553706#M153998</link>
    <description>&lt;P&gt;You can accomplish this, but it requires some setup.&amp;nbsp; I've documented the entire process here:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;A href="https://blogs.sas.com/content/sasdummy/2018/11/29/sas-programming-office-365-onedrive/" target="_self"&gt;Using SAS to access and update files on Microsoft OneDrive (Office 365)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've included &lt;A href="https://github.com/sascommunities/sas-dummy-blog/tree/master/onedrive" target="_self"&gt;links to utility macros on GitHub&lt;/A&gt; that can help.&lt;/P&gt;</description>
    <pubDate>Wed, 24 Apr 2019 16:59:21 GMT</pubDate>
    <dc:creator>ChrisHemedinger</dc:creator>
    <dc:date>2019-04-24T16:59:21Z</dc:date>
    <item>
      <title>SAS Proc HTTP call to API Graph.Microsoft.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Proc-HTTP-call-to-API-Graph-Microsoft/m-p/552538#M153595</link>
      <description>&lt;P&gt;on SAS when i run a PROC HTTP for&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A target="_blank" rel="noopener"&gt;https://graph.microsoft.com/v1.0/me/drives/&amp;lt;Drive-ID&amp;gt;/root:/%2FDocuments%2FSkype%20Recordings:/children&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it lists out all the files in the folder and generates a pre-authenticated link. is there a way i can directly use this link to download the file via sas in next proc http call ? I get the following error message.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS : I tired with and without the access token &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS GRID&lt;/P&gt;&lt;P&gt;SAS version :&amp;nbsp;9.04.01M4P110916&lt;/P&gt;&lt;P&gt;SAS server : Linux&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Azure API Permissions :&amp;nbsp;&lt;/P&gt;&lt;DIV class="azc-grid-hierarchical-icon"&gt;Files.ReadWrite.All&lt;/DIV&gt;&lt;DIV class="azc-grid-hierarchical-icon"&gt;&lt;SPAN&gt;User.Read&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="azc-grid-hierarchical-icon"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
SELECT cats("'",_microsoft_graph_downloadUrl,"'") as web_dwnld_Url length=2000
into :_web_dwnld_Url
FROM &amp;nbsp;WORK.SMIJO t1
WHERE Item_Name = "CROSSWALK_GROUPS_TO_INCLUDE v201904.XLS";
QUIT;
&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;filename fileout "%sysfunc(Pathname(Work))/CROSSWALK_GROUPS_TO_INCLUDE v201904.XLS";&lt;BR /&gt;%let _rc = %sysfunc(Fdelete(fileout));&lt;BR /&gt;&lt;BR /&gt;
proc http url=&amp;amp;_web_dwnld_Url.
method='GET' 
out = fileout;
headers "Authorization"="Bearer &amp;amp;access_token." ;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;ERROR: Secure communications error status 807ff019 description "SSL Error: Invalid subject name in partner's certificate. Subject &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;name must match machine name."&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;ERROR: SSL Error: Invalid subject name in partner's certificate. Subject name must match machine name.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;ERROR: Call to tcpSockContinueSSL failed.&lt;/FONT&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>Fri, 19 Apr 2019 20:43:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Proc-HTTP-call-to-API-Graph-Microsoft/m-p/552538#M153595</guid>
      <dc:creator>smijoss1</dc:creator>
      <dc:date>2019-04-19T20:43:25Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Proc HTTP call to API Graph.Microsoft.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Proc-HTTP-call-to-API-Graph-Microsoft/m-p/553706#M153998</link>
      <description>&lt;P&gt;You can accomplish this, but it requires some setup.&amp;nbsp; I've documented the entire process here:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;A href="https://blogs.sas.com/content/sasdummy/2018/11/29/sas-programming-office-365-onedrive/" target="_self"&gt;Using SAS to access and update files on Microsoft OneDrive (Office 365)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've included &lt;A href="https://github.com/sascommunities/sas-dummy-blog/tree/master/onedrive" target="_self"&gt;links to utility macros on GitHub&lt;/A&gt; that can help.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2019 16:59:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Proc-HTTP-call-to-API-Graph-Microsoft/m-p/553706#M153998</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2019-04-24T16:59:21Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Proc HTTP call to API Graph.Microsoft.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Proc-HTTP-call-to-API-Graph-Microsoft/m-p/553733#M154004</link>
      <description>&lt;P&gt;That is the blog i refereed to get till here (THANK YOU For the Blog! the steps were well explained.)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was able to get DriveID , and Item IDs by listing files inside a SP folder (i did find using relative path on URL method more easy as you could skip getting the Drive ID step)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used the same method mentioned on the blog to download the file but its throwing "partner certificate does not match" error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did some search online and most said its because the domain on URL does not match the Machine.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So instead of using the Drive ID and Item-ID &amp;nbsp;I tried to use the Pre-authenticated URL provided by API when i list files from folder.&lt;/P&gt;&lt;P&gt;it works well when i put it into chorme but in SAS it still gives the same&amp;nbsp;"partner certificate does not match".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I raised a support request with SAS as i feel this might me a setup issue on SAS Grid. I will update you on what they say.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far they they directed me to your Blog to read and give the logs accordingly.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2019 17:37:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Proc-HTTP-call-to-API-Graph-Microsoft/m-p/553733#M154004</guid>
      <dc:creator>smijoss1</dc:creator>
      <dc:date>2019-04-24T17:37:12Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Proc HTTP call to API Graph.Microsoft.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Proc-HTTP-call-to-API-Graph-Microsoft/m-p/553735#M154006</link>
      <description>&lt;P&gt;It might be a cert issue with Linux -- I wonder if you might need to try one of the SSL cert-related options.&amp;nbsp; &lt;A href="https://go.documentation.sas.com/?docsetId=proc&amp;amp;docsetTarget=p16n6rig76ssn6n1xqywbwbol6hc.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;See this doc&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2019 17:44:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Proc-HTTP-call-to-API-Graph-Microsoft/m-p/553735#M154006</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2019-04-24T17:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Proc HTTP call to API Graph.Microsoft.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Proc-HTTP-call-to-API-Graph-Microsoft/m-p/554427#M154225</link>
      <description>&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the method mentioned ( i copied the subject name and Serial number from certificate i see in browser )&amp;nbsp;&lt;/P&gt;&lt;P&gt;however SAS did not like it. (screenshot below)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also tried&amp;nbsp;%let SSLCALISTLOC=/gpfsFS2/home/o815539/test_SP_Cert/cert_SP_Cloud_Smijo.pem;&lt;/P&gt;&lt;P&gt;and that too didnt work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 480px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/29074i0936707960D503C7/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i downloaded the Certificates ( as per &lt;A href="http://javamemento.blogspot.com/2015/10/using-curl-with-ssl-cert-chain.html" target="_blank"&gt;http://javamemento.blogspot.com/2015/10/using-curl-with-ssl-cert-chain.html&lt;/A&gt; )&lt;/P&gt;&lt;P&gt;and tried it on my CURL command and it worked without any errors. &amp;nbsp;( without having to use -k or --insecure)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename test pipe 'curl --cacert /gpfsFS2/home/o815539/test_SP_Cert/cert_SP_Cloud_Smijo.pem --url &amp;lt;Download URL&amp;gt; /aim/mmc/mmc_Share/TEMP/smijo.xlsx';&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is there an option in proc Http where i could pass the certificate path ? i tried searching couldnt fine one.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 27 Apr 2019 00:16:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Proc-HTTP-call-to-API-Graph-Microsoft/m-p/554427#M154225</guid>
      <dc:creator>smijoss1</dc:creator>
      <dc:date>2019-04-27T00:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Proc HTTP call to API Graph.Microsoft.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Proc-HTTP-call-to-API-Graph-Microsoft/m-p/554536#M154269</link>
      <description>&lt;P&gt;Are you running SAS with ENCODING=UTF8?&amp;nbsp; That's what I recommend, as the Microsoft API can definitely return data that is not representable in the default latin1/wlatin1 encoding.&amp;nbsp; The error you shared seems to indicate that the data you're getting cannot be transcoded as is...and SAS isn't very tolerant of that.&lt;/P&gt;</description>
      <pubDate>Sat, 27 Apr 2019 23:13:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Proc-HTTP-call-to-API-Graph-Microsoft/m-p/554536#M154269</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2019-04-27T23:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Proc HTTP call to API Graph.Microsoft.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Proc-HTTP-call-to-API-Graph-Microsoft/m-p/559525#M156245</link>
      <description>&lt;P&gt;Enable Implicit Grant for the &amp;nbsp;:/Content URL to redirect to download URL.&amp;nbsp;&lt;/P&gt;&lt;P&gt;without this sas/curl &amp;nbsp;output will only show URL&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/29587i45E1066DD23BCCAB/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2019 00:38:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Proc-HTTP-call-to-API-Graph-Microsoft/m-p/559525#M156245</guid>
      <dc:creator>smijoss1</dc:creator>
      <dc:date>2019-05-17T00:38:03Z</dc:date>
    </item>
  </channel>
</rss>

