<?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: SHOW-USERS CALL API result empty in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/SHOW-USERS-CALL-API-result-empty/m-p/220468#M8598</link>
    <description>&lt;P&gt;The command&amp;nbsp;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/7"&gt;@PhoneBoy&lt;/a&gt;&amp;nbsp;gave you worked for me. I tested in 2 labs, R81.20 and R82, no problem.&lt;/P&gt;
&lt;P&gt;Andy&lt;/P&gt;</description>
    <pubDate>Fri, 12 Jul 2024 02:11:42 GMT</pubDate>
    <dc:creator>the_rock</dc:creator>
    <dc:date>2024-07-12T02:11:42Z</dc:date>
    <item>
      <title>SHOW-USERS CALL API result empty</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/SHOW-USERS-CALL-API-result-empty/m-p/219905#M8583</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm having some issues with the show-users API call, which returns an empty result, whereas show-domains works fine.&lt;/P&gt;&lt;P&gt;Here's my code:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;    - name: "[MDS] Send POST request to Check Point API for login"
      ansible.builtin.uri:
        url: "https://mdshost.test.local/web_api/login"
        method: "POST"
        headers:
          Content-Type: "application/json"
        body_format: json
        body:
          user: "admin"
          password: "wwwwwww"
        validate_certs: false
      register: _login_query_response
      failed_when: false
      delegate_to: localhost

    - name: "[MDS] Set the session ID for subsequent API calls"
      set_fact:
        _mds_sid: "{{ _login_query_response.json.sid }}"
        _mds_url: "{{ _login_query_response.json.url }}"
      when: _login_query_response.json != {}

    - name: "Send POST request to check If domains"
      ansible.builtin.uri:
        url: "{{ _mds_url }}/show-domains"
        method: "POST"
        headers:
          Content-Type: "application/json"
          X-chkp-sid: "{{ _mds_sid }} "
        body_format: json
        body:
          details-level: standard
        validate_certs: false
        status_code: 200
      ignore_errors: true
      register: _show_domain_response

    - name: "Send POST request to check If users"
      ansible.builtin.uri:
        url: "{{ _mds_url }}/show-users"
        method: "POST"
        headers:
          Content-Type: "application/json"
          X-chkp-sid: "{{ _mds_sid }} "
        body_format: json
        body:
          details-level: full
        validate_certs: false
        status_code: 200
      ignore_errors: true
      register: _show_users_response&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the output when i use ansible-playbook -vvv:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;ok: [test] =&amp;gt; {
    "changed": false,
    "connection": "close",
    "content_type": "application/json",
    "cookies": {},
    "cookies_string": "",
    "date": "Mon, 08 Jul 2024 09:36:20 GMT",
    "elapsed": 0,
    "invocation": {
        "module_args": {
            "attributes": null,
            "body": {
                "details-level": "full"
            },
            "body_format": "json",
            "ca_path": null,
            "client_cert": null,
            "client_key": null,
            "creates": null,
            "dest": null,
            "follow_redirects": "safe",
            "force": false,
            "force_basic_auth": false,
            "group": null,
            "headers": {
                "Content-Type": "application/json",
                "X-chkp-sid": "gergreggrgegrgegr"
            },
            "http_agent": "ansible-httpget",
            "method": "POST",
            "mode": null,
            "owner": null,
            "remote_src": false,
            "removes": null,
            "return_content": false,
            "selevel": null,
            "serole": null,
            "setype": null,
            "seuser": null,
            "src": null,
            "status_code": [
                200
            ],
            "timeout": 30,
            "unix_socket": null,
            "unredirected_headers": [],
            "unsafe_writes": false,
            "url": "https://gergergreg:443/web_api/show-users",
            "url_password": null,
            "url_username": null,
            "use_gssapi": false,
            "use_proxy": true,
            "validate_certs": false
        }
    },
    "json": {
        "objects": [],
        "total": 0
    },
    "msg": "OK (unknown bytes)",
    "redirected": false,
    "server": "Jetty(9.2.9.v20150224)",
    "status": 200,
    "strict_transport_security": "max-age=31536000; includeSubDomains",
    "transfer_encoding": "chunked",
    "url": "https://gerger:443/web_api/show-users",
    "x_forwarded_host_port": "443",
    "x_frame_options": "SAMEORIGIN",
    "x_ua_compatible": "IE=EmulateIE8"
}&lt;/LI-CODE&gt;&lt;P&gt;Did I make an error in my code?&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2024 10:04:21 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/SHOW-USERS-CALL-API-result-empty/m-p/219905#M8583</guid>
      <dc:creator>yoan</dc:creator>
      <dc:date>2024-07-08T10:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: SHOW-USERS CALL API result empty</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/SHOW-USERS-CALL-API-result-empty/m-p/220432#M8596</link>
      <description>&lt;P&gt;Please try making the API call directly (without Ansible).&lt;BR /&gt;mgmt_cli -r true show users&lt;BR /&gt;Documentation:&amp;nbsp;&lt;A href="https://sc1.checkpoint.com/documents/latest/APIs/#cli/show-users~v1.9.1" target="_self"&gt;https://sc1.checkpoint.com/documents/latest/APIs/#cli/show-users~v1.9.1&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2024 17:45:13 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/SHOW-USERS-CALL-API-result-empty/m-p/220432#M8596</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2024-07-11T17:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: SHOW-USERS CALL API result empty</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/SHOW-USERS-CALL-API-result-empty/m-p/220468#M8598</link>
      <description>&lt;P&gt;The command&amp;nbsp;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/7"&gt;@PhoneBoy&lt;/a&gt;&amp;nbsp;gave you worked for me. I tested in 2 labs, R81.20 and R82, no problem.&lt;/P&gt;
&lt;P&gt;Andy&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2024 02:11:42 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/SHOW-USERS-CALL-API-result-empty/m-p/220468#M8598</guid>
      <dc:creator>the_rock</dc:creator>
      <dc:date>2024-07-12T02:11:42Z</dc:date>
    </item>
  </channel>
</rss>

