Ad Widget

Collapse

Monitor UniFi Controller via API without additional scripts

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • daven1985
    Junior Member
    • Aug 2017
    • 12

    #46
    Originally posted by Fernandoqcn
    Click image for larger version

Name:	image.png
Views:	1044
Size:	8.4 KB
ID:	494268
    Good evening, I'm also having the same 401 error when accessing the new API, has anyone managed to access it?
    Did you happen to get this fixed? Cheers.

    Comment

    • daven1985
      Junior Member
      • Aug 2017
      • 12

      #47
      Originally posted by daven1985

      Did you happen to get this fixed? Cheers.
      I've figured out what the error is, still working on next steps.
      This is happening because I am using an internal address, and when you browse to it, you get a self-signed cert error. This is causing the issue with it saying unauthorised; if you test via a curl without -k, it generates the same error.

      Anyone know how to get it to ignore the self-signed cert. When I looked it seems like you can't.

      Comment

      • poggdogg
        Junior Member
        • May 2025
        • 1

        #48
        I know there's a template out there for an older version of the API (v0.1)
        This one worked as of 1.0 and doesn't use basic auth but uses the API key instead AND gets site names as 'Descriptions'.

        Based off the one by Chises (I couldn't get that one to work)

        Comment

        • troffasky
          Senior Member
          • Jul 2008
          • 565

          #49
          Originally posted by daven1985

          Anyone know how to get it to ignore the self-signed cert. When I looked it seems like you can't.
          I don't think this is your real problem. I am pointing mine at the private IP of a server with a commercial cert = certificate error as you cannot get an IP as a name on a commercial cert. But Zabbix works just fine, discovered 900+ items with this.

          Comment

          • sokeada
            Junior Member
            • Jun 2024
            • 25

            #50
            Originally posted by poggdogg
            I know there's a template out there for an older version of the API (v0.1)
            This one worked as of 1.0 and doesn't use basic auth but uses the API key instead AND gets site names as 'Descriptions'.

            Based off the one by Chises (I couldn't get that one to work)
            Thanks for the awesome template, after applied this template I've an issue with host discover item as below:

            Preprocessing failed for: {"data":{"id":"24b5215b-543d-4eb3-8af8-c96890988506:1456974794","hardwareId":"63457cb3-ad95-4ab1-...
            1. Failed: TypeError: cannot read property 'forEach' of undefined
              at [anon] (duktape.c:60534) internal
              at [anon] (function:6) preventsyield
            Click image for larger version

Name:	image.png
Views:	43
Size:	33.9 KB
ID:	509753

            Comment

            Working...