Webhooks
Register webhook
Register a new webhook and receive callbacks.
POST
/
api
/
admin
/
webhooks
Register webhook
curl --request POST \
--url https://{cluster_id}.on-hellgate.cloud/api/admin/webhooks \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"events": [],
"url": "<string>",
"hmac_key": "<string>"
}
'import requests
url = "https://{cluster_id}.on-hellgate.cloud/api/admin/webhooks"
payload = {
"events": [],
"url": "<string>",
"hmac_key": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({events: [], url: '<string>', hmac_key: '<string>'})
};
fetch('https://{cluster_id}.on-hellgate.cloud/api/admin/webhooks', 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://{cluster_id}.on-hellgate.cloud/api/admin/webhooks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'events' => [
],
'url' => '<string>',
'hmac_key' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/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://{cluster_id}.on-hellgate.cloud/api/admin/webhooks"
payload := strings.NewReader("{\n \"events\": [],\n \"url\": \"<string>\",\n \"hmac_key\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{cluster_id}.on-hellgate.cloud/api/admin/webhooks")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"events\": [],\n \"url\": \"<string>\",\n \"hmac_key\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{cluster_id}.on-hellgate.cloud/api/admin/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"events\": [],\n \"url\": \"<string>\",\n \"hmac_key\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "5d6b2c9a-9b0b-4b0c-8c7d-9e9d5d7e9d5d",
"created_at": "2023-10-05T14:48:00.000Z",
"url": "https://my-webhook-endpoint.com/webhooks",
"events": [
"network.token.updated",
"pci.token.security-code.expired"
],
"masked_hmac_key": "123xxxx"
}{
"code": 401,
"message": "No valid means of authentication was provided",
"classifier": "UNAUTHORIZED"
}{
"code": 403,
"message": "Not allowed to access this resource or feature",
"classifier": "FORBIDDEN"
}{
"code": 422,
"classifier": "VALIDATION_ERROR",
"message": "Validation error",
"validation_errors": [
{
"path": "json-path",
"message": "human readable error message"
}
]
}Authorizations
APIKeyAdminToken
Body
application/json
The list of events to subscribe to.
Minimum array length:
1The type of event that occurred.
Available options:
network.token.updated, pci.token.security-code.expired The URL to which the webhook will send event notifications.
The HMAC key to be used to sign the payloads sent to the webhook URL.
Response
Success response
The unique identifier for the webhook.
The timestamp when the webhook was created.
The list of events the webhook is subscribed to.
Minimum array length:
1The type of event that occurred.
Available options:
network.token.updated, pci.token.security-code.expired The URL to which the webhook sends event notifications.
The masked HMAC key used to sign the payloads sent to the webhook URL.
Example:
"123xxxx"
⌘I
Register webhook
curl --request POST \
--url https://{cluster_id}.on-hellgate.cloud/api/admin/webhooks \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"events": [],
"url": "<string>",
"hmac_key": "<string>"
}
'import requests
url = "https://{cluster_id}.on-hellgate.cloud/api/admin/webhooks"
payload = {
"events": [],
"url": "<string>",
"hmac_key": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({events: [], url: '<string>', hmac_key: '<string>'})
};
fetch('https://{cluster_id}.on-hellgate.cloud/api/admin/webhooks', 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://{cluster_id}.on-hellgate.cloud/api/admin/webhooks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'events' => [
],
'url' => '<string>',
'hmac_key' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/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://{cluster_id}.on-hellgate.cloud/api/admin/webhooks"
payload := strings.NewReader("{\n \"events\": [],\n \"url\": \"<string>\",\n \"hmac_key\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{cluster_id}.on-hellgate.cloud/api/admin/webhooks")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"events\": [],\n \"url\": \"<string>\",\n \"hmac_key\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{cluster_id}.on-hellgate.cloud/api/admin/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"events\": [],\n \"url\": \"<string>\",\n \"hmac_key\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "5d6b2c9a-9b0b-4b0c-8c7d-9e9d5d7e9d5d",
"created_at": "2023-10-05T14:48:00.000Z",
"url": "https://my-webhook-endpoint.com/webhooks",
"events": [
"network.token.updated",
"pci.token.security-code.expired"
],
"masked_hmac_key": "123xxxx"
}{
"code": 401,
"message": "No valid means of authentication was provided",
"classifier": "UNAUTHORIZED"
}{
"code": 403,
"message": "Not allowed to access this resource or feature",
"classifier": "FORBIDDEN"
}{
"code": 422,
"classifier": "VALIDATION_ERROR",
"message": "Validation error",
"validation_errors": [
{
"path": "json-path",
"message": "human readable error message"
}
]
}