<?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: How to use API password and API key in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-API-password-and-API-key/m-p/975606#M378131</link>
    <description>Thank you for the references, I did know of one of them already, but the other two seem promising.</description>
    <pubDate>Tue, 23 Sep 2025 21:02:50 GMT</pubDate>
    <dc:creator>eramirez</dc:creator>
    <dc:date>2025-09-23T21:02:50Z</dc:date>
    <item>
      <title>How to use API password and API key</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-API-password-and-API-key/m-p/975391#M378096</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using the json libname engine with proc http to get data from a secure website.&amp;nbsp; I have the basic code working fine and I have a username and password to access the website, but now I have an API password and API key that I have to use now and can't find any documentation on how to incorporate it.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;filename out "C:\temp";

%let url =https://
%put url = &amp;amp;url;

proc http
url="&amp;amp;url"
method="get" out=out
WEBUSERNAME="&amp;amp;user"
WEBPASSWORD="&amp;amp;PW"
AUTH_BASIC;
run;

libname test JSON fileref=out;
filename mymap "C:\temp\test.map";
........&lt;/PRE&gt;&lt;P&gt;where do I add in the API password and API key or do I need the API password?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sorry if this is basic, but I searched and found a lot of stuff for tokens, which are different than keys from what I read.&amp;nbsp; I read you can add the key to the URL or you can specify it in headers statement.&amp;nbsp; I feel like I'm close just nothing seems to be working.&lt;/P&gt;&lt;P&gt;if you can direct me to any documentation that would be great also.&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Enrique&lt;/P&gt;</description>
      <pubDate>Fri, 19 Sep 2025 20:38:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-API-password-and-API-key/m-p/975391#M378096</guid>
      <dc:creator>eramirez</dc:creator>
      <dc:date>2025-09-19T20:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to use API password and API key</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-API-password-and-API-key/m-p/975399#M378099</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32837"&gt;@eramirez&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have a look at these three papers&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A title="REST at Ease with SAS®: How to Use SAS to Get Your REST" href="https://support.sas.com/resources/papers/proceedings15/SAS1927-2015.pdf" target="_blank" rel="noopener"&gt;REST at Ease with SAS®: How to Use SAS to Get Your REST&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A title="The ABCs of PROC HTTP" href="https://support.sas.com/resources/papers/proceedings19/3232-2019.pdf" target="_blank" rel="noopener"&gt;The ABCs of PROC HTTP&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A title="REST Just Got Easy with SAS® and PROC HTTP" href="https://support.sas.com/resources/papers/proceedings20/4426-2020.pdf" target="_blank" rel="noopener"&gt;REST Just Got Easy with SAS® and PROC HTTP&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;They should have what you are looking for and more&lt;/P&gt;</description>
      <pubDate>Sat, 20 Sep 2025 02:13:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-API-password-and-API-key/m-p/975399#M378099</guid>
      <dc:creator>AhmedAl_Attar</dc:creator>
      <dc:date>2025-09-20T02:13:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to use API password and API key</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-API-password-and-API-key/m-p/975480#M378127</link>
      <description>&lt;P&gt;If your API uses OAuth2 style tokens, you can use the special&amp;nbsp;&lt;STRONG&gt;oath_bearer&lt;/STRONG&gt;= option on PROC HTTP with your token. It's basically shorthand for "Authorization: Bearer&amp;nbsp;&lt;EM&gt;your-oauth-token&lt;/EM&gt;" in the HTTP header.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ex:&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;proc http url= "your-api-call"
     method="GET"
     out=resp
     oauth_bearer="&amp;amp;access_token";
run;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For other token styles that use HTTP headers, use the HEADERS statement in PROC HTTP. It uses a name-value pair syntax like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;    proc http
      url="https://your-api-query"  
      method="GET"
      out=resp
    ;
      headers 
        "Authorization"="Bearer &amp;amp;authtoken." 
        "session-key"="&amp;amp;sessionkey." ;
    run;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Sep 2025 13:22:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-API-password-and-API-key/m-p/975480#M378127</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2025-09-22T13:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to use API password and API key</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-API-password-and-API-key/m-p/975606#M378131</link>
      <description>Thank you for the references, I did know of one of them already, but the other two seem promising.</description>
      <pubDate>Tue, 23 Sep 2025 21:02:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-API-password-and-API-key/m-p/975606#M378131</guid>
      <dc:creator>eramirez</dc:creator>
      <dc:date>2025-09-23T21:02:50Z</dc:date>
    </item>
  </channel>
</rss>

