<?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: VMware API 400 error help in VMware vCloud™ API Discussions</title>
    <link>https://communities.vmware.com/t5/VMware-vCloud-API-Discussions/VMware-API-400-error-help/m-p/2901211#M2114</link>
    <description>&lt;P&gt;I guess the Skyline API interprets the JSON query as&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{"query":"{ activeFindings( filter: {findingId: "vSphere-CVE-2020-3992-VMSA#202023"} limit: 200 ) { findings { findingId products affectedObjects(start: 0, limit: 200) {sourceName objectName objectType version buildNumber solutionTags { type version } firstObserved} } totalRecords timeTaken}}"}&lt;/LI-CODE&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;"{ activeFindings( filter: {findingId: " as the value of "query". Therefore the rest is invalid JSON. I believe this is a JSON parsing bug with the API.&lt;/P&gt;</description>
    <pubDate>Wed, 30 Mar 2022 01:57:26 GMT</pubDate>
    <dc:creator>jjiang04</dc:creator>
    <dc:date>2022-03-30T01:57:26Z</dc:date>
    <item>
      <title>VMware API 400 error help</title>
      <link>https://communities.vmware.com/t5/VMware-vCloud-API-Discussions/VMware-API-400-error-help/m-p/2901157#M2113</link>
      <description>&lt;P&gt;We are using Groovy and httpRequest plugin to make these two requests. One of them does not work as expected.&lt;/P&gt;&lt;P&gt;1. This works fine:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;def resReports = httpRequest url: "https://skyline.vmware.com/public/api/data",
ignoreSslErrors: true,
httpMode: 'POST',
contentType: 'APPLICATION_JSON',
acceptType: 'APPLICATION_JSON',
customHeaders: [[name: 'Authorization', value: "${workingToken}"]],
requestBody: "{\"query\":\"{ activeFindings( filter: {categoryName: SECURITY, severity: CRITICAL} limit: 20 ) { findings { findingId severity products findingDescription findingImpact recommendations totalAffectedObjectsCount } totalRecords timeTaken}}\"}"&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;2. This for some reason, does not work. The only thing changed was the requestBody, but I cannot find where the error lies since it follows &lt;A href="https://docs.vmware.com/en/VMware-Skyline/1.0/skyline-api-guide/GUID-C442EB1C-F457-40BC-B8FD-E29E39AD9763.html" target="_blank" rel="noopener"&gt;this documented format&lt;/A&gt; very closely.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;def resReports = httpRequest url: "https://skyline.vmware.com/public/api/data",
ignoreSslErrors: true,
httpMode: 'POST',
contentType: 'APPLICATION_JSON',
acceptType: 'APPLICATION_JSON',
customHeaders: [[name: 'Authorization', value: "${workingToken}"]],
requestBody: "{\"query\":\"{ activeFindings( filter: {findingId: \"vSphere-CVE-2020-3992-VMSA#202023\"} limit: 200 ) { findings { findingId products affectedObjects(start: 0, limit: 200) {sourceName objectName objectType version buildNumber solutionTags { type version } firstObserved} } totalRecords timeTaken}}\"}"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2022 18:37:55 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-vCloud-API-Discussions/VMware-API-400-error-help/m-p/2901157#M2113</guid>
      <dc:creator>maxluong</dc:creator>
      <dc:date>2022-03-29T18:37:55Z</dc:date>
    </item>
    <item>
      <title>Re: VMware API 400 error help</title>
      <link>https://communities.vmware.com/t5/VMware-vCloud-API-Discussions/VMware-API-400-error-help/m-p/2901211#M2114</link>
      <description>&lt;P&gt;I guess the Skyline API interprets the JSON query as&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{"query":"{ activeFindings( filter: {findingId: "vSphere-CVE-2020-3992-VMSA#202023"} limit: 200 ) { findings { findingId products affectedObjects(start: 0, limit: 200) {sourceName objectName objectType version buildNumber solutionTags { type version } firstObserved} } totalRecords timeTaken}}"}&lt;/LI-CODE&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;"{ activeFindings( filter: {findingId: " as the value of "query". Therefore the rest is invalid JSON. I believe this is a JSON parsing bug with the API.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2022 01:57:26 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-vCloud-API-Discussions/VMware-API-400-error-help/m-p/2901211#M2114</guid>
      <dc:creator>jjiang04</dc:creator>
      <dc:date>2022-03-30T01:57:26Z</dc:date>
    </item>
  </channel>
</rss>

