Hello,
So I was able to obtain the ZIP folder that contains the REST APIs from the reference this GitHub - vmware/vsphere-automation-sdk-rest: REST (Postman and JavaScript) samples and API reference documentation for v… . And follow videos from Youtube.
https://youtu.be/vq-7HLY74tQ
https://youtu.be/nr3pJovtbzM
We downloaded the vCenter appliance, installed it onto our servers, and are able to access the vSphere Client page as well as the vCenter Management UI.
However, I put in the necessary variables to reference for the IP address/host, username, and password for our vCenter on Postman.
I followed the steps to use the Authentication > Login API where the Request URL should look like: POST - https://{{vc}}/rest/com/vmware/cis/session
I successfully am able to obtain a session with the Response body being:
{
"value": ""
}
However, when I continue to say get a List of my datacenter or VMs, with the Request URL being: GET - https://{{vc}}/rest/vcenter/datacenter
I get an error message that states:
{
"type": "com.vmware.vapi.std.errors.internal_server_error",
"value": {
"messages": [
{
"args": [
"com.vmware.vapi.std.errors.Unauthorized"
],
"default_message": "Provider method implementation threw unexpected exception: com.vmware.vapi.std.errors.Unauthorized",
"id": "vapi.bindings.method.impl.unexpected"
},
{
"args": [],
"default_message": "Not authorized to perform this operation.",
"id": "com.vmware.api.vcenter.unauthorized"
}
]
}
}
What does this mean? How am I unauthorized if the correct credentials I provided in the Basic Authentication was accurate and gave me a valid session? How is there an Internal Server Error? Or how I am able to log into the browser to the VSphere client and management UI with those same credentials but cannot obtain anything from the APIs with the same information?
Please let me know your thoughts. Thanks!