Every cloud has a login URL that a client can obtain by making an unauthenticated GET request to the vCloud Director api/versions URL. The response to this request also lists vCloud API versions that the server supports.

1

Make an API version request to vCloud Director to obtain the login URL for the REST API.

See the request portion of Example: Versions Request and Response .

2

Examine the response to find the login URLs.

Each version of the vCloud API that the server supports has its own login URL. Look for a line of the following form:

<LoginUrl>http://vcloud.example.com/api/...</LoginUrl>
3

Use the login URL to log in to the cloud.

The api/versions request does not need to be authenticated. The response, a small subset of which is shown here, includes a VersionInfo element for each API version that the server supports. Each VersionInfo element contains:

A LoginUrl element that contains the URL to which a client can make a login request to access that version of the vCloud API. See Logging In.

MediaTypeMapping elements for each complex type supported by that version of the vCloud API.

Request:

GET http://vcloud.example.com/api/versions

Response:

200 OK
Content-Type: text/xml
...
<SupportedVersions
   xmlns="http://www.vmware.com/vcloud/versions"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.vmware.com/vcloud/versions
   http://vcloud.example.com/api/versions/schema/versions.xsd">
   <VersionInfo>
      <Version>1.5</Version>
      <LoginUrl>https://vcloud.example.com/api/login</LoginUrl>
      <MediaTypeMapping>
         <MediaType>application/vnd.vmware.vcloud.catalog+xml</MediaType>
         <ComplexTypeName>CatalogType</ComplexTypeName>
         <SchemaLocation>http://vcloud.example.com/api/v1.5/schema/master.xsd</SchemaLocation>
      </MediaTypeMapping>
      <MediaTypeMapping>
         ...
      </MediaTypeMapping>
  </VersionInfo>
  <VersionInfo>
      <Version>5.1</Version>
      <LoginUrl>https://vcloud.example.com/api/sessions</LoginUrl>
     <MediaTypeMapping>
         <MediaType>application/vnd.vmware.vcloud.catalog+xml</MediaType>
         <ComplexTypeName>CatalogType</ComplexTypeName>
         <SchemaLocation>http://vcloud.example.com/api/v1.5/schema/master.xsd</SchemaLocation>
      </MediaTypeMapping>
      <MediaTypeMapping>
         ...
      </MediaTypeMapping>
           ...
  </VersionInfo>
</SupportedVersions>
Note

You can use the URL in the SchemaLocation element with a GET request to retreive the file in which that complex type is defined. For example:

GET http://vcloud.example.com/api/v1.5/schema/master.xsd