WebhooksSubscribe
URL de base
https://us1.proctorapi.comRégions disponibles10 régions
La requête d'abonnement formalise l'initiation d'un abonnement aux notifications webhook de Proctorio.
Paramètres de chemintypestringObligatoire1 - Type de webhook de calcul de suspicionapplication/jsonBody
type
stringObligatoire
1 - Type de webhook de calcul de suspicion
La requête d'abonnement.
behavior_settings
object
version
string
Version du webhook de calcul de suspicion auquel s'abonner. Les versions actuellement prises en charge sont '2' et '3'.
client
objectObligatoire
Réponses200application/jsonIndique le succès et renvoie la réponse d'abonnement.
400application/jsonIndique une requête incorrecte.
401application/jsonIndique une réponse non autorisée.
2154 - Compte non actif.
2155 - Région incorrecte.
2655 - api_key invalide.
200application/json
Indique le succès et renvoie la réponse d'abonnement.
400application/json
Indique une requête incorrecte.
401application/json
Indique une réponse non autorisée.
2154 - Compte non actif.
2155 - Région incorrecte.
2655 - api_key invalide.
curl --request POST \
--url https://us1.proctorapi.com/v2/whks/subscribe/%7Btype%7D \
--header 'Content-Type: application/json' \
--header 'api_key: $API_KEY' \
--data '{"client":{"url":"https://example.com","key":"string"}}' import requests
url = "https://us1.proctorapi.com/v2/whks/subscribe/%7Btype%7D"
payload = { "client": {
"url": "https://example.com",
"key": "string"
} }
headers = {
"api_key": "$API_KEY",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json()) const fetch = require('node-fetch');
const url = 'https://us1.proctorapi.com/v2/whks/subscribe/%7Btype%7D';
const options = {
method: 'POST',
headers: {api_key: '$API_KEY', 'Content-Type': 'application/json'},
body: '{"client":{"url":"https://example.com","key":"string"}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
} using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("https://us1.proctorapi.com/v2/whks/subscribe/%7Btype%7D"),
Headers =
{
{ "api_key", "$API_KEY" },
},
Content = new StringContent("{\"client\":{\"url\":\"https://example.com\",\"key\":\"string\"}}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
} {
"client": {
"url": "https://example.com",
"key": "string"
}
}