vSphere Automation API
This is the vSphere REST API Reference. It provides API documentation, request/response samples, and usage description of the following vSphere services:
Getting Started with vSphere REST APIs in 5 Minutes
To get you started quickly let’s dive into the necessary steps to enable you to begin calling APIs.
Step 1 - Authenticate to the API Endpoint
The first setup is to create a session ID using the following API:
POST Create Session
Step 2 - Use the session ID in subsequent calls
On subsequent API calls you will need to include the session ID returned in the above call using an HTTP header as follows:
For more details on the API sessions you can refer Common Infrastruture Services documentation.
Step 3 - Create your first Virtual Machine
You have been authenticated and have retrieved your API session ID. Now, you can create your first virtual machine using this API:
POST Create VM
Step 4 - Get details about your VM
Once your VM is created, you can get the details of your VM by passing VM identifier
GET Get VM
Note: Some APIs from Vcenter -> Vcenter Deployment group need to be invoked on port 5480. The API contract on port 5480 is different than the one on port 443. Please refer to this KB article for more details.