Import source fails to retrieve info from NetBox (API Rest)


I am trying to retrieve information from a Netbox source, first, I try with a curl and it returns the information I need:

curl -H "Authorization: Token xxxxxx"

But when configuring it in Icinga Director, as you can see:

Import source name Netbox test Description XXX
Source Type REST API
Key column name id
Protocol HTTPS
Verify Peer Yes
Verify Host Yes
Extract property results
HTTP Header “Accept: application/json”
“Authorization: Token xxxxx”
Proxy No

It returns error 400

This Import Source failed when last checked at 2023-07-26 11:18:24: Got 400: '<!DOCTYPE html><title>Error 400</title><p>Error 400. '

I tried:
Removing verify peer/host…
Changing the endpoint and removing format=json
Changing the headers and removing accept application/json

Solved… I was including the headers with double quotes… and thats not possible.

This might save you lots of messing about - we have a bunch of shortcuts and helper functions that make it easier to interface with netbox.