1 Reply Latest reply on Jun 13, 2017 1:03 PM by jlazerus

    API 401 Error ePO

    jlazerus

      Hi,

       

      I've been trying for a while to get the API to even log in but I keep running into issues.  First, I was having a self-signed certificate issue which I was able to get past it by using verify=False in my command.  Now I'm getting a 401 Unauthorized and I'm not sure if this is still a certificate issue.  I found this other thread (Validating Username and Password ) and when I try that, I also get a certificate issue.  Can someone please help me figure out how to log into this system.

      ePOServer = ('https://myeposerver:8443/remote/system.find?')
      data = {
        'searchText':device,
        'username':user,
        'password':passwd
      }
      
      
      result = requests.post(ePOServer,data,verify=False)
      print result
      print result.text
      

       

      Yes, I do have these variables set.

        • 1. Re: API 401 Error ePO
          jlazerus

          Okay, so I've finally figured this out.  However now when I submit a request I get an error:

           

          body = "{'config': { \

            'timeRange': 'LAST_24_HOURS', \

            'order': [{ \

            'direction': 'ASCENDING', \

            'field': {'name': '(name)'} \

            }], \

            'includeTotal': 'false', \

            'fields': [{'name': '(name)'}], \

            'filters': [{ \

            'type': 'EsmFieldFilter', \

            'field': {'name': '(name)'}, \

            'operator': 'IN', \

            'values': [{ \

            'type': 'EsmWatchlistValue', \

            'watchlist': {'value': 0}, \

            'DstIP': ips \

            }] \

            }], \

            'limit': 0 \

          }}"

           

           

          esmUrl = 'https://10.201.62.241/rs/esm/qryExecuteDetail?type=EVENT&reverse=false'

           

          r = requests.get(esmUrl, data=body, auth=(user,passwd), verify=False)

          print r.text

           

          The error I receive is:

          ERROR_IndexNotTurnedOn (49)