A successful login request returns a Session element, which contains Link elements that reference the organizations that you are permitted to access.

Every authenticated user has an associated Session object that contains one or more Link elements. The set of Link elements in your Session is based on your role and privileges. Each of these elements includes a URL that you can use with a GET request to explore a subset of objects in the cloud.

All Session elements include a link that you can use to retrieve an OrgList element. Unless you are the system administrator, this list includes just the organization to which you logged in. For a system administrator, the list includes all organizations in the cloud.

Create a login session. See Create a Session Using Basic Authentication.

1

Retrieve the XML representation of your Session object.

Use a request like this one:

GET https://vcloud.example.com/api/session
2

Examine the contents of the Session element to locate the link to the organization list.

This link has the following form:

<Link
   rel="down"
   type="application/vnd.vmware.vcloud.orgList+xml"
   href="https://vcloud.example.com/api/org"/>
3

Retrieve the list of organizations by making a GET request to the href value of the Link.

See Example: Retrieve an Organization List.

Request:

GET https://vcloud.example.com/api/org

The request returns an OrgList element similar to the one shown here. Additional Org elements are returned only when a system administrator makes the request.

Response:

200 OK
Content-Type: application/vnd.vmware.vcloud.orgList+xml
...
<OrgList
   xmlns="http://www.vmware.com/vcloud/v1.5"
   type="application/vnd.vmware.vcloud.orgList+xml"
   href="https://vcloud.example.com/api/org">
   <Org
      type="application/vnd.vmware.vcloud.org+xml"
      name="ExampleOrg"
      href="https://vcloud.example.com/api/org/5" />
   <Org ... />
   <Org ... />
</OrgList>