VMware Horizon Community
ibeerens1
Contributor
Contributor

Connect using the Rest API

I'm trying to connect to App Volumes 2.14 by using the REST API using Postman or PowerShell. For some reason I'm unable to connect.. Has someone successfully made a connection by using the REST API with the latest App Volumes versions?

0 Kudos
2 Replies
touimet
Enthusiast
Enthusiast

Same issue.  No matter what I try I get this:

Invoke-RestMethod : The underlying connection was closed: An unexpected error occurred on a send.

0 Kudos
touimet
Enthusiast
Enthusiast

This worked for me!

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

$Credentials = @{

    username = 'domain\username'

    password = 'mypassword'

}

$Server = "av1.domain.local"

Invoke-RestMethod -SessionVariable ServerSession -Method Post -Uri "https://$Server/cv_api/sessions" -Body $Credentials

What resolved it was the first line.

0 Kudos