Register SMS Webhook
curl --request POST \
--url https://sandbox-api.kotanipay.io/api/v3/sms/clients \
--header 'Content-Type: application/json' \
--data '
{
"webhookUrl": "https://myapp.com/webhooks/sms"
}
'import requests
url = "https://sandbox-api.kotanipay.io/api/v3/sms/clients"
payload = { "webhookUrl": "https://myapp.com/webhooks/sms" }
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({webhookUrl: 'https://myapp.com/webhooks/sms'})
};
fetch('https://sandbox-api.kotanipay.io/api/v3/sms/clients', 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://sandbox-api.kotanipay.io/api/v3/sms/clients",
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([
'webhookUrl' => 'https://myapp.com/webhooks/sms'
]),
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://sandbox-api.kotanipay.io/api/v3/sms/clients"
payload := strings.NewReader("{\n \"webhookUrl\": \"https://myapp.com/webhooks/sms\"\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://sandbox-api.kotanipay.io/api/v3/sms/clients")
.header("Content-Type", "application/json")
.body("{\n \"webhookUrl\": \"https://myapp.com/webhooks/sms\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.kotanipay.io/api/v3/sms/clients")
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 \"webhookUrl\": \"https://myapp.com/webhooks/sms\"\n}"
response = http.request(request)
puts response.read_bodySMS
Register SMS Webhook
Register a webhook client to receive SMS notifications
POST
/
api
/
v3
/
sms
/
clients
Register SMS Webhook
curl --request POST \
--url https://sandbox-api.kotanipay.io/api/v3/sms/clients \
--header 'Content-Type: application/json' \
--data '
{
"webhookUrl": "https://myapp.com/webhooks/sms"
}
'import requests
url = "https://sandbox-api.kotanipay.io/api/v3/sms/clients"
payload = { "webhookUrl": "https://myapp.com/webhooks/sms" }
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({webhookUrl: 'https://myapp.com/webhooks/sms'})
};
fetch('https://sandbox-api.kotanipay.io/api/v3/sms/clients', 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://sandbox-api.kotanipay.io/api/v3/sms/clients",
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([
'webhookUrl' => 'https://myapp.com/webhooks/sms'
]),
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://sandbox-api.kotanipay.io/api/v3/sms/clients"
payload := strings.NewReader("{\n \"webhookUrl\": \"https://myapp.com/webhooks/sms\"\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://sandbox-api.kotanipay.io/api/v3/sms/clients")
.header("Content-Type", "application/json")
.body("{\n \"webhookUrl\": \"https://myapp.com/webhooks/sms\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.kotanipay.io/api/v3/sms/clients")
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 \"webhookUrl\": \"https://myapp.com/webhooks/sms\"\n}"
response = http.request(request)
puts response.read_bodyRegister a webhook URL to receive real-time notifications for incoming SMS messages and delivery reports. Only one webhook can be registered per integrator account. Returns a
409 if a webhook is already registered — use the update endpoint to change it.Body
application/json
Webhook URL to receive SMS notifications
Example:
"https://myapp.com/webhooks/sms"
Response
201 - undefined
⌘I