Authentification problem on Zabbix 7.0.18

XMLWordPrintable

    • Type: Incident report
    • Resolution: Commercial support required
    • Priority: Trivial
    • None
    • Affects Version/s: 7.0.24
    • Component/s: API (A)
    • None

      Hello 

       

      We have an issus with api authentifcatyion .

      we are in ZABBIX 7.0.18 server

       

      exemple  : 

       

      This call is ok : 

      curl -k --request POST --url 'https://zabbix.by-docapost.com/api_jsonrpc.php' --header 'Content-Type: application/json-rpc' --data '{"jsonrpc":"2.0","method":"maintenance.get","params":

      {"output":"extend","selectHosts":"extend","selectTimeperiods":"extend","selectTags":"extend"}

      ,"id":1,"auth":"$BEARER"}'

       

      but this call doesn'nt work : 

       

      curl -s -X POST https://zabbix.by-docapost.com/api_jsonrpc.php \
        -H 'Content-Type: application/json' \
        -H 'Authorization: Bearer $BEARER' \
        --data '{
          "jsonrpc": "2.0",
          "method": "maintenance.get",
          "id": 1,
          "params":

      {       "output": "extend",       "selectHosts": "extend",       "selectTimeperiods": "extend",       "selectTags": "extend"     }

        }'

       

      it returns  :

      {"jsonrpc":"2.0","error":\{"code":-32602,"message":"Invalid params.","data":"Not authorized."}

      ,"id":1}

       

      Please any help would be welcolme

       

       

            Assignee:
            Unassigned
            Reporter:
            Thierry REGIS
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: