Complete guides, API references, and tutorials to help you get the most out of DefenSys security platform.
Get started quickly with these practical examples from our codebase
// Login User
const response = await fetch('/api/auth/login', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
email: 'user@example.com',
password: 'SecurePass123!'
})
});
const data = await response.json();
if (data.success) {
console.log('Logged in:', data.user);
// JWT token stored in httpOnly cookie
}// Create New Scan
const response = await fetch('/api/scans/create', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Production Website Scan',
targetUrl: 'https://example.com',
scanType: 'comprehensive'
})
});
const data = await response.json();
console.log('Scan ID:', data.scanId);// Get Scan Results
const scanId = 'your-scan-id';
const response = await fetch(`/api/scans/${scanId}`);
const data = await response.json();
console.log('Security Score:', data.scan.securityScore);
console.log('Total Vulnerabilities:',
data.scan.totalVulnerabilities);
console.log('Status:', data.scan.status);// Send Message to Admin
const response = await fetch('/api/messages', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
subject: 'Need Help',
message: 'I have a question about scan results...'
})
});
const data = await response.json();
console.log(data.message); // Message sent!Most accessed documentation by our community
Can't find what you're looking for? Our support team is here to help.