<?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 Error when using the Python SDK in Email and Collaboration</title>
    <link>https://community.checkpoint.com/t5/Email-and-Collaboration/Error-when-using-the-Python-SDK/m-p/194296#M525</link>
    <description>&lt;P&gt;Hi, all,&lt;/P&gt;&lt;P&gt;I'm trying to use the&amp;nbsp;&lt;A href="https://github.com/travislockman/cp_hec_api_python_sdk/tree/main" target="_self"&gt;&lt;SPAN class=""&gt;cp_hec_api_python_sdk&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN class=""&gt;&amp;nbsp;and I'm getting a strange error. The code:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;CPHEC = CPHEC(ClientID, SecretKey, region)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;&lt;BR /&gt;eventsearchdate = '2023-10-01T09:12:33.001Z'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;eventtypes = ['phishing']&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;eventsearch = CPHEC.event_query(eventsearchdate)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;print(eventsearch)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Returns:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;{'responseEnvelope': {'requestId': '7b81b4d0-c47d-4e49-9e06-346732e8c33d', 'responseCode': 422, 'responseText': '{"detail":[{"loc":["header","x-cloud-sec-scope"],"msg":"string does not match regex \\"^[a-zA-Z\\\\-0-9]+:[a-zA-Z\\\\-0-9]+(,[a-zA-Z\\\\-0-9]+:[a-zA-Z\\\\-0-9]+)*$\\"","type":"value_error.str.regex","ctx":{"pattern":"^[a-zA-Z\\\\-0-9]+:[a-zA-Z\\\\-0-9]+(,[a-zA-Z\\\\-0-9]+:[a-zA-Z\\\\-0-9]+)*$"}},{"loc":["body","request_scope",0],"msg":"string does not match regex \\"^[a-zA-Z\\\\-0-9]+:[a-zA-Z\\\\-0-9]+$\\"","type":"value_error.str.regex","ctx":{"pattern":"^[a-zA-Z\\\\-0-9]+:[a-zA-Z\\\\-0-9]+$"}}]}', 'recordsNumber': 0, 'scrollId': ''}}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Any ideas?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Thu, 05 Oct 2023 09:24:14 GMT</pubDate>
    <dc:creator>eranlif</dc:creator>
    <dc:date>2023-10-05T09:24:14Z</dc:date>
    <item>
      <title>Error when using the Python SDK</title>
      <link>https://community.checkpoint.com/t5/Email-and-Collaboration/Error-when-using-the-Python-SDK/m-p/194296#M525</link>
      <description>&lt;P&gt;Hi, all,&lt;/P&gt;&lt;P&gt;I'm trying to use the&amp;nbsp;&lt;A href="https://github.com/travislockman/cp_hec_api_python_sdk/tree/main" target="_self"&gt;&lt;SPAN class=""&gt;cp_hec_api_python_sdk&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN class=""&gt;&amp;nbsp;and I'm getting a strange error. The code:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;CPHEC = CPHEC(ClientID, SecretKey, region)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;&lt;BR /&gt;eventsearchdate = '2023-10-01T09:12:33.001Z'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;eventtypes = ['phishing']&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;eventsearch = CPHEC.event_query(eventsearchdate)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;print(eventsearch)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Returns:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;{'responseEnvelope': {'requestId': '7b81b4d0-c47d-4e49-9e06-346732e8c33d', 'responseCode': 422, 'responseText': '{"detail":[{"loc":["header","x-cloud-sec-scope"],"msg":"string does not match regex \\"^[a-zA-Z\\\\-0-9]+:[a-zA-Z\\\\-0-9]+(,[a-zA-Z\\\\-0-9]+:[a-zA-Z\\\\-0-9]+)*$\\"","type":"value_error.str.regex","ctx":{"pattern":"^[a-zA-Z\\\\-0-9]+:[a-zA-Z\\\\-0-9]+(,[a-zA-Z\\\\-0-9]+:[a-zA-Z\\\\-0-9]+)*$"}},{"loc":["body","request_scope",0],"msg":"string does not match regex \\"^[a-zA-Z\\\\-0-9]+:[a-zA-Z\\\\-0-9]+$\\"","type":"value_error.str.regex","ctx":{"pattern":"^[a-zA-Z\\\\-0-9]+:[a-zA-Z\\\\-0-9]+$"}}]}', 'recordsNumber': 0, 'scrollId': ''}}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Any ideas?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2023 09:24:14 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Email-and-Collaboration/Error-when-using-the-Python-SDK/m-p/194296#M525</guid>
      <dc:creator>eranlif</dc:creator>
      <dc:date>2023-10-05T09:24:14Z</dc:date>
    </item>
    <item>
      <title>Re: Error when using the Python SDK</title>
      <link>https://community.checkpoint.com/t5/Email-and-Collaboration/Error-when-using-the-Python-SDK/m-p/194416#M527</link>
      <description>&lt;P&gt;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/73225"&gt;@o_OTravis&lt;/a&gt;&amp;nbsp;?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2023 16:11:39 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Email-and-Collaboration/Error-when-using-the-Python-SDK/m-p/194416#M527</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2023-10-06T16:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: Error when using the Python SDK</title>
      <link>https://community.checkpoint.com/t5/Email-and-Collaboration/Error-when-using-the-Python-SDK/m-p/196651#M533</link>
      <description>&lt;P&gt;Any news?&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2023 07:19:42 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Email-and-Collaboration/Error-when-using-the-Python-SDK/m-p/196651#M533</guid>
      <dc:creator>eranlif</dc:creator>
      <dc:date>2023-10-31T07:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: Error when using the Python SDK</title>
      <link>https://community.checkpoint.com/t5/Email-and-Collaboration/Error-when-using-the-Python-SDK/m-p/199601#M538</link>
      <description>&lt;P&gt;In the end, Support suggested that I use the underlying Avanan REST API (&lt;A href="https://www.avanan.com/docs/avanan-smart-api" target="_blank" rel="noopener"&gt;https://www.avanan.com/docs/avanan-smart-api&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;They generated the needed credentials (Client-ID, Client-secret and Host), and now I can interact with HEC using REST calls.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2023 10:11:01 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Email-and-Collaboration/Error-when-using-the-Python-SDK/m-p/199601#M538</guid>
      <dc:creator>eranlif</dc:creator>
      <dc:date>2023-12-04T10:11:01Z</dc:date>
    </item>
  </channel>
</rss>

