/sessionsCreate a provider or tenant session
Exchanges basic credentials for a bearer token. Use administrator@system for provider scope, or user@org-name for tenant scope. The token is returned in the X-VMWARE-VCLOUD-ACCESS-TOKEN response header, not the body.
Parameters
| Parameter | In | Type | Description |
|---|---|---|---|
| Authorizationrequired | header | string | Basic <base64(user@org:password)>. |
| Acceptrequired | header | string | application/json;version=39.0. |
curl -i -X POST \
-H 'Accept: application/json;version=39.0' \
-u 'administrator@system:********' \
https://vcd.example.com/cloudapi/1.0.0/sessionsHTTP/1.1 200 OK
X-VMWARE-VCLOUD-ACCESS-TOKEN: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
{
"id": "urn:vcloud:session:6f4c2f9a-2e6e-4a2d-9d8b-1b6cf0f4a911",
"user": { "name": "administrator", "id": "urn:vcloud:user:0f0c..." },
"org": { "name": "System", "id": "urn:vcloud:org:a93c..." },
"operatingOrg": { "name": "System" },
"roles": ["System Administrator"]
}Note: Store the access token, not the credentials. Tokens expire with the configured session idle timeout - refresh rather than re-authenticating on every call.