Testing the Ivanti Endpoint Manager Distribution API
  • 01 Jul 2024
  • 1 Minute to read
  • Dark
    Light
  • PDF

Testing the Ivanti Endpoint Manager Distribution API

  • Dark
    Light
  • PDF

Article summary

Liquit Setup Commander uses the Distribution API which is available in Ivanti Endpoint Manager 2017.3 Update 3 and later.

This API and its documentation can be accessed on the EPM server using this URL: https://localhost/DistributionApi/Swagger/ui/index

If you can’t connect Liquit Setup Commander to your EPM environment successfully after using the tips and tricks provided in the Options of Liquit Setup Commander, use the following PowerShell script against your environment. Update the script to reflect your environment details first.

If this script doesn’t finish successfully, contact Ivanti support to follow up with you.

# Variables
$username = “administrator”
$password = “P@ssw0rd”
$clientid = “SetupCommander”
$clientsecret = “secret”
$baseurl = “https://192.168.1.100/my.identityserver/identity/connect/token”
$returnCodeTemplatesUrl = “https://192.168.1.100/distributionapi/api/v1/ReturnCodeTemplates”

# Set the url
$data = “grant_type=password&client_id=” + $clientid + “&client_secret=” + $clientsecret + “&username=” + $username + “&scope=openid&password=” + $password

# Authenticate
$webclient = new-object System.Net.WebClient
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}
$authResult = $webclient.UploadString($baseurl, $data)

# Get the access_token
$authResultJson = $authResult | ConvertFrom-Json
$accesstoken = $authResultJson.access_token

# Get the ReturnCodeTemplates
$req = [System.Net.WebRequest]::Create($returnCodeTemplatesUrl)
$req.Headers.Add(“Authorization”, “Bearer ” + $accesstoken)
$req.Method = “GET”
$resp = $req.GetResponse()
$reqstream = $resp.GetResponseStream()
$sr = new-object System.IO.StreamReader $reqstream
$result = $sr.ReadToEnd()
Write-Host $result

Was this article helpful?