Markdownで表示

WebhooksUnsubscribe

POST/v2/whks/unsubscribe
ベース URL
https://us1.proctorapi.com
利用可能なリージョン10 リージョン
配信停止リクエストは、以前に確立された Proctorio Webhook 通知へのサブスクリプションの終了を示します。
application/json

Body

配信停止リクエスト。

id
string必須
このリクエストには特定の Webhook の一意の値が含まれている必要があります。

レスポンス

200application/json

成功を示します。

400application/json

不正なリクエストを示します。

401application/json

未承認のレスポンスを示します。

2154 - アカウントが有効ではありません。

2155 - リージョンが正しくありません。

2655 - api_key が無効です。

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);
}
リクエスト例
{
  "id": "example-id-123"
}