- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
Our community just got stronger! Explore new identity security resources, connect with experts, and discover more ways to learn and collaborate.
11-23-2023 09:05 PM
I'm trying to call the EPM API using Python Requests, but it doesn't work. What is wrong with the script below? I created it with reference to the following document.
https://docs.cyberark.com/EPM/23.11.0/en/Content/WebServices/GetDetailedRawEvents.htm
The Python script is below.
#####################################
import requests
import json
token = "<Token that have been researched in advance>"
setID = "<SetID that have been researched in advance>"
url = "https://jp.epm.cyberark.com/EPM/API/Sets/" + setID + "/Events/Search"
headers = {"Content-Type": "application/json", "Authorization": "basic " + token}
data = {"filter": "fileName CONTAINS \"notepad++\""}
res = requests.post(
url,
headers = headers,
json = data,
verify = False
)
print(res.status_code)
print(res.text)
#####################################
When I run the above, the following will be displayed.
500
[{"ErrorCode":"EPM000001E","ErrorMessage":"Internal Error."}]
12-06-2023 06:56 PM
Hi everyone,
This problem solved! It was the server URL that was the problem.
Incorrect:
url = "https://jp.epm.cyberark.com/EPM/API/Sets/" + setID + "/Events/Search"
Correct:
url = "https://jp153.epm.cyberark.com/EPM/API/Sets/" + setID + "/Events/Search"
Actually, there were no other problems other than the above.
To explain, "jp.epm.cyberark.com" is the address of the Dispatcher server, and this API will not work unless it is a server after being dispatched.
12-06-2023 06:58 PM
Glad to know issue is fixed, and thanks @Koichiro Ota for sharing the resolution.
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!

