<?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: PROC HTTP for Google docs in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PROC-HTTP-for-Google-docs/m-p/906127#M357817</link>
    <description>&lt;P&gt;Check out these resources:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://support.sas.com/resources/papers/proceedings12/240-2012.pdf" target="_self"&gt;SGF2021 paper “There’s an App for That”: It’s Called SAS® ODS! Mobile Data Entry and&amp;nbsp;Reporting via SAS ODS&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://communities.sas.com/t5/Ask-the-Expert/How-Do-You-Use-SAS-to-Access-Data-and-APIs-From-the-Web-Q-amp-A/ta-p/699613" target="_self"&gt;How Do You Use SAS® to Access Data and APIs From the Web? Q&amp;amp;A, Slides, and On-Demand Recording&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://developers.google.com/docs/api/how-tos/overview" target="_self"&gt;The Google Docs API &lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 04 Dec 2023 21:19:24 GMT</pubDate>
    <dc:creator>SASJedi</dc:creator>
    <dc:date>2023-12-04T21:19:24Z</dc:date>
    <item>
      <title>PROC HTTP for Google docs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-HTTP-for-Google-docs/m-p/905995#M357786</link>
      <description>&lt;P&gt;Hi All!&lt;/P&gt;
&lt;P&gt;I am running a very simple PROC HTTP to download an Excel spreadsheet from Google docs, and then a subsequent import step to load the data into SAS. I get a "401 Unauthorized" note in my log for the PROC HTTP, and the imported file contains the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Allow Google Sheets access to your necessary cookies&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;You won't be able to access this content if necessary cookies are turned off&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Learn moreAllow cookies&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Sign in to your Google Account&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;You must sign in to access this content&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Sign in&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Can't access your Google Account&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;We can't sign you in when the necessary cookies are turned off&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Learn more&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So I am obviously able to reach the site, but then need to sign in. I have searched and searched on the web for information on how to handle this, but have just been going down rabbit holes. Here is my code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;filename _httpin temp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;proc http&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; url="&lt;A href="https://docs.google.com/spreadsheets/d/1sFshkC35_cY2qwinv1hNHoFjC7u965yhiHV9ga8t9lk/edit?pli=1#gid=503427334" target="_blank"&gt;https://docs.google.com/spreadsheets/d/1sFshkC35_cY2qwinv1hNHoFjC7u965yhiHV9ga8t9lk/edit?pli=1#gid=503427334&lt;/A&gt;"&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; method="get"&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; out=_httpin&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; WEBUSERNAME="&lt;EM&gt;my email&lt;/EM&gt;"&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; WEBPASSWORD='&lt;EM&gt;my google password&lt;/EM&gt;';&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; debug level=3;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;run;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;proc import file=_httpin out=test dbms=csv replace;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; getnames=no;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; datarow=1;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;run;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am able to access the file via my browser, and when I submit the GET method in Postman I get the same output. Please can someone who has successfully downloaded Google docs files provide some assistance?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2023 13:39:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-HTTP-for-Google-docs/m-p/905995#M357786</guid>
      <dc:creator>HeidiDT</dc:creator>
      <dc:date>2023-12-04T13:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: PROC HTTP for Google docs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-HTTP-for-Google-docs/m-p/906127#M357817</link>
      <description>&lt;P&gt;Check out these resources:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://support.sas.com/resources/papers/proceedings12/240-2012.pdf" target="_self"&gt;SGF2021 paper “There’s an App for That”: It’s Called SAS® ODS! Mobile Data Entry and&amp;nbsp;Reporting via SAS ODS&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://communities.sas.com/t5/Ask-the-Expert/How-Do-You-Use-SAS-to-Access-Data-and-APIs-From-the-Web-Q-amp-A/ta-p/699613" target="_self"&gt;How Do You Use SAS® to Access Data and APIs From the Web? Q&amp;amp;A, Slides, and On-Demand Recording&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://developers.google.com/docs/api/how-tos/overview" target="_self"&gt;The Google Docs API &lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2023 21:19:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-HTTP-for-Google-docs/m-p/906127#M357817</guid>
      <dc:creator>SASJedi</dc:creator>
      <dc:date>2023-12-04T21:19:24Z</dc:date>
    </item>
  </channel>
</rss>

