Confirm a subscription with a token
curl --request POST \
--url https://notifications.{region}.basaltic.sh/v1/subscription-confirmations \
--header 'Content-Type: application/json' \
--data '
{
"token": "0lFqQyF5W3xJ0Zx2mE8t6bN1pKcR4vT7aY9uS3dG2hI"
}
'import requests
url = "https://notifications.{region}.basaltic.sh/v1/subscription-confirmations"
payload = { "token": "0lFqQyF5W3xJ0Zx2mE8t6bN1pKcR4vT7aY9uS3dG2hI" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({token: '0lFqQyF5W3xJ0Zx2mE8t6bN1pKcR4vT7aY9uS3dG2hI'})
};
fetch('https://notifications.{region}.basaltic.sh/v1/subscription-confirmations', 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://notifications.{region}.basaltic.sh/v1/subscription-confirmations",
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([
'token' => '0lFqQyF5W3xJ0Zx2mE8t6bN1pKcR4vT7aY9uS3dG2hI'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://notifications.{region}.basaltic.sh/v1/subscription-confirmations"
payload := strings.NewReader("{\n \"token\": \"0lFqQyF5W3xJ0Zx2mE8t6bN1pKcR4vT7aY9uS3dG2hI\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://notifications.{region}.basaltic.sh/v1/subscription-confirmations")
.header("Content-Type", "application/json")
.body("{\n \"token\": \"0lFqQyF5W3xJ0Zx2mE8t6bN1pKcR4vT7aY9uS3dG2hI\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://notifications.{region}.basaltic.sh/v1/subscription-confirmations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"token\": \"0lFqQyF5W3xJ0Zx2mE8t6bN1pKcR4vT7aY9uS3dG2hI\"\n}"
response = http.request(request)
puts response.read_body{
"subscription_id": "b2c3d4e5-6f7a-4b8c-9d0e-1f2a3b4c5d6e",
"endpoint": "https://hooks.example.com/basaltic",
"status": "confirmed",
"topic_name": "prod-alerts"
}{
"error": {
"code": "INVALID_INPUT",
"message": "Invalid request parameters",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "INVALID_INPUT",
"message": "Invalid request parameters",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}Confirmations
Confirm a subscription with a token
UNAUTHENTICATED. The party who confirms is whoever controls the subscribed endpoint — generally not the tenant who created the subscription — so the token is the credential and no platform credentials are required or accepted.
This is the programmatic half: a webhook subscriber receives the
token in a subscription_confirmation POST and hands it back
here.
POST
/
v1
/
subscription-confirmations
Confirm a subscription with a token
curl --request POST \
--url https://notifications.{region}.basaltic.sh/v1/subscription-confirmations \
--header 'Content-Type: application/json' \
--data '
{
"token": "0lFqQyF5W3xJ0Zx2mE8t6bN1pKcR4vT7aY9uS3dG2hI"
}
'import requests
url = "https://notifications.{region}.basaltic.sh/v1/subscription-confirmations"
payload = { "token": "0lFqQyF5W3xJ0Zx2mE8t6bN1pKcR4vT7aY9uS3dG2hI" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({token: '0lFqQyF5W3xJ0Zx2mE8t6bN1pKcR4vT7aY9uS3dG2hI'})
};
fetch('https://notifications.{region}.basaltic.sh/v1/subscription-confirmations', 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://notifications.{region}.basaltic.sh/v1/subscription-confirmations",
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([
'token' => '0lFqQyF5W3xJ0Zx2mE8t6bN1pKcR4vT7aY9uS3dG2hI'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://notifications.{region}.basaltic.sh/v1/subscription-confirmations"
payload := strings.NewReader("{\n \"token\": \"0lFqQyF5W3xJ0Zx2mE8t6bN1pKcR4vT7aY9uS3dG2hI\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://notifications.{region}.basaltic.sh/v1/subscription-confirmations")
.header("Content-Type", "application/json")
.body("{\n \"token\": \"0lFqQyF5W3xJ0Zx2mE8t6bN1pKcR4vT7aY9uS3dG2hI\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://notifications.{region}.basaltic.sh/v1/subscription-confirmations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"token\": \"0lFqQyF5W3xJ0Zx2mE8t6bN1pKcR4vT7aY9uS3dG2hI\"\n}"
response = http.request(request)
puts response.read_body{
"subscription_id": "b2c3d4e5-6f7a-4b8c-9d0e-1f2a3b4c5d6e",
"endpoint": "https://hooks.example.com/basaltic",
"status": "confirmed",
"topic_name": "prod-alerts"
}{
"error": {
"code": "INVALID_INPUT",
"message": "Invalid request parameters",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "INVALID_INPUT",
"message": "Invalid request parameters",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}Body
application/json
The token delivered to the endpoint.
Example:
"0lFqQyF5W3xJ0Zx2mE8t6bN1pKcR4vT7aY9uS3dG2hI"
Response
Subscription confirmed; delivery begins.