<?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: Stealtwatch SMC: REST API Invalid JSON error in Network Security</title>
    <link>https://community.cisco.com/t5/network-security/stealtwatch-smc-rest-api-invalid-json-error/m-p/5370968#M609</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;SPAN class=""&gt;Jesus&lt;BR /&gt;&lt;BR /&gt;I tried that with coma and without coma - the same result.&lt;BR /&gt;Checked my query with jsonlint, it was green.&lt;BR /&gt;Pasted that query after -d flag and nothing changed, same error&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;curl.exe -k -X POST "https://{scm-address}/sw-reporting/v2/tenants/{tenant-id}/flows/queries" `
    -H "Cookie: stealthwatch.jwt=$JWT" `
    -H "X-XSRF-TOKEN: $XSRF_TOKEN" `
    -H "Content-Type: application/json" `
    -d '{
  "startDateTime": "2026-02-18T08:00:00Z",
  "endDateTime": "2026-02-18T08:36:00Z",
  "recordLimit": 50
}'&lt;/LI-CODE&gt;&lt;P&gt;I&amp;nbsp; executed that script from Linux (converted to bash), and it works as expected&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;curl -k -X POST "https://{scm-address}/sw-reporting/v2/tenants/{tenant-id}/flows/queries" \
  -H "Cookie: stealthwatch.jwt=$JWT" \
  -H "X-XSRF-TOKEN: $XSRF_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "startDateTime": "2026-02-18T08:00:00Z",
  "endDateTime": "2026-02-18T08:36:00Z",
  "recordLimit": 50
}'&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;For now I choose to use Linux for that task, so that topic is no more actual for me.&lt;BR /&gt;I discussed that problem with my Windows admin colegue, and he also can't help with that.&lt;BR /&gt;We think PowerShell somehow&amp;nbsp;implicitly changing json query, and SMC can't understand it&lt;BR /&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 18 Feb 2026 15:50:30 GMT</pubDate>
    <dc:creator>mofnoc</dc:creator>
    <dc:date>2026-02-18T15:50:30Z</dc:date>
    <item>
      <title>Stealtwatch SMC: REST API Invalid JSON error</title>
      <link>https://community.cisco.com/t5/network-security/stealtwatch-smc-rest-api-invalid-json-error/m-p/5369505#M605</link>
      <description>&lt;P&gt;Hello Team&lt;BR /&gt;&lt;BR /&gt;When I doing POST(PowerShell), SMC returns an error:&lt;/P&gt;&lt;PRE&gt;{
"errors" : [ {
"code" : 5060,
"message" : "The Request received is invalid"
}, "Invalid JSON." ]
}&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;This is a part of PowerShell script I use:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;# JSON query body
$body = '{
"startDateTime": "2026-02-10T08:00:00Z",
"endDateTime": "2026-02-10T08:05:00Z",
"recordLimit": 10,
"subject": {
"orientation": "CLIENT",
"ipAddresses": {
"includes": ["192.168.0", "10.20"]
}
},
"peer": {
"ipAddresses": {
"includes": ["192.168.0", "10.20"]
},
},
"flow": {
"tcpUdpPorts": {
"includes": ["80-9000/tcp", "67-68/udp"]
},
"flowDirection": "BIDIRECTIONAL",
}'

# POST query
curl.exe -k -X POST "https://{smc-address}/sw-reporting/v2/tenants/{tenant-id}/flows/queries" `
-H "Cookie: stealthwatch.jwt=$JWT" `
-H "X-XSRF-TOKEN: $XSRF_TOKEN" `
-H "Content-Type: application/json" `
-d $body&lt;/PRE&gt;&lt;P&gt;Tenant ID and tags(name,ID) extracted successfully&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Everything I do is according to that documentation:&lt;BR /&gt;&lt;A href="https://developer.cisco.com/docs/stealthwatch/enterprise/reporting-api-version-2/" target="_blank"&gt;https://developer.cisco.com/docs/stealthwatch/enterprise/reporting-api-version-2/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Maybe I miss something in my json&lt;BR /&gt;Stealthwatch version is 7.5.3&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Feb 2026 09:58:31 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/stealtwatch-smc-rest-api-invalid-json-error/m-p/5369505#M605</guid>
      <dc:creator>mofnoc</dc:creator>
      <dc:date>2026-02-12T09:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: Stealtwatch SMC: REST API Invalid JSON error</title>
      <link>https://community.cisco.com/t5/network-security/stealtwatch-smc-rest-api-invalid-json-error/m-p/5369869#M606</link>
      <description>&lt;P&gt;I don't know stealthwatch but since the error is about invalid json, I checked on vscode json linter and I see an error on the comma after "BIDIRECTIONAL"&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="java"&gt;"flowDirection": "BIDIRECTIONAL", &amp;lt;--- This comma at the end&lt;/LI-CODE&gt;
&lt;P&gt;From experience in json, you only need a comma if you have multiple elements in a list/object. Remove the comma and try again.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JesusIllescas_0-1770985778168.png" style="width: 999px;"&gt;&lt;img src="https://community.cisco.com/t5/image/serverpage/image-id/259604iD6E82E5CDC6928EE/image-size/large?v=v2&amp;amp;px=999" role="button" title="JesusIllescas_0-1770985778168.png" alt="JesusIllescas_0-1770985778168.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Feb 2026 12:31:15 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/stealtwatch-smc-rest-api-invalid-json-error/m-p/5369869#M606</guid>
      <dc:creator>Jesus Illescas</dc:creator>
      <dc:date>2026-02-13T12:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: Stealtwatch SMC: REST API Invalid JSON error</title>
      <link>https://community.cisco.com/t5/network-security/stealtwatch-smc-rest-api-invalid-json-error/m-p/5370298#M607</link>
      <description>&lt;P&gt;It wasn't help, the same error.&lt;BR /&gt;I even simplified query, but have the same issue+&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# JSON query body
$body = @{
    "startDateTime" = "2026-02-01T08:00:00Z"
    "endDateTime"   = "2026-02-10T08:50:00Z"
}

$jsonBody = $body | ConvertTo-Json -Compress

# POST query
curl.exe -k -X POST "https://{scm-address}/sw-reporting/v2/tenants/{tenant-id}/flows/queries" `
    -H "Cookie: stealthwatch.jwt=$JWT" `
    -H "X-XSRF-TOKEN: $XSRF_TOKEN" `
    -H "Content-Type: application/json" `
    -d $jsonBody&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Feb 2026 12:34:34 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/stealtwatch-smc-rest-api-invalid-json-error/m-p/5370298#M607</guid>
      <dc:creator>mofnoc</dc:creator>
      <dc:date>2026-02-16T12:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: Stealtwatch SMC: REST API Invalid JSON error</title>
      <link>https://community.cisco.com/t5/network-security/stealtwatch-smc-rest-api-invalid-json-error/m-p/5370925#M608</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/875830"&gt;@mofnoc&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;what if you try:&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;$body = @{
    "startDateTime" = "2026-02-01T08:00:00Z",
    "endDateTime"   = "2026-02-10T08:50:00Z"
}&lt;/LI-CODE&gt;
&lt;P&gt;I added a comma, given you have two elements. I suggest to use a json linter to discard errors due to missing something.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I use vscode, but there are also online tools like&amp;nbsp;&lt;A href="https://jsonlint.com/" target="_blank"&gt;https://jsonlint.com/&lt;/A&gt;&amp;nbsp;just make sure you don't put any sensitive data online.&lt;/P&gt;
&lt;P&gt;If the linter gives you a green light, then I would discard for now the variables and put directly the json plaintext into the -d flag of curl&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Feb 2026 13:20:08 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/stealtwatch-smc-rest-api-invalid-json-error/m-p/5370925#M608</guid>
      <dc:creator>Jesus Illescas</dc:creator>
      <dc:date>2026-02-18T13:20:08Z</dc:date>
    </item>
    <item>
      <title>Re: Stealtwatch SMC: REST API Invalid JSON error</title>
      <link>https://community.cisco.com/t5/network-security/stealtwatch-smc-rest-api-invalid-json-error/m-p/5370968#M609</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;SPAN class=""&gt;Jesus&lt;BR /&gt;&lt;BR /&gt;I tried that with coma and without coma - the same result.&lt;BR /&gt;Checked my query with jsonlint, it was green.&lt;BR /&gt;Pasted that query after -d flag and nothing changed, same error&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;curl.exe -k -X POST "https://{scm-address}/sw-reporting/v2/tenants/{tenant-id}/flows/queries" `
    -H "Cookie: stealthwatch.jwt=$JWT" `
    -H "X-XSRF-TOKEN: $XSRF_TOKEN" `
    -H "Content-Type: application/json" `
    -d '{
  "startDateTime": "2026-02-18T08:00:00Z",
  "endDateTime": "2026-02-18T08:36:00Z",
  "recordLimit": 50
}'&lt;/LI-CODE&gt;&lt;P&gt;I&amp;nbsp; executed that script from Linux (converted to bash), and it works as expected&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;curl -k -X POST "https://{scm-address}/sw-reporting/v2/tenants/{tenant-id}/flows/queries" \
  -H "Cookie: stealthwatch.jwt=$JWT" \
  -H "X-XSRF-TOKEN: $XSRF_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "startDateTime": "2026-02-18T08:00:00Z",
  "endDateTime": "2026-02-18T08:36:00Z",
  "recordLimit": 50
}'&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;For now I choose to use Linux for that task, so that topic is no more actual for me.&lt;BR /&gt;I discussed that problem with my Windows admin colegue, and he also can't help with that.&lt;BR /&gt;We think PowerShell somehow&amp;nbsp;implicitly changing json query, and SMC can't understand it&lt;BR /&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Feb 2026 15:50:30 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/stealtwatch-smc-rest-api-invalid-json-error/m-p/5370968#M609</guid>
      <dc:creator>mofnoc</dc:creator>
      <dc:date>2026-02-18T15:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: Stealtwatch SMC: REST API Invalid JSON error</title>
      <link>https://community.cisco.com/t5/network-security/stealtwatch-smc-rest-api-invalid-json-error/m-p/5370978#M610</link>
      <description>&lt;P&gt;Thanks for sharing what worked for you&amp;nbsp;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/875830"&gt;@mofnoc&lt;/a&gt;&amp;nbsp;I'm not a windows user so this is strange to see. I will mark your last comment as the solution.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Feb 2026 16:28:07 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/stealtwatch-smc-rest-api-invalid-json-error/m-p/5370978#M610</guid>
      <dc:creator>Jesus Illescas</dc:creator>
      <dc:date>2026-02-18T16:28:07Z</dc:date>
    </item>
  </channel>
</rss>

