Ask the Community
Groups
How to pass special characters in REST commands? - Connect IT Community | Kaseya
<main> <article class="userContent"> <p><strong>QUESTION:</strong></p> <p>How to pass special characters in REST commands</p> <p> </p> <p><strong>RESOLUTION:</strong></p> <p>Occasionally it may be necessary to include 'special' characters within REST commands that would otherwise be interpreted as meta-data. This may be done by substituting the URL character code in place of the character itself.</p> <p>For example, the following command may fail due to the embedded hash (#) character in the value of 'serviceName':</p> <p><a href="/home/leaving?allowTrusted=1&target=https%3A%2F%2Ftraverse.acme.com%2Fapi%2Frest%2Fcommand%2Fcontainer.create%3FserviceName%3DRoom">https://traverse.acme.com/api/rest/command/container.create?serviceName=Room</a> #400&serviceType=device&memberListMethod=auto&ruleDeviceName=Traverse</p> <p>However, when the hash character (#) is replaced by the equivalent URL code '%23', the command succeeds:</p> <p><a href="/home/leaving?allowTrusted=1&target=https%3A%2F%2Ftraverse.acme.com%2Fapi%2Frest%2Fcommand%2Fcontainer.create%3FserviceName%3DRoom">https://traverse.acme.com/api/rest/command/container.create?serviceName=Room</a> %23400&serviceType=device&memberListMethod=auto&ruleDeviceName=Traverse</p> <p>See the link in the Reference section below for a URL character code table. </p> <p><strong>APPLIES TO:</strong></p> <p>All versions of Traverse</p> <p> </p> <p><strong>REFERENCE:</strong></p> <p>Additional information about URL encoding is available at <a href="/home/leaving?allowTrusted=1&target=http%3A%2F%2Fwww.w3schools.com%2Ftags%2Fref_urlencode.asp">http://www.w3schools.com/tags/ref_urlencode.asp</a></p> </article> </main>