<?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: web-api python in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/web-api-python/m-p/54797#M3544</link>
    <description>Use python sdk from checkpoint &lt;A href="https://github.com/CheckPointSW/cp_mgmt_api_python_sdk" target="_blank"&gt;https://github.com/CheckPointSW/cp_mgmt_api_python_sdk&lt;/A&gt;</description>
    <pubDate>Fri, 31 May 2019 11:44:32 GMT</pubDate>
    <dc:creator>Martin_Valenta</dc:creator>
    <dc:date>2019-05-31T11:44:32Z</dc:date>
    <item>
      <title>web-api python</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/web-api-python/m-p/54785#M3543</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am posting a request in check point using python, but headers having single quote in X-cjkp-sid throws bad requests error. kindly advice how to fix it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;def getsession(s):&lt;BR /&gt;for k,v in t.items():&lt;BR /&gt;if(k=="sid"):&lt;BR /&gt;return v&lt;BR /&gt;import urllib3&lt;BR /&gt;from cpauto.core.sessions import CoreClient&lt;BR /&gt;import json&lt;BR /&gt;urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)&lt;BR /&gt;import requests&lt;BR /&gt;import cpauto&lt;BR /&gt;cc=cpauto.CoreClient('admin','xxxx','xxxx',verify=False)&lt;BR /&gt;r=cc.login()&lt;BR /&gt;#print(r.status_code)&lt;BR /&gt;t=r.json()&lt;BR /&gt;s=getsession(t)&lt;BR /&gt;resource="&lt;A href="https://172.25.11.16:443/web_api/show-access-layer" target="_blank"&gt;https://172.25.11.16:443/web_api/show-access-layer&lt;/A&gt;"&lt;BR /&gt;headers={'Content-Type':'application/json','X-chkp-sid':s}&lt;BR /&gt;print(headers)&lt;/P&gt;&lt;P&gt;output:&lt;/P&gt;&lt;P&gt;{'Content-Type': 'application/json', 'X-chkp-sid': '5kyhI0pmQ7taefuK-kCsC6JWG2DrwbQ7hhFjGYoYpEw'}&lt;/P&gt;&lt;P&gt;Validated the same with "Postman" where single quote in x-chkp-sid is not working.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 May 2019 09:04:28 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/web-api-python/m-p/54785#M3543</guid>
      <dc:creator>rkalidh</dc:creator>
      <dc:date>2019-05-31T09:04:28Z</dc:date>
    </item>
    <item>
      <title>Re: web-api python</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/web-api-python/m-p/54797#M3544</link>
      <description>Use python sdk from checkpoint &lt;A href="https://github.com/CheckPointSW/cp_mgmt_api_python_sdk" target="_blank"&gt;https://github.com/CheckPointSW/cp_mgmt_api_python_sdk&lt;/A&gt;</description>
      <pubDate>Fri, 31 May 2019 11:44:32 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/web-api-python/m-p/54797#M3544</guid>
      <dc:creator>Martin_Valenta</dc:creator>
      <dc:date>2019-05-31T11:44:32Z</dc:date>
    </item>
    <item>
      <title>Re: web-api python</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/web-api-python/m-p/54800#M3545</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Please refer this thread, am facing some error.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/Export-Policy-using-python/m-p/54732#M3533" target="_blank"&gt;https://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/Export-Policy-using-python/m-p/54732#M3533&lt;/A&gt;&lt;/P&gt;&lt;P&gt;kindly advice.&lt;/P&gt;</description>
      <pubDate>Fri, 31 May 2019 12:32:33 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/web-api-python/m-p/54800#M3545</guid>
      <dc:creator>rkalidh</dc:creator>
      <dc:date>2019-05-31T12:32:33Z</dc:date>
    </item>
  </channel>
</rss>

