SIP TN Leases
AssignTNLeasesToSIPConnection
POST https://api.opentact.org/rest/sip/connection/{uuid}/tnlease
Assign TN Leases to SIP connection.
Path Parameters
Name
Type
Description
uuid
string
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
Headers
Name
Type
Description
X-Auth-Token
string
JWT_TOKEN
Content-Type
string
application/json
Request Body
Name
Type
Description
add
string
array of strings List of TNLease uuids to be assigned
remove
string
Array of strings List of TNLease uuids to be removed
{
"success": true,
"payload": [
{
"created_on": "2019-08-24T14:15:22Z",
"modified_on": "2019-08-24T14:15:22Z",
"uuid": "string",
"tn": {},
"account": {},
"tnorder": {},
"expired_on": "2019-08-24T14:15:22Z",
"autorenew": true,
"messaging_profile": {},
"class4_product_item_id": 0,
"sip_connection": {},
"sip_control_app": {},
"created_by": {},
"modified_by": {}
}
]
}{
"success": false,
"message": "string",
"status": 400
}Code Example
curl -X POST "https://api.opentact.org/rest/sip/connection/66eb0a8a-571e-41b1-8f50-4d97275cfab7/tnlease" -H "accept: application/json" -H "X-Auth-Token: JWT_TOKEN" -H "Content-Type: application/json" \
-d "{\"add\":[\"string\"],\"remove\":[\"string\"]}"<?php
include('vendor/rmccue/requests/library/Requests.php');
Requests::register_autoloader();
$headers = array(
'accept' => 'application/json',
'X-Auth-Token' => 'JWT_TOKEN',
'Content-Type' => 'application/json'
);
$data = '{"add":["string"],"remove":["string"]}';
$response = Requests::post('https://api.opentact.org/rest/sip/connection/66eb0a8a-571e-41b1-8f50-4d97275cfab7/tnlease', $headers, $data);
import requests
headers = {
'accept': 'application/json',
'X-Auth-Token': 'JWT_TOKEN',
'Content-Type': 'application/json',
}
data = '{"add":["string"],"remove":["string"]}'
response = requests.post('https://api.opentact.org/rest/sip/connection/66eb0a8a-571e-41b1-8f50-4d97275cfab7/tnlease', headers=headers, data=data)
var fetch = require('node-fetch');
fetch('https://api.opentact.org/rest/sip/connection/66eb0a8a-571e-41b1-8f50-4d97275cfab7/tnlease', {
method: 'POST',
headers: {
'accept': 'application/json',
'X-Auth-Token': 'JWT_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({"add":["string"],"remove":["string"]})
});
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
"strings"
)
func main() {
client := &http.Client{}
var data = strings.NewReader(`{"add":["string"],"remove":["string"]}`)
req, err := http.NewRequest("POST", "https://api.opentact.org/rest/sip/connection/66eb0a8a-571e-41b1-8f50-4d97275cfab7/tnlease", data)
if err != nil {
log.Fatal(err)
}
req.Header.Set("accept", "application/json")
req.Header.Set("X-Auth-Token", "JWT_TOKEN")
req.Header.Set("Content-Type", "application/json")
resp, err := client.Do(req)
if err != nil {
log.Fatal(err)
}
bodyText, err := ioutil.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s\n", bodyText)
}
GETSIPConnectionTNLeasesList
GET https://api.opentact.org/rest/sip/connection/{uuid}/tnlease
Get SIP Connection assigned TNLease's
Path Parameters
Name
Type
Description
uuid
string
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
Headers
Name
Type
Description
X-Auth-Token
string
JWT_TOKEN
{
"success": true,
"payload": [
{
"created_on": "2019-08-24T14:15:22Z",
"modified_on": "2019-08-24T14:15:22Z",
"uuid": "string",
"tn": {},
"account": {},
"tnorder": {},
"expired_on": "2019-08-24T14:15:22Z",
"autorenew": true,
"messaging_profile": {},
"class4_product_item_id": 0,
"sip_connection": {},
"sip_control_app": {},
"created_by": {},
"modified_by": {}
}
]
}{
"success": false,
"message": "string",
"status": 401
}{
"success": false,
"message": "string",
"status": 404
}Code Example
curl -X GET "https://api.opentact.org/rest/sip/connection/66eb0a8a-571e-41b1-8f50-4d97275cfab7/tnlease" \
-H "accept: application/json" -H "X-Auth-Token: JWT_TOKEN"<?php
include('vendor/rmccue/requests/library/Requests.php');
Requests::register_autoloader();
$headers = array(
'accept' => 'application/json',
'X-Auth-Token' => 'JWT_TOKEN'
);
$response = Requests::get('https://api.opentact.org/rest/sip/connection/66eb0a8a-571e-41b1-8f50-4d97275cfab7/tnlease', $headers);
import requests
headers = {
'accept': 'application/json',
'X-Auth-Token': 'JWT_TOKEN',
}
response = requests.get('https://api.opentact.org/rest/sip/connection/66eb0a8a-571e-41b1-8f50-4d97275cfab7/tnlease', headers=headers)
var fetch = require('node-fetch');
fetch('https://api.opentact.org/rest/sip/connection/66eb0a8a-571e-41b1-8f50-4d97275cfab7/tnlease', {
headers: {
'accept': 'application/json',
'X-Auth-Token': 'JWT_TOKEN'
}
});
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
)
func main() {
client := &http.Client{}
req, err := http.NewRequest("GET", "https://api.opentact.org/rest/sip/connection/66eb0a8a-571e-41b1-8f50-4d97275cfab7/tnlease", nil)
if err != nil {
log.Fatal(err)
}
req.Header.Set("accept", "application/json")
req.Header.Set("X-Auth-Token", "JWT_TOKEN")
resp, err := client.Do(req)
if err != nil {
log.Fatal(err)
}
bodyText, err := ioutil.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s\n", bodyText)
}
Last updated
Was this helpful?