<?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 How to use Secrets with Python custom code automation in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/How-to-use-Secrets-with-Python-custom-code-automation/m-p/661839#M54669</link>
    <description>&lt;P&gt;How can I access secrets in a python custom code element? The example given is in js...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Jul 2022 09:46:52 GMT</pubDate>
    <dc:creator>anewhubspotuser</dc:creator>
    <dc:date>2022-07-08T09:46:52Z</dc:date>
    <item>
      <title>How to use Secrets with Python custom code automation</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/How-to-use-Secrets-with-Python-custom-code-automation/m-p/661839#M54669</link>
      <description>&lt;P&gt;How can I access secrets in a python custom code element? The example given is in js...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2022 09:46:52 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/How-to-use-Secrets-with-Python-custom-code-automation/m-p/661839#M54669</guid>
      <dc:creator>anewhubspotuser</dc:creator>
      <dc:date>2022-07-08T09:46:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Secrets with Python custom code automation</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/How-to-use-Secrets-with-Python-custom-code-automation/m-p/663258#M54736</link>
      <description>&lt;P&gt;Hey,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/361917"&gt;@anewhubspotuser&lt;/a&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt; Thanks for reaching out. Can you link us to the specific page and example you are referring to, please?&lt;BR /&gt;I found some resources to help get us started:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://legacydocs.hubspot.com/docs/methods/oauth2/refresh-access-token" target="_blank" rel="noopener nofollow noreferrer"&gt;Refresh OAuth 2.0 access token&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://www.jeevangupta.com/getting-started-with-hubspot-api-hubspot-api-key-and-access-token/" target="_blank" rel="noopener nofollow noreferrer"&gt;How to get HubSpot API key and Access Token&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;This post from a community member (thanks &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/144301"&gt;@taran42&lt;/a&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":raising_hands:"&gt;🙌&lt;/span&gt;) covering a similar request —&amp;nbsp;&lt;A href="https://community.hubspot.com/t5/APIs-Integrations/Update-secrets-value-using-custom-code/m-p/656820#M54464" target="_blank" rel="noopener"&gt;Update secrets value using custom code&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Thank you for the additional information! — Jaycee&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2022 22:46:41 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/How-to-use-Secrets-with-Python-custom-code-automation/m-p/663258#M54736</guid>
      <dc:creator>Jaycee_Lewis</dc:creator>
      <dc:date>2022-07-11T22:46:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Secrets with Python custom code automation</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/How-to-use-Secrets-with-Python-custom-code-automation/m-p/663556#M54745</link>
      <description>&lt;P&gt;I am referring to&amp;nbsp;&lt;A href="https://developers.hubspot.com/docs/api/workflows/custom-code-actions#:~:text=Once%20added%2C%20the%20secrets%20will%20be%20available%20as%20environment%20variables%2C%20which%20you%20can%20access%20in%20the%20custom%20code%2C%20as%20shown%20below%3A" target="_blank" rel="noopener"&gt;https://developers.hubspot.com/docs/api/workflows/custom-code-actions#:~:text=Once%20added%2C%20the%20secrets%20will%20be%20available%20as%20environment%20variables%2C%20which%20you%20can%20access%20in%20the%20custom%20code%2C%20as%20shown%20below%3A&lt;/A&gt;&amp;nbsp;. There is only a js example for handling secrets.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2022 11:17:14 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/How-to-use-Secrets-with-Python-custom-code-automation/m-p/663556#M54745</guid>
      <dc:creator>anewhubspotuser</dc:creator>
      <dc:date>2022-07-12T11:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Secrets with Python custom code automation</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/How-to-use-Secrets-with-Python-custom-code-automation/m-p/761062#M61716</link>
      <description>&lt;P&gt;HubSpot has it in their &lt;A href="https://developers.hubspot.com/docs/api/workflows/custom-code-actions" target="_blank" rel="noopener"&gt;documentation&lt;/A&gt; under the Get Started section in the Python code example, but when I used their code it didn't work. I tried the below code and you can access a secret using it.&lt;BR /&gt;&lt;BR /&gt;Replace SECRET_KEY in the code with your own.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import os
from hubspot import HubSpot

def main(event):
  api = os.environ.get('SECRET_KEY')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Feb 2023 17:48:58 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/How-to-use-Secrets-with-Python-custom-code-automation/m-p/761062#M61716</guid>
      <dc:creator>bdithberry</dc:creator>
      <dc:date>2023-02-25T17:48:58Z</dc:date>
    </item>
  </channel>
</rss>

