Zum Hauptinhalt springen
PATCH
/
webhooks
/
{id}
Update webhook
curl --request PATCH \
  --url https://coreapi.io/webhooks/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/merge-patch+json' \
  --data '
{
  "events": [
    "<string>"
  ],
  "version": "<string>",
  "enabled": true
}
'
import requests

url = "https://coreapi.io/webhooks/{id}"

payload = {
"events": ["<string>"],
"version": "<string>",
"enabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/merge-patch+json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/merge-patch+json'
},
body: JSON.stringify({events: ['<string>'], version: '<string>', enabled: true})
};

fetch('https://coreapi.io/webhooks/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://coreapi.io/webhooks/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'events' => [
'<string>'
],
'version' => '<string>',
'enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/merge-patch+json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
{
  "id": "<string>",
  "events": [
    "<string>"
  ],
  "version": "<string>",
  "enabled": true,
  "url": "<string>"
}

Autorisierungen

Authorization
string
header
erforderlich

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Pfadparameter

id
string
erforderlich

Webhook identifier

Body

The updated Webhook resource

events
string[]
version
string
enabled
boolean

Antwort

Webhook resource updated

id
string
read-only
events
string[]
version
string
enabled
boolean
url
string