curl --request PUT \
--url https://api.smokeball.com/webhooks/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json-patch+json' \
--header 'x-api-key: <api-key>' \
--data '
{
"key": "da4e7fd1-5394-4ca9-b1c6-e18c4e2bf262",
"name": "Listen to matter and contact changes",
"eventTypes": [
"matter.updated",
"contact.created"
],
"eventNotificationUrl": "http://yourdomain.com/notify"
}
'import requests
url = "https://api.smokeball.com/webhooks/{id}"
payload = {
"key": "da4e7fd1-5394-4ca9-b1c6-e18c4e2bf262",
"name": "Listen to matter and contact changes",
"eventTypes": ["matter.updated", "contact.created"],
"eventNotificationUrl": "http://yourdomain.com/notify"
}
headers = {
"x-api-key": "<api-key>",
"Authorization": "<api-key>",
"Content-Type": "application/json-patch+json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'x-api-key': '<api-key>',
Authorization: '<api-key>',
'Content-Type': 'application/json-patch+json'
},
body: JSON.stringify({
key: 'da4e7fd1-5394-4ca9-b1c6-e18c4e2bf262',
name: 'Listen to matter and contact changes',
eventTypes: ['matter.updated', 'contact.created'],
eventNotificationUrl: 'http://yourdomain.com/notify'
})
};
fetch('https://api.smokeball.com/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://api.smokeball.com/webhooks/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'key' => 'da4e7fd1-5394-4ca9-b1c6-e18c4e2bf262',
'name' => 'Listen to matter and contact changes',
'eventTypes' => [
'matter.updated',
'contact.created'
],
'eventNotificationUrl' => 'http://yourdomain.com/notify'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json-patch+json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.smokeball.com/webhooks/{id}"
payload := strings.NewReader("{\n \"key\": \"da4e7fd1-5394-4ca9-b1c6-e18c4e2bf262\",\n \"name\": \"Listen to matter and contact changes\",\n \"eventTypes\": [\n \"matter.updated\",\n \"contact.created\"\n ],\n \"eventNotificationUrl\": \"http://yourdomain.com/notify\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json-patch+json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.smokeball.com/webhooks/{id}")
.header("x-api-key", "<api-key>")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"key\": \"da4e7fd1-5394-4ca9-b1c6-e18c4e2bf262\",\n \"name\": \"Listen to matter and contact changes\",\n \"eventTypes\": [\n \"matter.updated\",\n \"contact.created\"\n ],\n \"eventNotificationUrl\": \"http://yourdomain.com/notify\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.smokeball.com/webhooks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json-patch+json'
request.body = "{\n \"key\": \"da4e7fd1-5394-4ca9-b1c6-e18c4e2bf262\",\n \"name\": \"Listen to matter and contact changes\",\n \"eventTypes\": [\n \"matter.updated\",\n \"contact.created\"\n ],\n \"eventNotificationUrl\": \"http://yourdomain.com/notify\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"href": "<string>",
"relation": "<string>",
"method": "GET",
"self": {
"id": "<string>",
"href": "<string>",
"relation": "<string>",
"method": "GET"
},
"accountId": "da4e7fd1-5394-4ca9-b1c6-e18c4e2bf262",
"name": "Listen to matter and contact changes",
"eventTypes": [
"matter.updated",
"contact.created"
],
"eventNotificationUrl": "http://yourdomain.com/notify",
"createdDateUtc": "2022-04-23T14:00:00Z",
"updatedDateUtc": "2022-04-23T14:00:00Z",
"lastUpdated": 637847425252027400
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}Update a webhook subscription
Updates a webhook subscription with the specified subscription details.
curl --request PUT \
--url https://api.smokeball.com/webhooks/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json-patch+json' \
--header 'x-api-key: <api-key>' \
--data '
{
"key": "da4e7fd1-5394-4ca9-b1c6-e18c4e2bf262",
"name": "Listen to matter and contact changes",
"eventTypes": [
"matter.updated",
"contact.created"
],
"eventNotificationUrl": "http://yourdomain.com/notify"
}
'import requests
url = "https://api.smokeball.com/webhooks/{id}"
payload = {
"key": "da4e7fd1-5394-4ca9-b1c6-e18c4e2bf262",
"name": "Listen to matter and contact changes",
"eventTypes": ["matter.updated", "contact.created"],
"eventNotificationUrl": "http://yourdomain.com/notify"
}
headers = {
"x-api-key": "<api-key>",
"Authorization": "<api-key>",
"Content-Type": "application/json-patch+json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'x-api-key': '<api-key>',
Authorization: '<api-key>',
'Content-Type': 'application/json-patch+json'
},
body: JSON.stringify({
key: 'da4e7fd1-5394-4ca9-b1c6-e18c4e2bf262',
name: 'Listen to matter and contact changes',
eventTypes: ['matter.updated', 'contact.created'],
eventNotificationUrl: 'http://yourdomain.com/notify'
})
};
fetch('https://api.smokeball.com/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://api.smokeball.com/webhooks/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'key' => 'da4e7fd1-5394-4ca9-b1c6-e18c4e2bf262',
'name' => 'Listen to matter and contact changes',
'eventTypes' => [
'matter.updated',
'contact.created'
],
'eventNotificationUrl' => 'http://yourdomain.com/notify'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json-patch+json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.smokeball.com/webhooks/{id}"
payload := strings.NewReader("{\n \"key\": \"da4e7fd1-5394-4ca9-b1c6-e18c4e2bf262\",\n \"name\": \"Listen to matter and contact changes\",\n \"eventTypes\": [\n \"matter.updated\",\n \"contact.created\"\n ],\n \"eventNotificationUrl\": \"http://yourdomain.com/notify\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json-patch+json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.smokeball.com/webhooks/{id}")
.header("x-api-key", "<api-key>")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"key\": \"da4e7fd1-5394-4ca9-b1c6-e18c4e2bf262\",\n \"name\": \"Listen to matter and contact changes\",\n \"eventTypes\": [\n \"matter.updated\",\n \"contact.created\"\n ],\n \"eventNotificationUrl\": \"http://yourdomain.com/notify\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.smokeball.com/webhooks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json-patch+json'
request.body = "{\n \"key\": \"da4e7fd1-5394-4ca9-b1c6-e18c4e2bf262\",\n \"name\": \"Listen to matter and contact changes\",\n \"eventTypes\": [\n \"matter.updated\",\n \"contact.created\"\n ],\n \"eventNotificationUrl\": \"http://yourdomain.com/notify\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"href": "<string>",
"relation": "<string>",
"method": "GET",
"self": {
"id": "<string>",
"href": "<string>",
"relation": "<string>",
"method": "GET"
},
"accountId": "da4e7fd1-5394-4ca9-b1c6-e18c4e2bf262",
"name": "Listen to matter and contact changes",
"eventTypes": [
"matter.updated",
"contact.created"
],
"eventNotificationUrl": "http://yourdomain.com/notify",
"createdDateUtc": "2022-04-23T14:00:00Z",
"updatedDateUtc": "2022-04-23T14:00:00Z",
"lastUpdated": 637847425252027400
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}Path Parameters
Body
Unique key used for creating signature header in webhook notification requests.
"da4e7fd1-5394-4ca9-b1c6-e18c4e2bf262"
Name or description of the webhook subscription.
"Listen to matter and contact changes"
The event types that the webhook subscription should be subscribed to.
["matter.updated", "contact.created"]
The uri to notify when an event has occurred.
"http://yourdomain.com/notify"
Response
When request is successful. Returns updated webhook subscriptions.
Show child attributes
Show child attributes
Unique identifier of the associated account.
"da4e7fd1-5394-4ca9-b1c6-e18c4e2bf262"
Name or description of the subscription.
"Listen to matter and contact changes"
The event types that the webhook subscription is subscribed to.
["matter.updated", "contact.created"]
The uri to notify when an event has occurred.
"http://yourdomain.com/notify"
The webhook subscription creation date.
"2022-04-23T14:00:00Z"
The webhook subscription last updated date.
"2022-04-23T14:00:00Z"
Last updated timestamp
637847425252027400