cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

API 401 Error ePO

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 ( ) 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.

4 Replies

Re: API 401 Error ePO

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)

Re: API 401 Error ePO

So Im getting that error when I pass a field name in filters that dosn't exist. It looks like it must be a field that can be filtered on.  


If the field exist and you cant filter on it I think you reviece 

ERROR_InvalidFilter (228)


What I have working is setting my filter to:

"filters": [{
"type": "EsmFieldFilter",
"field":{
"types": ["STRING"],
"name": "AvgSeverity"
}
}
]

 

Re: API 401 Error ePO

Hello,

is there a way to use the API to install extentions?

McAfee Employee cdinet
McAfee Employee
Report Inappropriate Content
Message 5 of 5

Re: API 401 Error ePO

not that I am aware of.

Was my reply helpful?
If this information was helpful in any way or answered your question, will you please select Accept as Solution in my reply and together we can help other members?

More McAfee Tools to Help You

Community Help Hub

    New to the forums or need help finding your way around the forums? There's a whole hub of community resources to help you.

  • Find Forum FAQs
  • Learn How to Earn Badges
  • Ask for Help
Go to Community Help

Join the Community

    Thousands of customers use the McAfee Community for peer-to-peer and expert product support. Enjoy these benefits with a free membership:

  • Get helpful solutions from McAfee experts.
  • Stay connected to product conversations that matter to you.
  • Participate in product groups led by McAfee employees.
Join the Community
Join the Community