VMware {code} Community
orangeqw
Contributor
Contributor

call: vcenter REST API ,result:"type":"com.vmware.vapi.std.errors.unauthenticated"

vcenter server 6.5 version (windows 2008 R2)

call vcenter  REST API in google chrome,

https://192.168.0.219/rest/vcenter/datacenter

result:

{"type":"com.vmware.vapi.std.errors.unauthenticated","value":{"messages":[{"args":[],"default_message":"This method requires authentication.","id":"vapi.method.authentication.required"}]}}
0 Kudos
5 Replies
daphnissov
Immortal
Immortal

You need to be addressing the REST API with a FQDN for vCenter and not IP.

0 Kudos
orangeqw
Contributor
Contributor

  • After trying, the progress is as follows:

  • call vcenter  REST API in google chrome,

  • https://dr4c1jco728bur5.nj.vcenter.com/rest/vcenter/datacenter

  • result:

  • {"type":"com.vmware.vapi.std.errors.unauthenticated","value":{"messages":[{"args":[],"default_message":"This method requires authentication.","id":"vapi.method.authentication.required"}]}}
0 Kudos
daphnissov
Immortal
Immortal

Did you get a token? The response suggests you did not.

0 Kudos
orangeqw
Contributor
Contributor

I can login "https://dr4c1jco728bur5.nj.vcenter.com/

user:administrator@vsphere.local  pass: XXXXXXXX

  • Does this have anything to do with token?

0 Kudos
daphnissov
Immortal
Immortal

No, please go back and read the documentation.

0 Kudos