Create a SipGateway
curl --request POST \
--url https://api.example.com/v1/SipGateways \
--header 'Content-Type: application/json' \
--data '
{
"inbound": true,
"ipv4": "54.172.60.2",
"outbound": false,
"port": "5060",
"voip_carrier_sid": "c10a0579-1229-4000-9a52-aa4a519a210f"
}
'import requests
url = "https://api.example.com/v1/SipGateways"
payload = {
"inbound": True,
"ipv4": "54.172.60.2",
"outbound": False,
"port": "5060",
"voip_carrier_sid": "c10a0579-1229-4000-9a52-aa4a519a210f"
}
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({
inbound: true,
ipv4: '54.172.60.2',
outbound: false,
port: '5060',
voip_carrier_sid: 'c10a0579-1229-4000-9a52-aa4a519a210f'
})
};
fetch('https://api.example.com/v1/SipGateways', 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.example.com/v1/SipGateways",
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([
'inbound' => true,
'ipv4' => '54.172.60.2',
'outbound' => false,
'port' => '5060',
'voip_carrier_sid' => 'c10a0579-1229-4000-9a52-aa4a519a210f'
]),
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.example.com/v1/SipGateways"
payload := strings.NewReader("{\n \"inbound\": true,\n \"ipv4\": \"54.172.60.2\",\n \"outbound\": false,\n \"port\": \"5060\",\n \"voip_carrier_sid\": \"c10a0579-1229-4000-9a52-aa4a519a210f\"\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.example.com/v1/SipGateways")
.header("Content-Type", "application/json")
.body("{\n \"inbound\": true,\n \"ipv4\": \"54.172.60.2\",\n \"outbound\": false,\n \"port\": \"5060\",\n \"voip_carrier_sid\": \"c10a0579-1229-4000-9a52-aa4a519a210f\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/SipGateways")
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 \"inbound\": true,\n \"ipv4\": \"54.172.60.2\",\n \"outbound\": false,\n \"port\": \"5060\",\n \"voip_carrier_sid\": \"c10a0579-1229-4000-9a52-aa4a519a210f\"\n}"
response = http.request(request)
puts response.read_body{
"sid": "a6576ff4-59af-47ae-9b55-46f28b2bf2f7"
}v1
Create a SipGateway
Creates a new SipGateway that will be associated with a VoipCarrier
POST
/
v1
/
SipGateways
Create a SipGateway
curl --request POST \
--url https://api.example.com/v1/SipGateways \
--header 'Content-Type: application/json' \
--data '
{
"inbound": true,
"ipv4": "54.172.60.2",
"outbound": false,
"port": "5060",
"voip_carrier_sid": "c10a0579-1229-4000-9a52-aa4a519a210f"
}
'import requests
url = "https://api.example.com/v1/SipGateways"
payload = {
"inbound": True,
"ipv4": "54.172.60.2",
"outbound": False,
"port": "5060",
"voip_carrier_sid": "c10a0579-1229-4000-9a52-aa4a519a210f"
}
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({
inbound: true,
ipv4: '54.172.60.2',
outbound: false,
port: '5060',
voip_carrier_sid: 'c10a0579-1229-4000-9a52-aa4a519a210f'
})
};
fetch('https://api.example.com/v1/SipGateways', 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.example.com/v1/SipGateways",
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([
'inbound' => true,
'ipv4' => '54.172.60.2',
'outbound' => false,
'port' => '5060',
'voip_carrier_sid' => 'c10a0579-1229-4000-9a52-aa4a519a210f'
]),
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.example.com/v1/SipGateways"
payload := strings.NewReader("{\n \"inbound\": true,\n \"ipv4\": \"54.172.60.2\",\n \"outbound\": false,\n \"port\": \"5060\",\n \"voip_carrier_sid\": \"c10a0579-1229-4000-9a52-aa4a519a210f\"\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.example.com/v1/SipGateways")
.header("Content-Type", "application/json")
.body("{\n \"inbound\": true,\n \"ipv4\": \"54.172.60.2\",\n \"outbound\": false,\n \"port\": \"5060\",\n \"voip_carrier_sid\": \"c10a0579-1229-4000-9a52-aa4a519a210f\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/SipGateways")
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 \"inbound\": true,\n \"ipv4\": \"54.172.60.2\",\n \"outbound\": false,\n \"port\": \"5060\",\n \"voip_carrier_sid\": \"c10a0579-1229-4000-9a52-aa4a519a210f\"\n}"
response = http.request(request)
puts response.read_body{
"sid": "a6576ff4-59af-47ae-9b55-46f28b2bf2f7"
}Body
application/json
Response
201 - application/json
Create a SipGateway
Example:
"a6576ff4-59af-47ae-9b55-46f28b2bf2f7"
⌘I

