title: Powershell Nested Json doesn't look like a Json
body: <p>I am currently trying to prepare a JSON body for an API call, which should look something like this</p>
  <pre><code>curl -XPOST -H 'Authorization: Bearer ***API*KEY***' -H 'Content-Type: application/json' http://127.0.0.1:9000/api/alert -d '{
    &quot;title&quot;: &quot;Other alert&quot;,
    &quot;description&quot;: &quot;alert description&quot;,
    &quot;type&quot;: &quot;external&quot;,
    &quot;source&quot;: &quot;instance1&quot;,
    &quot;sourceRef&quot;: &quot;alert-ref&quot;,
    &quot;severity&quot;: 3,
    &quot;tlp&quot;: 3,
    &quot;artifacts&quot;: [
      { &quot;dataType&quot;: &quot;ip&quot;, &quot;data&quot;: &quot;127.0.0.1&quot;, &quot;message&quot;: &quot;localhost&quot; },
      { &quot;dataType&quot;: &quot;domain&quot;, &quot;data&quot;: &quot;thehive-project.org&quot;, &quot;tags&quot;: [&quot;home&quot;, &quot;TheHive&quot;] },
    ],
    &quot;caseTemplate&quot;: &quot;external-alert&quot;
  }'
  </code></pre>
  <p>The problem however is that my json body which I create with powershell has weird characters and don't see where the problem is. This is my JSON Body</p>
  <pre><code>{
      &quot;tlp&quot;:  1,
      &quot;source&quot;:  &quot;Test&quot;,
      &quot;title&quot;:  &quot;Test Alert1&quot;,
      &quot;artifacts&quot;:  &quot;{\r\n    \&quot;dataType\&quot;:  \&quot;ip\&quot;,\r\n    \&quot;data\&quot;:  \&quot;127.0.0.1\&quot;\r\n}&quot;,
      &quot;type&quot;:  &quot;external&quot;,
      &quot;sourceRef&quot;:  &quot;1&quot;,
      &quot;description&quot;:  &quot;Test&quot;,
      &quot;severity&quot;:  1
  }
  </code></pre>
  <p>I create this JSON body as follows. I have already tried CustomObjects and Hashtables, but always get the same output</p>
  <pre><code>$body = @{
              title = &quot;$title&quot;
              description = &quot;$Alert_Description&quot;
              type =&quot;external&quot;
              source =&quot;$Source&quot;
              sourceRef =&quot;$SourceRef&quot;
              severity = $Severity
              tlp = $tlp
              $artifacts = [PSCustomObject]@{
              dataType=ip
              data=127.0.0.1}  
          }| ConvertTo-Json
          $JsonBody = $body | ConvertTo-Json
  </code></pre>
  <p>Can somebody give me a hint? I have no clue anymore</p>