VMware Cloud Community
jeethualex
Contributor
Contributor

404 Not found for ( {vcenter host}/rest/vcenter/vm ) but logged in successfully

I am getting the below exception for the below rest call to vcenter

{vcenter host url}/rest/vcenter/vm

{

    "name": "com.vmware.vapi.rest.httpNotFound",

    "localizableMessages": [

        {

            "defaultMessage": "Not found.",

            "id": "com.vmware.vapi.rest.httpNotFound"

        }

    ],

    "majorErrorCode": 404

}

I was able to authenticate and get a session cookie successfully.

However making subsequent rest calls after authentication gives me the above JSON

Even for system time (/rest/appliance/system/time)

Really appreciate some help.

Thanks

Jeetu

Reply
0 Kudos
2 Replies
daphnissov
Immortal
Immortal

Take a look at this blog because it's a great resource for getting started with the API and even has Postman samples you can import.

Reply
0 Kudos
jeethualex
Contributor
Contributor

It is the example sample code I am using.

I am able to login and successfully get the token.

The vmware-api-session-id session cookie is also getting created.

However when I make the subsequent rest calls I am getting 404 response.

Even for system time (vmware-api-session-id)

I am not sure what headers should I use for the subsequent calls after login

Reply
0 Kudos