Afficher en Markdown

WebhooksUnsubscribe

POST/v2/whks/unsubscribe
URL de base
https://us1.proctorapi.com
Régions disponibles10 régions
La requête de désabonnement marque la fin d'un abonnement précédemment établi aux notifications webhook de Proctorio.
application/json

Body

La requête de désabonnement.

id
stringObligatoire
Cette requête doit contenir une valeur unique pour le webhook spécifique.

Réponses

200application/json

Indique le succès.

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.

POST/v2/whks/unsubscribe
curl --request POST \
  --url https://us1.proctorapi.com/v2/whks/unsubscribe \
  --header 'Content-Type: application/json' \
  --header 'api_key: $API_KEY' \
  --data '{"id":"example-id-123"}'
import requests

url = "https://us1.proctorapi.com/v2/whks/unsubscribe"

payload = { "id": "example-id-123" }
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/unsubscribe';
const options = {
  method: 'POST',
  headers: {api_key: '$API_KEY', 'Content-Type': 'application/json'},
  body: '{"id":"example-id-123"}'
};

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/unsubscribe"),
    Headers =
    {
        { "api_key", "$API_KEY" },
    },
    Content = new StringContent("{\"id\":\"example-id-123\"}")
    {
        Headers =
        {
            ContentType = new MediaTypeHeaderValue("application/json")
        }
    }
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
Exemples de requête
{
  "id": "example-id-123"
}