This guide provides step-by-step instructions to authenticate with the CloudPe API using the provided ID and Secret Key.
Required Credentials
Before making the request, ensure you have the following credentials provided by the administrator:
ID: d638abac76884533######### (Sample ID)
Project_id: 997f026XXXXXXXXX83de1ce1e923 (Sample Project ID)
Secret Key: my_super_secret_pass (Sample Key)
>> You can refer to the article to Generate Credentials.
Note: Ensure the following tools are installed:
jq (for JSON parsing)
curl
Install curl
CentOS / RHEL / AlmaLinux / Rocky Linux
sudo yum install curl -y
Ubuntu / Debian
sudo apt update
sudo apt install curl -y
Install jq
Ubuntu / Debian
sudo apt update
sudo apt install -y jq
CentOS / RHEL / AlmaLinux
sudo yum install -y jq
Verify Installation:
jq –version
curl –version
Checking API Availability
To verify the API is reachable, use the following cURL command:
curl -kv https://in-west3.controlcloud.app:5000 (in-west3 Region)
curl -kv https://in-west2.controlcloud.app:5000 (in-west2 Region)
If the API is accessible, it should return response headers indicating the availability of the Keystone authentication service.
Note: The -k flag disables SSL certificate verification. This is acceptable for quick testing but should not be used in production scripts. In production, remove -k and ensure proper SSL certificate handling is in place.
Authentication Request
To authenticate, send a POST request with JSON payload to obtain a valid authentication token. Use the following cURL command:
RESPONSE=$(curl -ksD - -o /dev/null \
-H 'Content-Type: application/json' \
-d '{
"auth": {
"identity": {
"methods": ["application_credential"],
"application_credential": {
"id": "bb5a317514bb46eca0adf67544ad3f3d",
"secret": "Bvv4B-_ZWsX9EPR3jq8dKbLUp0wsjthKU-g92WR_SyWc0VLAAGQZmYZa-urISJePwEhxPKu4s7VzrCchCmLrKw"
}
}
}
}' https://in-west2.controlcloud.app:5000/v3/auth/tokens) \
&& echo "Status: $(echo "$RESPONSE" | head -1)" \
&& TOKEN=$(echo "$RESPONSE" | grep -i x-subject-token | awk '{print $2}' | tr -d '\r') \
&& echo "Token: $TOKEN"
Expected Response
If the authentication is successful, the API will return a 201 Created response along with an authentication token in the headers.

However, if authentication fails, you may receive a 401 Unauthorized response.
Troubleshooting
If you receive a 401 Unauthorized error:
- Check Credentials: Ensure that the ID and Secret Key are correct.
- Verify API Endpoint: Ensure you are using the correct authentication URL.
- Confirm API Availability: Run curl -kv https://in-west2.controlcloud.app:5000/ to verify if the API is responsive.
- Check User Permissions: Ensure that the provided credentials have the required permissions to access the API.
- Tokens are valid for 1 hour. If you get a
401on a previously working request, re-authenticate to get a new token.
What to do when a token expires: Simply re-run the authentication command to obtain a fresh token.
Checking Authenticated Session Details
To retrieve details about the authenticated session, including the user’s identity, roles, projects, and service endpoints, you can use the following API request:
curl -X GET "https://in-west2.controlcloud.app:5000/v3/auth/tokens" \
-H "X-Auth-Token: " \
-H "X-Subject-Token: " \
-H "Content-Type: application/json" | jq
Explanation:
X-Auth-Token: The authentication token obtained from the Identity service.X-Subject-Token: The same token to fetch details of the authenticated session.jq: Formats the JSON output for better readability.
This command will return details such as:
- User Identity: The authenticated user’s details.
- Roles: The roles assigned to the user.
- Projects: The projects the user has access to.
- Service Endpoints: The available service endpoints for different OpenStack services.
Conclusion
Once successfully authenticated, you will receive a token that can be used for subsequent API requests. Store the token securely and include it in the X-Auth-Token header for further API interactions.
Note:
Rate Limits: The CloudPe API enforces rate limiting to ensure fair usage. Avoid sending large bursts of requests in a short timeframe. If you receive 429 Too Many Requests, wait before retrying.