When using the EPM API, the docs say the version string is optional. If I want to omit it, what do I put in that part of the URL?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

When using the EPM API, the docs say the version string is optional. If I want to omit it, what do I put in that part of the URL?

L2 Linker

See https://docs.cyberark.com/Product-Doc/OnlineHelp/EPM/Latest/en/Content/WebServices/ServerAuthenticat...

 

Version

API version

Type: String

Valid value: Version number. Format is x.x.x.x (for example, 11.5.0.1)

Default value: Latest version

Mandatory: No

 

How do you do a "default value" in a URL?

 

 

 

4 REPLIES 4

L6 Presenter

See the note here: https://docs.cyberark.com/Product-Doc/OnlineHelp/EPM/Latest/en/Content/WebServices/WebServicesIntro.htm#APIversioning

 

"We recommend not specifying the version number in the REST API URL, which will run the latest version of the API. Review the EPM Release Notes to determine which APIs changed in each release."

 

So just omit that portion of the url.

L2 Linker

So to be clear, just:

 

https://na999.epm.cyberark.com/EPM/API//Auth/EPM/Logon

 

I use that and get a 500 (when posting the username, password, and application ID)

 

Where/how can I troubleshoot that further?

$body = [pscustomobject] @{ Username = $Username Password = $Password ApplicationID = $($MyInvocation.MyCommand).ToString() }   $url = "{0}/EPM/API/Auth/EPM/Logon" -f $EpmBaseUrl $url   try { $token = Invoke-RestMethod -Uri $url -Method Post -Body $body -ContentType application/json } catch { $_.Exception | fl * -force }   $token

 

 

 

 

2 things to try - remove the extra backslash in the URL:

https://na999.epm.cyberark.com/EPM/API/Auth/EPM/Logon

The Body should be formatted as JSON

$body = [pscustomobject] @{ Username = $Username Password = $Password ApplicationID = $($MyInvocation.MyCommand).ToString() } | ConvertTo-Json

 

L2 Linker

Thanks. I thought .NET automatically converted the body content to the correct content format, but apparently not. When I explicitly convert to JSON I get a 401, which is an improvement over a 500.

 

I'll figure out what I've done wrong with the user setup. I had to create a new user ID for this test because we normally access EPM via SAML federation.

 

  • 362 Views
  • 4 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

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!