<?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: Passing a JSON Value to a JSON API Request in Cortex XSOAR Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/passing-a-json-value-to-a-json-api-request/m-p/536871#M1947</link>
    <description>&lt;P&gt;As your issue is so specific and I do not have this integration or I have not had any issue with json escape characters I can give you the advice to search scripts that have json in the name like &lt;A href="https://xsoar.pan.dev/docs/reference/scripts/json-unescape" target="_blank"&gt;https://xsoar.pan.dev/docs/reference/scripts/json-unescape&lt;/A&gt; as this sounds the reverse of what you want but you can reverse engineer the script &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Other scripts to look:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://xsoar.pan.dev/docs/reference/scripts/ignore-fields-from-json" target="_blank"&gt;https://xsoar.pan.dev/docs/reference/scripts/ignore-fields-from-json&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://xsoar.pan.dev/docs/reference/scripts/dump-json" target="_blank"&gt;https://xsoar.pan.dev/docs/reference/scripts/dump-json&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://xsoar.pan.dev/docs/reference/scripts/parse-json" target="_blank"&gt;https://xsoar.pan.dev/docs/reference/scripts/parse-json&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://xsoar.pan.dev/docs/reference/scripts/load-json" target="_blank"&gt;https://xsoar.pan.dev/docs/reference/scripts/load-json&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are many more.&lt;/P&gt;</description>
    <pubDate>Wed, 29 Mar 2023 07:00:19 GMT</pubDate>
    <dc:creator>nikoolayy1</dc:creator>
    <dc:date>2023-03-29T07:00:19Z</dc:date>
    <item>
      <title>Passing a JSON Value to a JSON API Request</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/passing-a-json-value-to-a-json-api-request/m-p/536436#M1940</link>
      <description>&lt;P&gt;Hi All, I have faced one issue while sending a API call to IVANTI. I need to call one value into this request as below&lt;/P&gt;
&lt;PRE&gt;{&lt;BR /&gt;"OrgUnitLink": "${org}",&lt;BR /&gt;"Symptom": "${body}",&lt;BR /&gt;"Subject": "${incident.labels.Email/subject}",&lt;BR /&gt;"Source": "Email",&lt;BR /&gt;"Status": "Submitted"&lt;BR /&gt;}&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;${org}&lt;/STRONG&gt; gets passed without an issue when I call it since the value is like &lt;EM&gt;asda232adadf334d&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;But when I call an email body(&lt;STRONG&gt;${body}&lt;/STRONG&gt;) it gets screwed up since the final call looks like below,&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Json.PNG" style="width: 200px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/49022i18EC457E2672BA25/image-size/small/is-moderation-mode/true?v=v2&amp;amp;px=200" role="button" title="Json.PNG" alt="Json.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I know that the error is coming because JSON need some characters escaped. But I have no idea how to do this. Any help would be appreciated.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ivanti.PNG" style="width: 541px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/49023i1A8BD339B2F293D5/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999" role="button" title="Ivanti.PNG" alt="Ivanti.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Mar 2023 15:07:36 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/passing-a-json-value-to-a-json-api-request/m-p/536436#M1940</guid>
      <dc:creator>vidurasupun</dc:creator>
      <dc:date>2023-03-25T15:07:36Z</dc:date>
    </item>
    <item>
      <title>Re: Passing a JSON Value to a JSON API Request</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/passing-a-json-value-to-a-json-api-request/m-p/536871#M1947</link>
      <description>&lt;P&gt;As your issue is so specific and I do not have this integration or I have not had any issue with json escape characters I can give you the advice to search scripts that have json in the name like &lt;A href="https://xsoar.pan.dev/docs/reference/scripts/json-unescape" target="_blank"&gt;https://xsoar.pan.dev/docs/reference/scripts/json-unescape&lt;/A&gt; as this sounds the reverse of what you want but you can reverse engineer the script &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Other scripts to look:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://xsoar.pan.dev/docs/reference/scripts/ignore-fields-from-json" target="_blank"&gt;https://xsoar.pan.dev/docs/reference/scripts/ignore-fields-from-json&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://xsoar.pan.dev/docs/reference/scripts/dump-json" target="_blank"&gt;https://xsoar.pan.dev/docs/reference/scripts/dump-json&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://xsoar.pan.dev/docs/reference/scripts/parse-json" target="_blank"&gt;https://xsoar.pan.dev/docs/reference/scripts/parse-json&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://xsoar.pan.dev/docs/reference/scripts/load-json" target="_blank"&gt;https://xsoar.pan.dev/docs/reference/scripts/load-json&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are many more.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2023 07:00:19 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/passing-a-json-value-to-a-json-api-request/m-p/536871#M1947</guid>
      <dc:creator>nikoolayy1</dc:creator>
      <dc:date>2023-03-29T07:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: Passing a JSON Value to a JSON API Request</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/passing-a-json-value-to-a-json-api-request/m-p/537078#M1951</link>
      <description>&lt;P&gt;Created one of my own scripts to remove conflicting characters. It looks a bit ugly after formatting but better than nothing &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;function removeJsonEscapableChars(str) {
  const escapableChars = /\\["\\\/bfnrt]/g;
  return str.replace(escapableChars, '');
}
var body = args.value;
body = JSON.stringify(body);

setContext(args.key, removeJsonEscapableChars(body));&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 30 Mar 2023 10:35:42 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/passing-a-json-value-to-a-json-api-request/m-p/537078#M1951</guid>
      <dc:creator>vidurasupun</dc:creator>
      <dc:date>2023-03-30T10:35:42Z</dc:date>
    </item>
  </channel>
</rss>

