<?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: How do I get a phantom user object from the API? in Splunk SOAR</title>
    <link>https://community.splunk.com/t5/Splunk-SOAR/How-do-I-get-a-phantom-user-object-from-the-API/m-p/554063#M645</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/234988"&gt;@techlord&lt;/a&gt;&amp;nbsp; the API to use to get a playbooks effective_user inside the playbook is &lt;A href="https://docs.splunk.com/Documentation/Phantom/4.10/PlaybookAPI/DataAccessAPI#get_playbook_info" target="_self"&gt;phantom.get_playbook_info()&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This then returns a JSON where the '&lt;STRONG&gt;effective_user&lt;/STRONG&gt;' key will be the ID of the user running the playbook. The out-of-the-box automation account is 2 and admin is 1 so any other number would generally relate to an actual user account running the playbook.&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can have multiple automation accounts but they would only appear with this API if they were used to run the playbook, which is a manual change to the default settings in the playbook settings.&lt;BR /&gt;&lt;BR /&gt;Playbooks can be run under user or automation scope and this API will be able to tell you the ID of the initiator and you can use it for other actions downstream if required, such as dynamically prompting the person who ran the playbook.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 02 Jun 2021 08:15:05 GMT</pubDate>
    <dc:creator>phanTom</dc:creator>
    <dc:date>2021-06-02T08:15:05Z</dc:date>
    <item>
      <title>How do I get a phantom user object from the API?</title>
      <link>https://community.splunk.com/t5/Splunk-SOAR/How-do-I-get-a-phantom-user-object-from-the-API/m-p/484778#M284</link>
      <description>&lt;P&gt;What's the api command to get the current logged-in user &lt;EM&gt;without&lt;/EM&gt; specifying the user id. I want to type &lt;CODE&gt;phantom.get_user()&lt;/CODE&gt; and have the attributes of the logged-in user returned.&lt;/P&gt;</description>
      <pubDate>Sun, 07 Jun 2020 16:25:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-SOAR/How-do-I-get-a-phantom-user-object-from-the-API/m-p/484778#M284</guid>
      <dc:creator>nhammSplunk</dc:creator>
      <dc:date>2020-06-07T16:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get a phantom user object from the API?</title>
      <link>https://community.splunk.com/t5/Splunk-SOAR/How-do-I-get-a-phantom-user-object-from-the-API/m-p/484779#M285</link>
      <description>&lt;P&gt;Within the context of a playbook you can use this to get the user that executed the playbook. This is only effective if a user manually executed the playbook, otherwise it will just return the id of the automation user.&lt;/P&gt;

&lt;P&gt;user_id = phantom.get_effective_user()&lt;/P&gt;

&lt;P&gt;Hopefully that answers your question. Outside of the context of playbook execution, the premise of "the current logged in user" doesn't make any sense. Any number of users could be logged in at any given time.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 05:11:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-SOAR/How-do-I-get-a-phantom-user-object-from-the-API/m-p/484779#M285</guid>
      <dc:creator>phantom_mhike</dc:creator>
      <dc:date>2020-09-30T05:11:16Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get a phantom user object from the API?</title>
      <link>https://community.splunk.com/t5/Splunk-SOAR/How-do-I-get-a-phantom-user-object-from-the-API/m-p/484780#M286</link>
      <description>&lt;P&gt;Thanks!  This is exactly what I needed.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 18:23:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-SOAR/How-do-I-get-a-phantom-user-object-from-the-API/m-p/484780#M286</guid>
      <dc:creator>nhammSplunk</dc:creator>
      <dc:date>2020-04-30T18:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get a phantom user object from the API?</title>
      <link>https://community.splunk.com/t5/Splunk-SOAR/How-do-I-get-a-phantom-user-object-from-the-API/m-p/553955#M644</link>
      <description>&lt;P&gt;Can you point me to documentation for the&amp;nbsp;&lt;U&gt;phantom.get_effective_user()&lt;/U&gt; function? From what was stated in the above solution, it seems safe to assume if an ID(number) is returned by &lt;U&gt;phantom.get_effective_user()&lt;/U&gt;, then the user running the playbook is an automated user, but would like to get confirmation.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jun 2021 19:33:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-SOAR/How-do-I-get-a-phantom-user-object-from-the-API/m-p/553955#M644</guid>
      <dc:creator>techlord</dc:creator>
      <dc:date>2021-06-01T19:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get a phantom user object from the API?</title>
      <link>https://community.splunk.com/t5/Splunk-SOAR/How-do-I-get-a-phantom-user-object-from-the-API/m-p/554063#M645</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/234988"&gt;@techlord&lt;/a&gt;&amp;nbsp; the API to use to get a playbooks effective_user inside the playbook is &lt;A href="https://docs.splunk.com/Documentation/Phantom/4.10/PlaybookAPI/DataAccessAPI#get_playbook_info" target="_self"&gt;phantom.get_playbook_info()&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This then returns a JSON where the '&lt;STRONG&gt;effective_user&lt;/STRONG&gt;' key will be the ID of the user running the playbook. The out-of-the-box automation account is 2 and admin is 1 so any other number would generally relate to an actual user account running the playbook.&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can have multiple automation accounts but they would only appear with this API if they were used to run the playbook, which is a manual change to the default settings in the playbook settings.&lt;BR /&gt;&lt;BR /&gt;Playbooks can be run under user or automation scope and this API will be able to tell you the ID of the initiator and you can use it for other actions downstream if required, such as dynamically prompting the person who ran the playbook.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jun 2021 08:15:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-SOAR/How-do-I-get-a-phantom-user-object-from-the-API/m-p/554063#M645</guid>
      <dc:creator>phanTom</dc:creator>
      <dc:date>2021-06-02T08:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get a phantom user object from the API?</title>
      <link>https://community.splunk.com/t5/Splunk-SOAR/How-do-I-get-a-phantom-user-object-from-the-API/m-p/598563#M825</link>
      <description>&lt;P&gt;Is there a way to map the id number to the user name?&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2022 19:56:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-SOAR/How-do-I-get-a-phantom-user-object-from-the-API/m-p/598563#M825</guid>
      <dc:creator>DanielEhrlich</dc:creator>
      <dc:date>2022-05-19T19:56:05Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get a phantom user object from the API?</title>
      <link>https://community.splunk.com/t5/Splunk-SOAR/How-do-I-get-a-phantom-user-object-from-the-API/m-p/598588#M826</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/246010"&gt;@DanielEhrlich&lt;/a&gt;&amp;nbsp;yes if you pass the ID into /rest/ph_user/&amp;lt;id&amp;gt; it will return a dictionary with all the user information.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2022 22:50:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-SOAR/How-do-I-get-a-phantom-user-object-from-the-API/m-p/598588#M826</guid>
      <dc:creator>phanTom</dc:creator>
      <dc:date>2022-05-19T22:50:29Z</dc:date>
    </item>
  </channel>
</rss>

