<?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: gaia API not working for any user in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/gaia-API-not-working-for-any-user/m-p/125719#M6098</link>
    <description>&lt;P&gt;I believe I did not explain correctly what is my issue:&lt;/P&gt;&lt;P&gt;I want to retrieve the routing table and list interfaces of my gateways using REST APIs. I can successfully retrieve the gateways and access policies. I did not find other solution to retrieve the routing table other than:&lt;/P&gt;&lt;P&gt;- run-script: &lt;A href="https://sc1.checkpoint.com/documents/latest/APIs/index.html#cli/run-script~v1.8%20" target="_blank"&gt;https://sc1.checkpoint.com/documents/latest/APIs/index.html#cli/run-script~v1.8%20&lt;/A&gt;&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;- gaia-api commands: &lt;A href="https://sc1.checkpoint.com/documents/latest/APIs/index.html#cli/gaia-api~v1.8%20" target="_blank"&gt;https://sc1.checkpoint.com/documents/latest/APIs/index.html#cli/gaia-api~v1.8%20&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately I could not make them run correctly. If I try the mgmt_cli tool version of run-script - it works just fine. The REST API version not so much - I get a 400 Bad Request, although I perform the same calls as in the example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 04 Aug 2021 15:48:19 GMT</pubDate>
    <dc:creator>Claudiu_Chiriac</dc:creator>
    <dc:date>2021-08-04T15:48:19Z</dc:date>
    <item>
      <title>gaia API not working for any user</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/gaia-API-not-working-for-any-user/m-p/125687#M6092</link>
      <description>&lt;P&gt;On the SMC, I can execute REST API queries, no problem.&lt;/P&gt;&lt;P&gt;However, when I try to execute any gaia api commands, it just does not work:&lt;/P&gt;&lt;P&gt;[Expert@LPACAICSP1:0]# mgmt_cli show hostname --context gaia_api&lt;BR /&gt;Username: admin&lt;BR /&gt;Password:&lt;BR /&gt;code: "generic_error"&lt;BR /&gt;message: "Internal error."&lt;BR /&gt;[Expert@LPACAICSP1:0]#&lt;/P&gt;&lt;P&gt;I'm using the superuser/admin account.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It looks like a authorization issue, but I have setup Blades-&amp;gt;Management API-&amp;gt;Accept API calls from All IP addresses..&lt;/P&gt;&lt;P&gt;[Expert@LPACAICSP1:0]# mgmt_cli login user admin password 'mySuperSecret' --context gaia_api --format json&lt;BR /&gt;{&lt;BR /&gt;"code" : "generic_error",&lt;BR /&gt;"message" : "Error 403. Access to the API server is forbidden. Please check the Management API blade settings to make sure that the server is allowed to accept requests from this IP address."&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;I have tried (wthout success) to add the user admin the right to use gaia api like is says in the gaia api guide here: &lt;A href="https://sc1.checkpoint.com/documents/latest/GaiaAPIs/#api_access~v1.5%20" target="_blank"&gt;https://sc1.checkpoint.com/documents/latest/GaiaAPIs/#api_access~v1.5%20&lt;/A&gt; :&lt;/P&gt;&lt;P&gt;the command executes just fine but nothing happens (since 'access-mechanism API' is not there):&lt;/P&gt;&lt;P&gt;[Expert@LPACAICSP1:0]# gaia_api access --user admin --enable true&lt;BR /&gt;[Expert@LPACAICSP1:0]#&lt;/P&gt;&lt;P&gt;LPACAICSP1&amp;gt; show rba user admin&lt;BR /&gt;User&lt;BR /&gt;admin&lt;BR /&gt;access-mechanism Web-UI&lt;BR /&gt;access-mechanism CLI&lt;BR /&gt;role adminRole&lt;BR /&gt;LPACAICSP1&amp;gt;&lt;/P&gt;&lt;P&gt;If I try to create new users in the Smart Console, they are created there, but I cannot see them with "show rba users".&lt;/P&gt;&lt;P&gt;API status here:&lt;/P&gt;&lt;P&gt;LPACAICSP1&amp;gt; api status&lt;/P&gt;&lt;P&gt;API Settings:&lt;BR /&gt;---------------------&lt;BR /&gt;Accessibility: Require all granted&lt;BR /&gt;Automatic Start: Enabled&lt;/P&gt;&lt;P&gt;Processes:&lt;/P&gt;&lt;P&gt;Name State PID More Information&lt;BR /&gt;-------------------------------------------------&lt;BR /&gt;API Started 21527&lt;BR /&gt;CPM Started 5877 Check Point Security Management Server is running and ready&lt;BR /&gt;FWM Started 3997&lt;BR /&gt;APACHE Started 8197&lt;/P&gt;&lt;P&gt;Port Details:&lt;BR /&gt;-------------------&lt;BR /&gt;JETTY Internal Port: 50276&lt;BR /&gt;APACHE Gaia Port: 443&lt;BR /&gt;Apache port retrieved from: httpd-ssl.conf&lt;/P&gt;&lt;P&gt;Profile:&lt;BR /&gt;------------&lt;BR /&gt;Machine profile: Large SMC env resources profile without SME&lt;BR /&gt;CPM heap size:&lt;BR /&gt;API heap size:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;--------------------------------------------&lt;BR /&gt;Overall API Status: Started&lt;BR /&gt;--------------------------------------------&lt;/P&gt;&lt;P&gt;API readiness test SUCCESSFUL. The server is up and ready to receive connections&lt;/P&gt;&lt;P&gt;Notes:&lt;BR /&gt;------------&lt;BR /&gt;To collect troubleshooting data, please run 'api status -s &amp;lt;comment&amp;gt;'&lt;/P&gt;&lt;P&gt;LPACAICSP1&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[Expert@LPACAICSP1:0]# gaia_api status&lt;/P&gt;&lt;P&gt;API Status:&lt;BR /&gt;---------------------&lt;BR /&gt;Build: cp991255022&lt;BR /&gt;Uptime: 0:49:03.576685&lt;BR /&gt;Current Sessions: 0&lt;BR /&gt;Latest Version: 1.5&lt;/P&gt;&lt;P&gt;Processes:&lt;/P&gt;&lt;P&gt;Name State PID&lt;BR /&gt;---------------------------------&lt;BR /&gt;GAIA_API Started 29357&lt;BR /&gt;GAIA_API_DOCS Started 29356&lt;BR /&gt;APACHE Started 8197&lt;BR /&gt;CONFD Started 8194&lt;BR /&gt;CLISHD Started 25719 24906 21350 8282 1147&lt;BR /&gt;CELERY Started 29354&lt;BR /&gt;REDIS Started 29355&lt;/P&gt;&lt;P&gt;Port Details:&lt;BR /&gt;-------------------&lt;BR /&gt;APACHE Gaia Port: 443&lt;/P&gt;&lt;P&gt;--------------------------------------------&lt;BR /&gt;Overall API Status: Started&lt;BR /&gt;--------------------------------------------&lt;BR /&gt;[Expert@LPACAICSP1:0]#&lt;/P&gt;&lt;P&gt;I have restarted web and gaia api server, no success. Anyone got an idea what to do to make gaia api work?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 12:29:31 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/gaia-API-not-working-for-any-user/m-p/125687#M6092</guid>
      <dc:creator>Claudiu_Chiriac</dc:creator>
      <dc:date>2021-08-04T12:29:31Z</dc:date>
    </item>
    <item>
      <title>Re: gaia API not working for any user</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/gaia-API-not-working-for-any-user/m-p/125709#M6094</link>
      <description>&lt;P&gt;What do you see on&amp;nbsp;&lt;EM&gt;https://&amp;lt;your-Gaia-ip-address&amp;gt;/&lt;/EM&gt;&lt;SPAN&gt;gaia_api&lt;/SPAN&gt;&lt;EM&gt;/ ?&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 14:53:37 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/gaia-API-not-working-for-any-user/m-p/125709#M6094</guid>
      <dc:creator>_Val_</dc:creator>
      <dc:date>2021-08-04T14:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: gaia API not working for any user</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/gaia-API-not-working-for-any-user/m-p/125711#M6095</link>
      <description>&lt;P&gt;Also, did you by any chance changed access to WebUI on this server to specific IP addresses only?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 15:00:47 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/gaia-API-not-working-for-any-user/m-p/125711#M6095</guid>
      <dc:creator>_Val_</dc:creator>
      <dc:date>2021-08-04T15:00:47Z</dc:date>
    </item>
    <item>
      <title>Re: gaia API not working for any user</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/gaia-API-not-working-for-any-user/m-p/125717#M6096</link>
      <description>&lt;P&gt;No, I did not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 15:35:05 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/gaia-API-not-working-for-any-user/m-p/125717#M6096</guid>
      <dc:creator>Claudiu_Chiriac</dc:creator>
      <dc:date>2021-08-04T15:35:05Z</dc:date>
    </item>
    <item>
      <title>Re: gaia API not working for any user</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/gaia-API-not-working-for-any-user/m-p/125718#M6097</link>
      <description>&lt;P&gt;this is the output i get in browser:&lt;/P&gt;&lt;P&gt;{ "code": "generic_err_command_not_found", "errors": "Requested API command: [] not found", "message": "Command Not Found" }&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 15:36:42 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/gaia-API-not-working-for-any-user/m-p/125718#M6097</guid>
      <dc:creator>Claudiu_Chiriac</dc:creator>
      <dc:date>2021-08-04T15:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: gaia API not working for any user</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/gaia-API-not-working-for-any-user/m-p/125719#M6098</link>
      <description>&lt;P&gt;I believe I did not explain correctly what is my issue:&lt;/P&gt;&lt;P&gt;I want to retrieve the routing table and list interfaces of my gateways using REST APIs. I can successfully retrieve the gateways and access policies. I did not find other solution to retrieve the routing table other than:&lt;/P&gt;&lt;P&gt;- run-script: &lt;A href="https://sc1.checkpoint.com/documents/latest/APIs/index.html#cli/run-script~v1.8%20" target="_blank"&gt;https://sc1.checkpoint.com/documents/latest/APIs/index.html#cli/run-script~v1.8%20&lt;/A&gt;&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;- gaia-api commands: &lt;A href="https://sc1.checkpoint.com/documents/latest/APIs/index.html#cli/gaia-api~v1.8%20" target="_blank"&gt;https://sc1.checkpoint.com/documents/latest/APIs/index.html#cli/gaia-api~v1.8%20&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately I could not make them run correctly. If I try the mgmt_cli tool version of run-script - it works just fine. The REST API version not so much - I get a 400 Bad Request, although I perform the same calls as in the example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 15:48:19 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/gaia-API-not-working-for-any-user/m-p/125719#M6098</guid>
      <dc:creator>Claudiu_Chiriac</dc:creator>
      <dc:date>2021-08-04T15:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: gaia API not working for any user</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/gaia-API-not-working-for-any-user/m-p/125720#M6099</link>
      <description>&lt;P&gt;I've found my issue while trying to explain what does not work. It looks like I was performing the login calls as read-only, which is not compatible with running scripts or gaia_api commands.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 15:51:05 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/gaia-API-not-working-for-any-user/m-p/125720#M6099</guid>
      <dc:creator>Claudiu_Chiriac</dc:creator>
      <dc:date>2021-08-04T15:51:05Z</dc:date>
    </item>
    <item>
      <title>Re: gaia API not working for any user</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/gaia-API-not-working-for-any-user/m-p/125756#M6102</link>
      <description>&lt;P&gt;Lol, that would explain it. Thanks for sharing, and I am happy you found the issue root cause and resolved it.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Aug 2021 06:29:43 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/gaia-API-not-working-for-any-user/m-p/125756#M6102</guid>
      <dc:creator>_Val_</dc:creator>
      <dc:date>2021-08-05T06:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: gaia API not working for any user</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/gaia-API-not-working-for-any-user/m-p/125765#M6105</link>
      <description>&lt;P&gt;I spoke too early &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Indeed, I can run-script now, but the gaia-api commands still not working. I get a 404 Not Found error.&lt;/P&gt;&lt;P&gt;I use the example from the documentation here &lt;A href="https://sc1.checkpoint.com/documents/latest/APIs/index.html#web/gaia-api~v1.7%20" target="_blank"&gt;https://sc1.checkpoint.com/documents/latest/APIs/index.html#web/gaia-api~v1.7%20&lt;/A&gt;&lt;/P&gt;&lt;P&gt;#login is successfull&lt;BR /&gt;$URLAnon = "&lt;A href="https://10.171.69.11/web_api/login" target="_blank"&gt;https://10.171.69.11/web_api/login&lt;/A&gt;"&lt;BR /&gt;$headers = @{&lt;BR /&gt;"Content-Type" = "application/json"&lt;BR /&gt;}&lt;BR /&gt;$login = @{&lt;BR /&gt;"user" = $username&lt;BR /&gt;"password" = $password&lt;BR /&gt;"read-only" = "false"&lt;BR /&gt;}&lt;BR /&gt;$login = $login | ConvertTo-Json&lt;BR /&gt;$response = Invoke-RestMethod -Method Post -Headers $headers -Uri $URLAnon -Body $login&lt;BR /&gt;$sid = $response.sid&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#get hostname&lt;/P&gt;&lt;P&gt;$URLAnon = "&lt;A href="https://10.171.69.11/web_api/gaia-api/show-hostname" target="_blank"&gt;https://10.171.69.11/web_api/gaia-api/show-hostname&lt;/A&gt;"&lt;BR /&gt;$headers = @{&lt;BR /&gt;"Content-Type" = "application/json"&lt;BR /&gt;"X-chkp-sid" = $sid&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;$body=@{&lt;BR /&gt;"target" = "10.171.69.11"&lt;BR /&gt;}&lt;BR /&gt;$body = $body | ConvertTo-Json&lt;/P&gt;&lt;P&gt;$response = Invoke-RestMethod -Method Post -Headers $headers -Uri $URLAnon -Body $body&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;Invoke-RestMethod : The remote server returned an error: (404) Not Found&lt;/FONT&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas why?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Aug 2021 08:47:00 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/gaia-API-not-working-for-any-user/m-p/125765#M6105</guid>
      <dc:creator>Claudiu_Chiriac</dc:creator>
      <dc:date>2021-08-05T08:47:00Z</dc:date>
    </item>
  </channel>
</rss>

