BlinkExam Proctoring API Integration Documentation
Explore the API integration documentation for BlinkExam's proctoring service, designed to seamlessly embed remote monitoring features into your client's personal panel.
Overview
The BlinkExam Proctoring API Integration is a JavaScript module for integrating online proctoring into web applications. It supports camera and microphone checks, face detection, screen sharing, and photo/ID capture to monitor test-takers and prevent cheating. The API calculates a Trust Score and generates violation reports. It offers three proctoring modes: live, recorded, and combo, with recording options image or vScreen. This documentation guides developers on integrating the API using CDN-loaded scripts, compatible with vanilla JavaScript or frameworks like AngularJS.
Prerequisites
- Browser Compatibility: Modern browsers supporting WebRTC, Canvas, and MediaStream APIs (e.g., Chrome 90+, Firefox 88+, Edge 90+). Requires HTTPS.
- AngularJS: Optional, version 1.x for scope management if using AngularJS.
- WebRTC: For real-time communication in live and combo modes.
- Server Configuration: A window.apiConfig object with js_path pointing to CDN-hosted utility scripts.
- Service Access Key: Obtain a serviceAccessKey by requesting a demo.
Installation and Setup
Integrate the BlinkExam Proctoring API by loading its main script and utility scripts from a CDN. Scripts must be loaded sequentially to resolve dependencies.
Script Loading
Load the API and utilities on DOMContentLoaded.
window.apiConfig = { js_path: 'https://cdn.blinkexam.com' };
document.addEventListener('DOMContentLoaded', async () => {
// Load main API script
await loadScript('https://dqxf2of07o2qg.cloudfront.net/v2/blinkexam.min.js');
// Load utility scripts
const scriptUrls = [
`${window.apiConfig.js_path}/util/v2/variable.js`,
`${window.apiConfig.js_path}/util/v2/config.js`,
`${window.apiConfig.js_path}/util/v2/fileworker.js`,
`${window.apiConfig.js_path}/util/v2/mediaHandler.js`,
`${window.apiConfig.js_path}/util/v2/eventRecordingUtil.js`,
`${window.apiConfig.js_path}/util/v2/proctoringEvents.js`
];
await loadScriptsInOrder(scriptUrls);
// Load WebRTC and meeting scripts
await loadScriptsInOrder([
`${window.apiConfig.js_path}/util/v2/meetingv2.js`,
`${window.apiConfig.js_path}/util/v2/mzRTC.js`
]);
console.log('BlinkExam Proctoring API initialized');
});
async function loadScriptsInOrder(urls) {
for (const url of urls) {
await loadScript(url);
}
}
function loadScript(url) {
return new Promise((resolve, reject) => {
const script = document.createElement('script');
script.src = url;
script.async = true;
script.onload = resolve;
script.onerror = reject;
document.head.appendChild(script);
});
}Set window.apiConfig.js_path to your CDN base URL (e.g., https://cdn.blinkexam.com). Request a demo to obtain your serviceAccessKey.
Quick Setup
Before implementing the BlinkExam Proctoring API, you must connect with the BlinkExam team to obtain a serviceAccessKey. This key is essential for authenticating and enabling the API integration.
- Contact the BlinkExam team via info@thepioneerfuture.com or call +91 95828 74969 to request your serviceAccessKey.
- The BlinkExam team will provide the admin with a unique serviceAccessKey for your organization.
- Use this key in the API configuration (see Configuration section) to initialize the API.
Ensure you keep the serviceAccessKey secure and do not expose it publicly.
Accessing Functions
After loading the API scripts, functions are available globally under the BlinkExam namespace (e.g., BlinkExam.preCheckCameraAndMic). If no namespace is used, functions are attached to window.
Verify Availability:
if (typeof BlinkExam !== 'undefined') {
console.log('BlinkExam Proctoring API loaded');
} else {
console.error('BlinkExam Proctoring API not loaded');
}- Vanilla JavaScript: Call functions like
BlinkExam.preCheckCameraAndMic('localVideo', 'canvas_output'). - AngularJS (Optional): Use
$scopefor state management, e.g.,$scope.stream = await BlinkExam.preCheckCameraAndMic(...).
Configuration
Initialize the API with a configuration object passed to setConfig. The serviceAccessKey is mandatory for authentication.
Configuration Properties
| Property | Type | Required | Description |
|---|---|---|---|
| serviceAccessKey | String | Yes | Unique key from BlinkExam registration. |
| clientId | String | Yes | Client identifier. |
| testId | String | Yes | Test identifier. |
| candidateId | String | Yes | Candidate identifier. |
| proctorMode | String | Yes | Mode: recorded, live, or combo. |
| roomInfo.roomId | String | Yes | Session ID (e.g., ${serviceAccessKey}${testId}${batchId}). |
| attemptNumber | String | Yes | Attempt number for the session. |
| captureCandidate | Boolean | Yes | Enable candidate photo capture. |
| captureIdentity | Boolean | Yes | Enable ID capture. |
| faceAuth | Boolean | Yes | Enable face authentication. |
| roomInspection | Boolean | Yes | Enable room inspection. |
| inspectionType | String | Yes | Inspection mode: recorded or live. |
| recordingCategory | String | Yes | Recording type: image or vScreen. |
| containerId | String | Yes | ID of the HTML container for proctoring UI. |
| fileNamePrefix | String | Yes | File prefix (e.g., ${testId}_${candidateId}_${attemptNumber}). |
| position | Object | Yes | UI positions (e.g., { verification: 'center', id: 'center', liveCam: 'top-right' }). |
| preUploadPath | String | Yes | Temporary file storage path. |
Example Configuration
const config = {
serviceAccessKey: 'your-secret-key',
clientId: '1',
testId: '596',
candidateId: '323',
proctorMode: 'combo',
roomInfo: {
roomId: 'your-secret-key5962' // ${serviceAccessKey}${testId}${batchId}
},
attemptNumber: '1',
captureCandidate: true,
captureIdentity: true,
faceAuth: true,
roomInspection: true,
inspectionType: 'recorded',
recordingCategory: 'vScreen',
containerId: 'proctoringContainer',
fileNamePrefix: '596_323_1',
position: {
verification: 'center',
id: 'center',
liveCam: 'top-right'
},
preUploadPath: 'testResources'
};
BlinkExam.setConfig(config);Key Functions
Camera and Microphone Handling
BlinkExam.preCheckCameraAndMic(localVideoId, canvasId) — Checks camera and microphone availability.
Face Detection
BlinkExam.calculateFaceCount(video, canvas, callback) — Detects faces using machine learning models. Use BlinkExam.stopFaceDetection() to stop.
Screen Detection
BlinkExam.multipleScreensAttached() — Checks for multiple screens.
Photo and ID Capture
BlinkExam.capturePhotoAndIdCanva(videoId, canvasId) and BlinkExam.captureAndSubmitPhoto(id, errorHandler, submissionCallback, config) — Capture and submit photo or ID verification.
Proctoring Modes
BlinkExam.recordedImg()— Recorded proctoring with image capture.BlinkExam.recordedVScreen()— Recorded proctoring with video.BlinkExam.liveVScreen()— Live proctoring with screen sharing.BlinkExam.comboVScreen()— Combined live and recorded proctoring.
Usage Examples
See the live documentation for full recorded proctoring, photo capture, face detection, and AngularJS integration examples. All examples use the CDN script loading pattern shown above, followed by BlinkExam.setConfig(config) and the appropriate mode function.
Error Handling
Use try-catch blocks and error callbacks to handle issues like permission denials or script failures. Wrap calls to captureAndSubmitPhoto in try-catch and provide error handlers for ID and photo capture failures.
Troubleshooting
| Issue | Cause | Solution |
|---|---|---|
| preCheckCameraAndMic fails | Missing permissions | Prompt user to allow camera/mic; ensure HTTPS. |
| Script loading fails | Incorrect js_path | Verify window.apiConfig.js_path. |
| WebRTC errors | Browser incompatibility | Use Chrome/Firefox; ensure HTTPS. |
| Photo submission fails | Invalid endpoint | Check config.preUploadPath and server logs. |
Versioning
The API supports version v2 (window.proctorPluginVersion).
if (window.proctorPluginVersion === 'v2') {
BlinkExam.recordedImg();
} else {
console.warn('Unsupported API version');
}Pricing
For more information about API integration and pricing, contact us:
- Sales Enquiry: +91 95828 74969
- Support: info@thepioneerfuture.com
To get started, request a demo.
See BlinkExam in
action. Free for 7 days.
No credit card required. Get a personalized walkthrough with our solutions team and run a live pilot exam on your own candidates.
