<?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: Uploading report via demisto api post request in Cortex XSOAR Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/uploading-report-via-demisto-api-post-request/m-p/555046#M2562</link>
    <description>&lt;P&gt;yes,correct&lt;/P&gt;</description>
    <pubDate>Thu, 24 Aug 2023 10:22:55 GMT</pubDate>
    <dc:creator>ZuleyhaAy</dc:creator>
    <dc:date>2023-08-24T10:22:55Z</dc:date>
    <item>
      <title>Uploading report via demisto api post request</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/uploading-report-via-demisto-api-post-request/m-p/554843#M2552</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to upload json file to create report. Despite I tried tons of way I couldn't send the body properly. demisto-api-post request need multipart/form-data content type. Is there any way to send raw json properly?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is my code;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;content = demisto.args().get('page_content')
page_number = demisto.args().get('page_num')

body= ""


json_template = safe_load_json(execute_command('demisto-api-get', {'uri':"/reports/bc874b4f-48aa-4a21-8f52-0c18450ce541"}))
layout_contents = json_template['response']['dashboard']['layout']

for widget_content in layout_contents:
    if page_number == widget_content['widget']['name']:
        widget_content['widget']['params']['text'] = content
        
body = (json.dumps(json_template['response'])).replace('"','\\"')

return_results(execute_command('demisto-api-post', {'uri':"/reports/upload",'files':body}))
&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 23 Aug 2023 12:02:45 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/uploading-report-via-demisto-api-post-request/m-p/554843#M2552</guid>
      <dc:creator>ZuleyhaAy</dc:creator>
      <dc:date>2023-08-23T12:02:45Z</dc:date>
    </item>
    <item>
      <title>Re: Uploading report via demisto api post request</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/uploading-report-via-demisto-api-post-request/m-p/554918#M2554</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just to summarize the use case, you read a report from the GET request, add a custom widget, and attempt to re-upload. Is this correct?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2023 19:02:47 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/uploading-report-via-demisto-api-post-request/m-p/554918#M2554</guid>
      <dc:creator>RahulVijaydev</dc:creator>
      <dc:date>2023-08-23T19:02:47Z</dc:date>
    </item>
    <item>
      <title>Re: Uploading report via demisto api post request</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/uploading-report-via-demisto-api-post-request/m-p/555046#M2562</link>
      <description>&lt;P&gt;yes,correct&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 10:22:55 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/uploading-report-via-demisto-api-post-request/m-p/555046#M2562</guid>
      <dc:creator>ZuleyhaAy</dc:creator>
      <dc:date>2023-08-24T10:22:55Z</dc:date>
    </item>
  </channel>
</rss>

