<?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 to use demisto-api-download in a Automation in Cortex XSOAR Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/how-to-use-demisto-api-download-in-a-automation/m-p/503682#M969</link>
    <description>&lt;P&gt;It sounds like you're looking for a file upload command/integration, like:&lt;/P&gt;&lt;P&gt;SMB:&amp;nbsp;&lt;A href="https://xsoar.pan.dev/docs/reference/integrations/server-message-block-smb-v2#smb-upload" target="_self"&gt;https://xsoar.pan.dev/docs/reference/integrations/server-message-block-smb-v2#smb-upload&lt;/A&gt; or&lt;/P&gt;&lt;P&gt;SCP:&amp;nbsp;&lt;A href="https://xsoar.pan.dev/docs/reference/integrations/remote-access-v2#copy-to" target="_blank"&gt;https://xsoar.pan.dev/docs/reference/integrations/remote-access-v2#copy-to&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Uploading to a cloud file store and then syncing to your local server is also a potential option depending on what you're looking for. For that an integration like Azure File store&amp;nbsp;&lt;A href="https://xsoar.pan.dev/docs/reference/integrations/azure-storage-file-share#azure-storage-fileshare-file-create" target="_blank"&gt;https://xsoar.pan.dev/docs/reference/integrations/azure-storage-file-share#azure-storage-fileshare-file-create&lt;/A&gt;&amp;nbsp;or Google Drive&amp;nbsp;&lt;A href="https://xsoar.pan.dev/docs/reference/integrations/google-drive#google-drive-file-upload" target="_blank"&gt;https://xsoar.pan.dev/docs/reference/integrations/google-drive#google-drive-file-upload&lt;/A&gt;&amp;nbsp;would do what you need.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 15 Jun 2022 00:45:16 GMT</pubDate>
    <dc:creator>chrking</dc:creator>
    <dc:date>2022-06-15T00:45:16Z</dc:date>
    <item>
      <title>how to use demisto-api-download in a Automation</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/how-to-use-demisto-api-download-in-a-automation/m-p/503236#M954</link>
      <description>&lt;P&gt;I am trying to use the built in demisto-api-download autmation to download a file from our hosted xsoar instance&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am struggling to figure out how to format my command in the automation. From the documentation these are the inputs :&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Arguments Description&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;DIV&gt;uri&lt;/DIV&gt;&lt;/TD&gt;&lt;TD&gt;Request URI&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;DIV&gt;filename&lt;/DIV&gt;&lt;/TD&gt;&lt;TD&gt;File name of download&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;DIV&gt;description&lt;/DIV&gt;&lt;/TD&gt;&lt;TD&gt;Description of file entry&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;demisto.executeCommand("demisto-api-download", {"uri":""})&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would imagine I need to input my API key, but am not sure how to enter it using this command&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any assistance with how to use this to download a file from an incident?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2022 23:07:49 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/how-to-use-demisto-api-download-in-a-automation/m-p/503236#M954</guid>
      <dc:creator>kbratt</dc:creator>
      <dc:date>2022-06-13T23:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: how to use demisto-api-download in a Automation</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/how-to-use-demisto-api-download-in-a-automation/m-p/503271#M957</link>
      <description>&lt;P&gt;I'm a little concerned that&amp;nbsp;&lt;SPAN&gt;demisto-api-download isn't what you're expecting. The&amp;nbsp;demisto-api-download will download a response from the API endpoint and save it as an artifact in the war room of the current incident. It won't download the response to your browser automatically, although you can download the saved artifact manually.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only thing you have to provide for this command is the URL path. The API key is configured within the "Demisto REST API" integration instance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's an example of what that looks like. In this example we send a post request to generate a CSV export of incident data, then download the results.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;post_result = demisto.executeCommand("demisto-api-post", 
    {"uri":"/incident/batch/exportToCsv", 
    "body":"{\"all\":true,\"columns\":[\"name\"],\"filter\":{}}"})
filename = post_result[0]['Contents']['response']
res = demisto.executeCommand("demisto-api-download", 
    {"uri":"/incident/csv/{}".format(filename)})&lt;/LI-CODE&gt;&lt;P&gt;The end result is an entry like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="chrking_0-1655167917170.png" style="width: 400px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/41769i32CD03905DD39CCD/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="chrking_0-1655167917170.png" alt="chrking_0-1655167917170.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope that helps.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2022 00:53:35 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/how-to-use-demisto-api-download-in-a-automation/m-p/503271#M957</guid>
      <dc:creator>chrking</dc:creator>
      <dc:date>2022-06-14T00:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: how to use demisto-api-download in a Automation</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/how-to-use-demisto-api-download-in-a-automation/m-p/503298#M960</link>
      <description>&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/213246"&gt;@kbratt&lt;/a&gt;, I think you might need to explain your use case again and in more detail.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;1. Do you want to download a file that is stored somewhere (Linux filesystem) on the "Palo Alto" hosted XSOAR instance? to an incident? - &lt;STRONG&gt;&lt;EM&gt;This is not possible for a PA hosted instance. We do not give SSH access and do not allow the SSH integration.&lt;/EM&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;2. Do you want to download a file that is inside an incident to your system? - &lt;EM&gt;&lt;STRONG&gt;This is not possible since we do not have access your filesystem from the XSOAR UI.&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;3. Do you want to download a file from an external URL and save it inside the incident? - &lt;EM&gt;&lt;STRONG&gt;This is possible with some simple python code like below. The automation will accept the "URL" as an input.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import urllib2
response = urllib2.urlopen(URL)
data = response.read()
demisto.results(fileResult(FILENAME, data))&lt;/LI-CODE&gt;&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;Also, scenario 1 is possible if you're not using a PA Hosted XSOAR platform.&amp;nbsp;&lt;/FONT&gt;&lt;FONT face="verdana,geneva" size="2"&gt;Thanks.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2022 01:47:15 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/how-to-use-demisto-api-download-in-a-automation/m-p/503298#M960</guid>
      <dc:creator>jfernandes1</dc:creator>
      <dc:date>2022-06-14T01:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: how to use demisto-api-download in a Automation</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/how-to-use-demisto-api-download-in-a-automation/m-p/503580#M968</link>
      <description>&lt;P&gt;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/208028"&gt;@jfernandes1&lt;/a&gt;&amp;nbsp;, I can gladly explain our use case a little better. Hope this makes sense.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are trying to do #2 in your response above for the most part. We have an on-prem XSOAR environment that we are moving away from, to a hosted instance.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently on-prem, we are able to copy a file from an incident, to a non XSOAR Server in our environment using the Shared Agent in a playbook.. Moving to the Hosted solution, the shared agents / d2 agents are depreciated, so we are looking for other ways to continue to have this functionality in the hosted solution and are exploring our options.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The powershell remoting integration looks promising, but it apparently has a file size limitation on what it is able to upload from xsoar to another Server. I can upload incident files under 275k using the command &lt;SPAN&gt;!ps-remote-upload-file, but anything larger fails. This would be the ideal solution, but I am not sure there is a way around the size limitation.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We found the XSOAR API integration and this also looks somewhat promising. It's a little ugly, but I was thinking about using a combination of 2 integrations to get around the limitations. Possibly use the powershell remoting integration to get around the filesystem permissions issue you highlighted to then call the XSOAR API integration GET /entry/download/entryid in a script to download the file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2022 16:19:37 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/how-to-use-demisto-api-download-in-a-automation/m-p/503580#M968</guid>
      <dc:creator>kbratt</dc:creator>
      <dc:date>2022-06-14T16:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: how to use demisto-api-download in a Automation</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/how-to-use-demisto-api-download-in-a-automation/m-p/503682#M969</link>
      <description>&lt;P&gt;It sounds like you're looking for a file upload command/integration, like:&lt;/P&gt;&lt;P&gt;SMB:&amp;nbsp;&lt;A href="https://xsoar.pan.dev/docs/reference/integrations/server-message-block-smb-v2#smb-upload" target="_self"&gt;https://xsoar.pan.dev/docs/reference/integrations/server-message-block-smb-v2#smb-upload&lt;/A&gt; or&lt;/P&gt;&lt;P&gt;SCP:&amp;nbsp;&lt;A href="https://xsoar.pan.dev/docs/reference/integrations/remote-access-v2#copy-to" target="_blank"&gt;https://xsoar.pan.dev/docs/reference/integrations/remote-access-v2#copy-to&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Uploading to a cloud file store and then syncing to your local server is also a potential option depending on what you're looking for. For that an integration like Azure File store&amp;nbsp;&lt;A href="https://xsoar.pan.dev/docs/reference/integrations/azure-storage-file-share#azure-storage-fileshare-file-create" target="_blank"&gt;https://xsoar.pan.dev/docs/reference/integrations/azure-storage-file-share#azure-storage-fileshare-file-create&lt;/A&gt;&amp;nbsp;or Google Drive&amp;nbsp;&lt;A href="https://xsoar.pan.dev/docs/reference/integrations/google-drive#google-drive-file-upload" target="_blank"&gt;https://xsoar.pan.dev/docs/reference/integrations/google-drive#google-drive-file-upload&lt;/A&gt;&amp;nbsp;would do what you need.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2022 00:45:16 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/how-to-use-demisto-api-download-in-a-automation/m-p/503682#M969</guid>
      <dc:creator>chrking</dc:creator>
      <dc:date>2022-06-15T00:45:16Z</dc:date>
    </item>
    <item>
      <title>Re: how to use demisto-api-download in a Automation</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/how-to-use-demisto-api-download-in-a-automation/m-p/503868#M973</link>
      <description>&lt;P&gt;Thanks for the responses &lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/208030"&gt;@chrking&lt;/a&gt;&amp;nbsp;, much apprecaited.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think the SMB upload integration is exactly what I am looking for. I was able to just upload a file from our hosted XSOAR instance to a server on our network. Will test building this into some automation now and testing, but looks promising for sure.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2022 16:24:06 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/how-to-use-demisto-api-download-in-a-automation/m-p/503868#M973</guid>
      <dc:creator>kbratt</dc:creator>
      <dc:date>2022-06-15T16:24:06Z</dc:date>
    </item>
  </channel>
</rss>

