Jump to content

Why I'm getting error "Invoke-RestMethod : Not Found Not Found HTTP Error 404. The requested resource is not found." While trying to call the api "http://<Delivery controller hostname>/Citrix/Monitor/OData/v4/Data/$metadata"

Recommended Posts

Do we need to do some configuration at controller end. The ports 80 & 443 are open between source and destination servers.

Full error msg:

"Invoke-RestMethod :

Not Found

Not Found

HTTP Error 404. The requested resource is not found.

At line:6 char:13

+ $response = Invoke-RestMethod -Uri $uri -Method 'GET' -Headers $heade ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  + CategoryInfo     : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [invoke-RestMethod], WebException

  + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand"

code snipet:

$headers = New-Object "System.Collections.Generic.Dictionary[[string],[string]]"

$headers.Add("Authorization", "Basic U1ZDLUdMT0JBTC1PbmVlbmdpbmU6ZipqYEJnclJoRSI7U2Z7Iyt9UFBeI0Y4cw==")

$uri = 'http://<Delivery controller hostname>/Citrix/Monitor/OData/v4/Data/$metadata'

$response = Invoke-RestMethod -Uri $uri -Method 'GET' -Headers $headers

$response | ConvertTo-Json

Link to comment
Share on other sites

  • 5 months later...

It seems that you are using on-prem CVAD Director and trying to access the data for it via OData API. As you are getting 404 errors, it seems the URI you are using is incorrect, please refer to Citrix Monitor API 7.15 LTSR Reference - to understand the URI's to use and also check that the DC-Host is correct as well as accessible. if you have further questions please leverage https://discussions.citrix.com/forum/1709-director/ forum, where our relevant experts can guide you

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...