VMware Cloud Community
jamesmohr
Contributor
Contributor

Getting "com.vmware.vapi.rest.httpNotFound" for everything

Newbie Alert!

I am working through this blog post: https://blogs.vmware.com/code/2017/02/02/getting-started-vsphere-automation-sdk-rest/
From within Postman, I can login successfully and get a session ID. However, with everything else I get "httpNotFound". For example, simply trying to list the hosts:

{

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

    "localizableMessages": [

        {

            "defaultMessage": "Not found.",

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

        }

    ],

    "majorErrorCode": 404

}


The only references I have found to this problem (or something similar) either point me to the blog post above, tell me to use the FQDN (which I am) or are using have a different problem and rthe solution does not apply. using the same credential, I can log into the VSphere web client and list resources with any problems.


Is there something on the server that I need to active in order to get this to work?

Well, I thought the login was successfull, but I am now getting

"type": "com.vmware.vapi.std.errors.unauthenticated"

However, I can still login successfully to the Web Client.

if I created a new environment with a different vCenter, I can login and get a session ID.  So I go back to the original environment and still get "unauthenticated". I now switch back to the enviroment that just worked and am now getting "unauthenticated" for the vCenter that worked 30 seconds ago!  So, I add a new vCenter and get a session ID when I login:

{

    "value": "102c88d6e396f36cf1c9d12d53001eb2"

}

Trying to get a list of hosts I get the "httpNotFound" error. I have tried clicking the "Logout" button and then "Login". But no matter what, once I am logged in once, everything just gives me "unauthenticated" or "httpNotFound".

Is this a Postman or vCenter problem?

Reply
0 Kudos
5 Replies
daphnissov
Immortal
Immortal

What version of vCenter? Can you show the REST request you're making for auth?

Reply
0 Kudos
jamesmohr
Contributor
Contributor

Thank you for your reply.
Version 6.0.0 Build 5318172

I am not sure if this is what you are asking, but this a screenshot from Postman:

vmware_forum01.png

Reply
0 Kudos
daphnissov
Immortal
Immortal

And are you sure {{vc}} is getting replaced with the FQDN of your vCenter appropriately? To test, hardcode that value and submit the auth request to see if it works.

Reply
0 Kudos
yogaahk
Contributor
Contributor

Hi James,

I'm facing the same issue as your case, do you have solve it? maybe you can share how to solve it.

In my case to consume Rest API VMware from Outsystems.

Thanks

Reply
0 Kudos
jzenoz
Contributor
Contributor

This error is also returned when using the wrong kind of request (GET vs POST), good to double check.