Ask the Community
Groups
CURL search returns : Encountered error while executing command: You must pass in the tests - Connect IT Community | Kaseya
<main> <article class="userContent"> <p><strong>Issue:</strong><span style="color: #ff3333;"><em> </em></span></p> <p>- When using an API call to output a list of all container members using a command like the following</p> <div> <pre class="code codeBlock" spellcheck="false" tabindex="0">curl -k -X GET <a href="/home/leaving?allowTrusted=1&target=https%3A%2F%2Flocalhost%2Fapi%2Frest%2Fcommand%2Fcontainer.members%3Fservicename%3D%2A">https://localhost/api/rest/command/container.members?servicename=*</a> -H 'Cache-Control: no-cache' -H 'accept */*' -H 'cookie: TraverseJSessionID=#######'</pre> </div> <div id="ember4339"> <div data-comment-id="633655781212"> <div dir="auto"> <div id="ember4619"> <div></div> <div>- Returns an error stating: "ERR 501 Encountered error while executing command: You must pass in the tests"</div> <div></div> </div> </div> </div> </div> <div id="ember4340"> <div data-comment-id="632539113232"><img src="/attachments/token/2PsaLLNscqGKKQfBZCPzyNaag/?name=inline-268494798.png" alt="image" class="embedImage-img importedEmbed-img"></img></div> <div data-comment-id="632539113232"></div> </div> <p><strong>Workaround:</strong></p> <p>- To request a token to Authenticate with Traverse REST API, this KB can be followed - <a rel="nofollow" href="https://kaseya.vanillacommunities.com/kb/articles/aliases/kaseya/hc/en-gb/articles/229042308-Tip-How-to-access-the-Traverse-REST-API">https://helpdesk.kaseya.com/hc/en-gb/articles/229042308-Tip-How-to-access-the-Traverse-REST-API</a></p> <p>- Then you can add a test to the container</p> <p><img src="https://us.v-cdn.net/6032361/uploads/migrated/RZ2WGIGB2F8A/mceclip0.png" alt="mceclip0.png" class="embedImage-img importedEmbed-img"></img></p> <p> </p> <p>- Lastly, use the API call to output a list of the container members, such as below:</p> <div> <pre class="code codeBlock" spellcheck="false" tabindex="0">curl -k -X GET <a href="/home/leaving?allowTrusted=1&target=https%3A%2F%2Flocalhost%2Fapi%2Frest%2Fcommand%2Fcontainer.members%3Fservicename%3D%2A">https://localhost/api/rest/command/container.members?servicename=*</a> -H 'Cache-Control: no-cache' -H 'accept */*' -H 'cookie: TraverseJSessionID=#######'</pre> <p> </p> <p><img src="https://us.v-cdn.net/6032361/uploads/migrated/NVDXDGZKK8XU/mceclip1.png" alt="mceclip1.png" class="embedImage-img importedEmbed-img"></img></p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> </div> <p> </p> </article> </main>