Skip to content

Authentication Guide ​

To authenticate against the vCloud Director API, a Base64-encoded string is required. This string must contain your credentials in the format username@organization:password.

You can generate the encoded string using the following command:

bash
echo -n 'myusername@myorg:mypassword' | base64

To verify that the encoded string is correct, decode it again:

bash
echo 'bXl1c2VybmFtZUBteW9yZzpteXBhc3N3b3Jk' | base64 -d

TIP

Be cautious when using special characters such as backslashes (\) or single quotes (') in your password. These may cause encoding issues, especially in shell environments. Make sure to properly escape such characters or wrap the input string in double quotes to avoid misinterpretation.

Once your credentials are correctly encoded, you can use the following curl command to retrieve a bearer token from the vCloud Director API:

bash
curl --location --request POST 'https://sci03.private.cloud.swisscom.ch/cloudapi/1.0.0/sessions' \
--header 'Accept: application/*;version=39.1' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic bXl1c2VybmFtZUBteW9yZzpteXBhc3N3b3Jk'

TIP

The API endpoint (URL) may vary depending on the region or placement of your cloud organization. Make sure you're targeting the correct instance.