json
{
"AccountId": "AID-1234567",
"WebhookUrl": "https://api.example.com/telegent/events",
"Method": "POST",
"DataFormat": "json",
"AuthenticationType": "Basic",
"AuthenticationUsername": "webhook_user",
"AuthenticationPassword": "s3cureP@ss",
"AuthenticationToken": "",
"SubscribedEvents": "Order_Update"
}curl -X POST https://api.telegent.com/v1.0/webhook/create \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"AccountId": "AID-1234567",
"WebhookUrl": "https://api.example.com/telegent/events",
"Method": "POST",
"DataFormat": "json",
"AuthenticationType": "Basic",
"AuthenticationUsername": "webhook_user",
"AuthenticationPassword": "s3cureP@ss",
"AuthenticationToken": "",
"SubscribedEvents": "Order_Update"
}'import requests
url = "https://api.telegent.com/v1.0/webhook/create"
payload = {
"AccountId": "<string>",
"WebhookUrl": "<string>",
"Method": "<string>",
"DataFormat": "<string>",
"AuthenticationType": "<string>",
"AuthenticationUsername": "<string>",
"AuthenticationPassword": "<string>",
"AuthenticationToken": "<string>",
"SubscribedEvents": "<string>"
}
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({
AccountId: '<string>',
WebhookUrl: '<string>',
Method: '<string>',
DataFormat: '<string>',
AuthenticationType: '<string>',
AuthenticationUsername: '<string>',
AuthenticationPassword: '<string>',
AuthenticationToken: '<string>',
SubscribedEvents: '<string>'
})
};
fetch('https://api.telegent.com/v1.0/webhook/create', 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.telegent.com/v1.0/webhook/create",
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([
'AccountId' => '<string>',
'WebhookUrl' => '<string>',
'Method' => '<string>',
'DataFormat' => '<string>',
'AuthenticationType' => '<string>',
'AuthenticationUsername' => '<string>',
'AuthenticationPassword' => '<string>',
'AuthenticationToken' => '<string>',
'SubscribedEvents' => '<string>'
]),
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://api.telegent.com/v1.0/webhook/create"
payload := strings.NewReader("{\n \"AccountId\": \"<string>\",\n \"WebhookUrl\": \"<string>\",\n \"Method\": \"<string>\",\n \"DataFormat\": \"<string>\",\n \"AuthenticationType\": \"<string>\",\n \"AuthenticationUsername\": \"<string>\",\n \"AuthenticationPassword\": \"<string>\",\n \"AuthenticationToken\": \"<string>\",\n \"SubscribedEvents\": \"<string>\"\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://api.telegent.com/v1.0/webhook/create")
.header("Content-Type", "application/json")
.body("{\n \"AccountId\": \"<string>\",\n \"WebhookUrl\": \"<string>\",\n \"Method\": \"<string>\",\n \"DataFormat\": \"<string>\",\n \"AuthenticationType\": \"<string>\",\n \"AuthenticationUsername\": \"<string>\",\n \"AuthenticationPassword\": \"<string>\",\n \"AuthenticationToken\": \"<string>\",\n \"SubscribedEvents\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.telegent.com/v1.0/webhook/create")
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 \"AccountId\": \"<string>\",\n \"WebhookUrl\": \"<string>\",\n \"Method\": \"<string>\",\n \"DataFormat\": \"<string>\",\n \"AuthenticationType\": \"<string>\",\n \"AuthenticationUsername\": \"<string>\",\n \"AuthenticationPassword\": \"<string>\",\n \"AuthenticationToken\": \"<string>\",\n \"SubscribedEvents\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"AccountId": "<string>",
"WebhookUrl": "<string>",
"Method": "<string>",
"DataFormat": "<string>",
"AuthenticationType": "<string>",
"AuthenticationUsername": "<string>",
"AuthenticationPassword": "<string>",
"AuthenticationToken": "<string>",
"SubscribedEvents": "<string>",
"WebhookId": "<string>",
"Active": true
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}Webhooks
Create Webhook
Register a webhook endpoint to receive event notifications from your Telegent account. Use this to subscribe to events such as order updates, message status changes, or other platform activity, with optional Basic or Token authentication for callback security.
Available subscribable events: Order_Update, New_Sms, Call_Completed, Call_On_Hold, Call_Recording, Call_In_Progress, Call_Ringing
After you register, Telegent POSTs a JSON payload to your Url each time a subscribed event fires. See Webhook Event Payloads for the delivered body shape per event type.
POST
/
v1.0
/
webhook
/
create
json
{
"AccountId": "AID-1234567",
"WebhookUrl": "https://api.example.com/telegent/events",
"Method": "POST",
"DataFormat": "json",
"AuthenticationType": "Basic",
"AuthenticationUsername": "webhook_user",
"AuthenticationPassword": "s3cureP@ss",
"AuthenticationToken": "",
"SubscribedEvents": "Order_Update"
}curl -X POST https://api.telegent.com/v1.0/webhook/create \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"AccountId": "AID-1234567",
"WebhookUrl": "https://api.example.com/telegent/events",
"Method": "POST",
"DataFormat": "json",
"AuthenticationType": "Basic",
"AuthenticationUsername": "webhook_user",
"AuthenticationPassword": "s3cureP@ss",
"AuthenticationToken": "",
"SubscribedEvents": "Order_Update"
}'import requests
url = "https://api.telegent.com/v1.0/webhook/create"
payload = {
"AccountId": "<string>",
"WebhookUrl": "<string>",
"Method": "<string>",
"DataFormat": "<string>",
"AuthenticationType": "<string>",
"AuthenticationUsername": "<string>",
"AuthenticationPassword": "<string>",
"AuthenticationToken": "<string>",
"SubscribedEvents": "<string>"
}
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({
AccountId: '<string>',
WebhookUrl: '<string>',
Method: '<string>',
DataFormat: '<string>',
AuthenticationType: '<string>',
AuthenticationUsername: '<string>',
AuthenticationPassword: '<string>',
AuthenticationToken: '<string>',
SubscribedEvents: '<string>'
})
};
fetch('https://api.telegent.com/v1.0/webhook/create', 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.telegent.com/v1.0/webhook/create",
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([
'AccountId' => '<string>',
'WebhookUrl' => '<string>',
'Method' => '<string>',
'DataFormat' => '<string>',
'AuthenticationType' => '<string>',
'AuthenticationUsername' => '<string>',
'AuthenticationPassword' => '<string>',
'AuthenticationToken' => '<string>',
'SubscribedEvents' => '<string>'
]),
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://api.telegent.com/v1.0/webhook/create"
payload := strings.NewReader("{\n \"AccountId\": \"<string>\",\n \"WebhookUrl\": \"<string>\",\n \"Method\": \"<string>\",\n \"DataFormat\": \"<string>\",\n \"AuthenticationType\": \"<string>\",\n \"AuthenticationUsername\": \"<string>\",\n \"AuthenticationPassword\": \"<string>\",\n \"AuthenticationToken\": \"<string>\",\n \"SubscribedEvents\": \"<string>\"\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://api.telegent.com/v1.0/webhook/create")
.header("Content-Type", "application/json")
.body("{\n \"AccountId\": \"<string>\",\n \"WebhookUrl\": \"<string>\",\n \"Method\": \"<string>\",\n \"DataFormat\": \"<string>\",\n \"AuthenticationType\": \"<string>\",\n \"AuthenticationUsername\": \"<string>\",\n \"AuthenticationPassword\": \"<string>\",\n \"AuthenticationToken\": \"<string>\",\n \"SubscribedEvents\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.telegent.com/v1.0/webhook/create")
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 \"AccountId\": \"<string>\",\n \"WebhookUrl\": \"<string>\",\n \"Method\": \"<string>\",\n \"DataFormat\": \"<string>\",\n \"AuthenticationType\": \"<string>\",\n \"AuthenticationUsername\": \"<string>\",\n \"AuthenticationPassword\": \"<string>\",\n \"AuthenticationToken\": \"<string>\",\n \"SubscribedEvents\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"AccountId": "<string>",
"WebhookUrl": "<string>",
"Method": "<string>",
"DataFormat": "<string>",
"AuthenticationType": "<string>",
"AuthenticationUsername": "<string>",
"AuthenticationPassword": "<string>",
"AuthenticationToken": "<string>",
"SubscribedEvents": "<string>",
"WebhookId": "<string>",
"Active": true
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}Body
application/jsontext/jsonapplication/*+json
Webhooks object
Response
Success