Weergeven als Markdown

Authenticatie

Alle Proctorio API-verzoeken vereisen authenticatie met behulp van een API key. Uw API key identificeert uw integratie en autoriseert toegang tot Proctorio-services.

Een API Key verkrijgen

API keys worden verstrekt door uw Proctorio-accountmanager tijdens de integratie-installatie. Elke sleutel is:

  • Gekoppeld aan het account van uw organisatie
  • Beperkt tot specifieke regio's (AU, CA, DE, EU, IN, JP, SA, SG, UK, US)
  • Ingeschakeld voor de endpoints die uw integratie vereist

API Key-indeling

Uw API key bestaat uit twee delen:

api_key = {consumer_key}{MD5(secret)}
ComponentBeschrijving
consumer_keyUw unieke identificator (verstrekt tijdens de installatie)
secretUw geheime sleutel (verstrekt tijdens de installatie)
MD5(secret)De MD5-hash van uw geheime sleutel, in hexadecimaal in kleine letters

Sleutelindelingen die u kunt ontvangen

Afhankelijk van uw integratie-installatie kunt u inloggegevens ontvangen in een van twee indelingen:

Optie 1: Volledige API Key — Een enkele vooraf berekende tekenreeks die klaar is voor gebruik:

a1b2c3d4e5f67890a1b2c3d4e5f678906286c281a69bb4cd781276f71da08d53

Optie 2: Consumer Key + Secret — Twee afzonderlijke waarden die u combineert:

Consumer Key: a1b2c3d4e5f67890a1b2c3d4e5f67890
Secret:       12345678abcdef0012345678abcdef00

Om de volledige API key te berekenen vanuit Optie 2:

  1. Bereken de MD5-hash van uw geheime sleutel
  2. Voeg samen: {consumer_key}{md5_hash}

Voorbeeld: Berekening van de API Key

import hashlib

consumer_key = "a1b2c3d4e5f67890a1b2c3d4e5f67890"
secret = "12345678abcdef0012345678abcdef00"

# Compute MD5 hash of secret
md5_hash = hashlib.md5(secret.encode()).hexdigest()
# md5_hash = "6286c281a69bb4cd781276f71da08d53"

# Combine to form API key
api_key = consumer_key + md5_hash
# Result: a1b2c3d4e5f67890a1b2c3d4e5f678906286c281a69bb4cd781276f71da08d53
import { createHash } from 'crypto';

const consumerKey = 'a1b2c3d4e5f67890a1b2c3d4e5f67890';
const secret = '12345678abcdef0012345678abcdef00';

// Compute MD5 hash of secret
const md5Hash = createHash('md5').update(secret).digest('hex');
// md5Hash = "6286c281a69bb4cd781276f71da08d53"

// Combine to form API key
const apiKey = consumerKey + md5Hash;
// Result: a1b2c3d4e5f67890a1b2c3d4e5f678906286c281a69bb4cd781276f71da08d53

Uw API Key gebruiken

Voeg uw API key toe in de api_key-header van elk verzoek:

curl -X POST https://us1.proctorapi.com/v2/candidate/launch \
  -H "api_key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"launch_url": "https://..."}'

Header-indeling

HeaderWaardeVerplicht
api_keyUw API keyJa
Content-Typeapplication/jsonJa (voor POST-verzoeken)

Regionale endpoints

Uw API key is ingericht voor specifieke regio's. Gebruik het regionale endpoint dat overeenkomt met uw sleutel:

RegioBasis-URL
Australiehttps://au1.proctorapi.com
Canadahttps://ca1.proctorapi.com
Duitslandhttps://de1.proctorapi.com
Europahttps://eu1.proctorapi.com
Indiahttps://in1.proctorapi.com
Japanhttps://jp1.proctorapi.com
Zuid-Afrikahttps://sa1.proctorapi.com
Singaporehttps://sg1.proctorapi.com
Verenigd Koninkrijkhttps://uk1.proctorapi.com
Verenigde Statenhttps://us1.proctorapi.com

Het gebruik van de verkeerde regio retourneert een 401-fout met code 2155 - Incorrect region.

Foutmeldingen

Authenticatiefouten retourneren 401 Unauthorized met een van deze codes:

CodeBerichtBetekenis
2154Account niet actiefUw account is uitgeschakeld of opgeschort
2155Onjuiste regioDe API key is niet geldig voor dit regionale endpoint
2655Ongeldige api_keyDe API key ontbreekt, heeft een onjuiste indeling of is ingetrokken

Best practices voor beveiliging

  • Stel uw API key nooit bloot in client-side code, openbare repositories of browserverzoeken
  • Gebruik omgevingsvariabelen om sleutels op te slaan in uw serverapplicatie
  • Roteer sleutels periodiek door een nieuwe sleutel aan te vragen bij uw accountmanager
  • Gebruik aparte sleutels voor ontwikkel-/staging- en productieomgevingen
  • Monitor het gebruik via uw Proctorio-dashboard voor onverwachte activiteit

Voorbeeld: Gebruik van omgevingsvariabelen

import os
import requests

API_KEY = os.environ.get('PROCTORIO_API_KEY')

response = requests.post(
    'https://us1.proctorapi.com/v2/candidate/launch',
    headers={
        'api_key': API_KEY,
        'Content-Type': 'application/json'
    },
    json={'launch_url': 'https://...'}
)
const API_KEY = process.env.PROCTORIO_API_KEY;

const response = await fetch('https://us1.proctorapi.com/v2/candidate/launch', {
  method: 'POST',
  headers: {
    'api_key': API_KEY,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({ launch_url: 'https://...' })
});