Question about Web API Filter with special characters

I am trying to pull information from the Chef Automate API into a custom server perspective and having a problem with a filter parameter. To pull information for a specific node, the request needs to look like this (as tested in a separate REST interface):

https://ChefAutomateServer/compliance/nodes?filters=node_name:SERVERNAME

But when SquaredUp Web API tile processes this, it converts the : character to %3a which the Chef API rejects:

The API returned a 400 response (“Invalid filter ‘node_name%3aSERVERNAME’”)

I’ve tried different escape characters in the URL and the JSON source for the tile but nothing seems to prevent the character conversion. Is there a way to preserve this colon or do I need to find another workaround?

thanks!

Did you try escaping the special character by using a backslash?

I’m presuming it could be something on the Chef side?

I tried using mockAPI to built a sample endpoint and when passing a string containing colons in to that it doesn’t seem to escape them?

I’ve barely used the WebAPI tile yet but taking your URL into it’s component parts I presume that the first portion (https://ChefAutomateServer) is the provider and /compliance/nodes is the path.

Is the data in form or text format? Any chance you can show the WebAPI tile configuration please?

I gave it a shot and then that was encoded as well.

http method:

compliance/nodes?filters=node_name:SERVERNAME

response:

(“Invalid filter ‘node_name%5c%3aSERVERNAME’”)

I can send requests to the same Chef endpoint URL in Powershell and other REST tools, so it does seem to be some unnecessary conversion inside the query parameter. Correct, the first portion is the provider. Here is the tile JSON I’m working on:

{
“_type”: “tile/webapi-as-table”,
“config”: {
“context”: {},
“source”: {
“_security”: “signing”,
“method”: “GET”,
“provider”: “Chef Automate”,
“url”: “compliance/nodes?filters=node_name:{{properties.netbiosComputerName}}”,
“contextType”: “scom/object”,
“data”: [],
“keypath”: “”
},
“display”: {
“showHeaders”: true,
“columns”: [
“id”,
“name”,
“platform”,
“environment”,
“latest_report”
],
“customColumns”: {},
“columnOverrides”: {},
“autohide”: true,
“rowLink”: “”
}
},
“title”: “Node Compliance Status”,
“description”: “”
}