-p-500.png)
Getting and Using Your TRACE Metrics API Key
To interact with the TRACE Metrics API, you must authenticate using a subscription key. This key uniquely identifies your account and enables secure access to the API.
Step 1: Sign in to CognitiveView
Go to app.cognitiveview.com
Log in with your account credentials.
Step 2: Navigate to System Settings
Once logged in, open the main menu.
Click on System Settings.
Step 3: Generate or View Your Subscription Key
In System Settings, locate the section labeled API Access or Subscription Key.
If a key is already available, copy it.
If not, click Generate Key to create a new one.
Step 4: Copy and Store Your Key Securely
Keep your subscription key in a safe location (e.g., password manager or environment variables).
Do not share it publicly or commit it to version control.
Using Your API Key in Requests
Ocp-Apim-Subscription-Key: Bearer YOUR_API_KEY
Example: cURL
curl -X POST https://api.cognitiveview.com/metrics \
-H "Content-Type: application/json" \
-H "Ocp-Apim-Subscription-Key: Bearer YOUR_API_KEY" \
-d @trace_payload.json
Example: Python
import requests
url = "https://api.cognitiveview.com/metrics"
headers = {
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "YOUR_API_KEY"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
Security Best Practices
Never post your API key in public repositories.
Rotate your keys periodically.
Use environment variables or a secrets manager to store keys.