5.6

The Session element, which the API returns from a successful login, contains a link to the services for that
vCloud Air account. The client invokes the service link and receives a list of services. Each service contains a
serviceType, serviceId, and an href to the content for that service. The compute serviceType has the
following values:
n
compute:dedicatedcloud
n
compute:vpc
The vCloud Air automated subscription system assigns the value of the serviceId attribute.
Procedure
1 POST a request to this URL that includes your user name and password in a MIME Base64 encoding:
POST https://vchs.vmware.com/api/vchs/sessions
The initial POST requires that you enter the Authorization header with an encoded Base64
username:password value as shown:
Authorization: Basic <HelloUser@example.com:password>
Wherein HelloUser@example.com:password is encoded.
If the request is successful, the server returns the following items in the response:
Response Header: x-vchs-authorization:vchs-auth-token
<Session
...>
<Link
rel="down"
type="application/xml;class=vnd.vmware.vchs.servicelist"
href="https://vchs.vmware.com/api/vchs/services" />
</Session>
n
HTTP response code 201 Created
n
A response that contains the x-vchs-authorization
n
A response with a Session element that contains a link of type
application/xml;class=vnd.vmware.vchs.servicelist to get your list of subscribed compute
services in vCloud Air
2 From the Session response, use the value from the servicelist link and issue a GET request to retrieve
the list of services:
GET href="https://vchs.vmware.com/api/vchs/services"
3 In the request, include the vCloud Air authorization token:
x-vchs-authorization:vchs-auth-token
Include the x-vchs-authorization token in all subsequent API requests as a request header.
The returned response includes the list of services subscribed for your vCloud Air account. Each
Service element in the list has the following format:
<Services
...>
<Service
region="xs:string"
serviceId="xs:string"
vCloud Air Platform Programmer's Guide
16 VMware, Inc.