Authentication
All CyberShield API requests require authentication using a Bearer Token. Every request must include your API key in the Authorization header. Requests without a valid token are rejected automatically.
How Authentication Works
| Step |
Description |
| 1. Obtain your API Key |
Provided through the CyberShield Console (Production or Sandbox). |
| 2. Add it to every request |
Include the key using the Authorization: Bearer <API_KEY> header. |
| 3. Use HTTPS |
All CyberShield endpoints require secure communication. |
| 4. Handle invalid or expired keys |
The API returns 401 Unauthorized or 403 Forbidden. |
| Header |
Value |
Description |
Authorization |
Bearer <YOUR_API_KEY> |
Authenticates every request |
Content-Type |
application/json |
Required for most API operations |
Example Requests
cURL
curl -X GET "https://api.cybershield.com/v1/report/12345" \
-H "Authorization: Bearer YOUR_API_KEY"
JavaScript (Node.js)
import axios from "axios";
const response = await axios.get(
"https://api.cybershield.com/v1/report/12345",
{
headers: {
Authorization: `Bearer ${process.env.CYBERSHIELD_KEY}`,
},
}
);
console.log(response.data);
Python
import requests
import os
api_key = os.getenv("CYBERSHIELD_KEY")
response = requests.get(
"https://api.cybershield.com/v1/report/12345",
headers={"Authorization": f"Bearer {api_key}"}
)
print(response.json())
Common Authentication Errors
| Status |
Meaning |
How to Fix |
| 401 – Unauthorized |
Missing or invalid API key |
Confirm that the header is Bearer YOUR_KEY |
| 403 – Forbidden |
Key is valid but lacks permissions |
Check environment (Production vs Sandbox) |
| 429 – Too Many Requests |
Rate limiting triggered |
Implement retry logic or reduce frequency |
Next Step
If you're done setting up authentication, continue to:
➡ Endpoints