Hi,
i have the follwing curl request, which i would like to rebuild in n8n, the problem is the columns parameter.
curl \
-v -G \
--request GET \
--write-out "\nxxx-status_code=%{http_code}\n" \
--header "Authorization: Bearer $USERNAME $PASSWORD" \
--header "Accept: */*" \
--data-urlencode 'query={"op": "=", "left": "host_name", "right": "erp.it.local"}' \
--data-urlencode 'columns=host_name' \
--data-urlencode 'columns=description' \
"$API_URL/domain-types/service/collections/all"
)
Output:
{"links": [{"domainType": "link", "rel": "self", "href": "https://example.com/check_mk/api/1.0/objects/host/erp.it.local", "method": "GET", "type": "application/json"}], "domainType": "host", "id": "erp.it.local", "title": "erp.it.local", "members": {}, "extensions": {"host_name": "erp.it.local", "description": "ERP System"}}
Here is my n8n build:
I will not get the columns work, only the default value response by the api called “name”, tryed different styles.
Any Ideas?
N8N Version: 1.57.0
Thanks, Kr Christian
1 Like
n8n
October 7, 2024, 10:11pm
2
It looks like your topic is missing some important information. Could you provide the following if applicable.
n8n version:
Database (default: SQLite):
n8n EXECUTIONS_PROCESS setting (default: own, main):
Running n8n via (Docker, npm, n8n cloud, desktop app):
Operating system:
aya
October 9, 2024, 11:14am
3
Hi @ChristianV ,
What happens if you added two Body parameters named columns
with values host_name
and description
instead of as an array under one parameter?
@aya , 1st my fault was, that this is no body parameter, but a query parameter , cause its a get, i created before a post request.
But if a add one “columns” parameter now to request i worked, but if i add a second field, also with name “columns”, it will take only the last one.
if i add the fields direct to the url request, like:
“https://example.com/cnit/check_mk/api/1.0/objects/host/erp.it.local?columns=host_name&columns=display_name ” it works.
Screenshot Fields:
Screenshot URL:
Ok, i found the solution:
and add
2 Likes
aya
October 10, 2024, 9:21am
6
Nice you found the solution!
system
Closed
October 17, 2024, 9:21am
7
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.