Order Telephone Number
CreateTNOrder
POST
https://api.opentact.org/rest/order/tn
Headers
Authorization
string
JWT_TOKEN
Content-Type
string
application/json
Request Body
autorenew
boolean
Default: "true"
voice
string
Default:"true"
Voice feature
fax
string
Fax feature
sms
boolean
SMS feature
Default: "true"
mms
boolean
MMS feature
emergency
boolean
Emergency feature
tns
string
Array of numbers <double> non-empty
Array of numbers to order
profile
string
[ 1 .. 255 ] characters
Default: US
TNProfile name
sip_connection
string
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
SIP Connection uuid
sip_control_app
string
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
SIP Control app uuid
{
"success": true,
"payload": {
"voice": true,
"fax": true,
"sms": true,
"mms": true,
"emergency": true,
"autorenew": true,
"state": "created",
"request": {
"voice": true,
"fax": true,
"sms": true,
"mms": true,
"emergency": true,
"tns": [
0
],
"autorenew": true,
"profile": "US"
},
"uuid": "e7fad289-f977-45bb-bc42-448d1290555c",
"price": null,
"created_on": "2020-10-28T10:47:28.270Z",
"modified_on": "2020-10-28T10:47:28.270Z"
}
}
{
"success": true,
"payload": {
"voice": true,
"fax": true,
"sms": true,
"mms": true,
"emergency": true,
"autorenew": true,
"state": "created",
"request": {
"voice": true,
"fax": true,
"sms": true,
"mms": true,
"emergency": true,
"tns": [
0
],
"autorenew": true,
"profile": "US"
},
"uuid": "e7fad289-f977-45bb-bc42-448d1290555c",
"price": null,
"created_on": "2020-10-28T10:47:28.270Z",
"modified_on": "2020-10-28T10:47:28.270Z"
}
}
{
"success": false,
"message": "Not enough account balance",
"status": 402
}
{
"success": false,
"message": "Not found",
"status": 404
}
Code Example
curl -X POST "https://api.opentact.org/rest/order/tn" \
-H "accept: application/json" \
-H "X-Auth-Token: JWT_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"voice\":true,\"fax\":true,\"sms\":true,\"mms\":true,\"emergency\":true,\"tns\":[0],\"autorenew\":true,\"profile\":\"string\",\"sip_connection\":\"string\",\"sip_control_app\":\"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 = '{"voice":true,"fax":true,"sms":true,"mms":true,"emergency":true,"tns":[0],"autorenew":true,"profile":"string","sip_connection":"string","sip_control_app":"string"}';
$response = Requests::post('https://api.opentact.org/rest/order/tn', $headers, $data);
import requests
headers = {
'accept': 'application/json',
'X-Auth-Token': 'JWT_TOKEN',
'Content-Type': 'application/json',
}
data = '{"voice":true,"fax":true,"sms":true,"mms":true,"emergency":true,"tns":[0],"autorenew":true,"profile":"string","sip_connection":"string","sip_control_app":"string"}'
response = requests.post('https://api.opentact.org/rest/order/tn', headers=headers, data=data)
var fetch = require('node-fetch');
fetch('https://api.opentact.org/rest/order/tn', {
method: 'POST',
headers: {
'accept': 'application/json',
'X-Auth-Token': 'JWT_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({"voice":true,"fax":true,"sms":true,"mms":true,"emergency":true,"tns":[0],"autorenew":true,"profile":"string","sip_connection":"string","sip_control_app":"string"})
});
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
"strings"
)
func main() {
client := &http.Client{}
var data = strings.NewReader(`{"voice":true,"fax":true,"sms":true,"mms":true,"emergency":true,"tns":[0],"autorenew":true,"profile":"string","sip_connection":"string","sip_control_app":"string"}`)
req, err := http.NewRequest("POST", "https://api.opentact.org/rest/order/tn", 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)
}
GetOrderPrice
POST
https://api.opentact.org/rest/order/price
Get order price
Headers
Authorization
string
JWT_TOKEN
Content-Type
string
application/json
Request Body
autorenew
boolean
Default: "true"
voice
string
Default:"true"
Voice feature
fax
string
Fax feature
sms
boolean
SMS feature
Default: "true"
mms
boolean
MMS feature
emergency
boolean
Emergency feature
tns
string
Array of numbers <double> non-empty
Array of numbers to order
profile
string
[ 1 .. 255 ] characters
Default: US
TNProfile name
sip_connection
string
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
SIP Connection uuid
sip_control_app
string
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
SIP Control app uuid
{
"success": true,
"payload": {
"nrc": 0,
"mrc": 0,
"items": [
{
"nrc": "0",
"mrc": "0",
"voice_nrc": "0",
"voice_mrc": "0",
"voice_incoming_per_min_cost": "0",
"voice_outgoing_per_min_cost": "0",
"fax_nrc": "0",
"fax_mrc": "0",
"fax_incoming_per_min_cost": "0",
"fax_outgoing_per_min_cost": "0",
"emergency_nrc": "0",
"emergency_mrc": "0",
"emergency_incoming_per_min_cost": "0",
"emergency_outgoing_per_min_cost": "0",
"sms_nrc": "0",
"sms_mrc": "0",
"sms_per_send_cost": "0",
"sms_per_receive_cost": "0",
"mms_nrc": "0",
"mms_mrc": "0",
"mms_per_send_cost": "0",
"mms_per_receive_cost": "0",
"id": "string",
"name": "string",
"description": "string"
}
]
}
}
{
"success": false,
"message": "Not found",
"status": 404
}
Code Example
curl -X POST "https://api.opentact.org/rest/order/price" -H "accept: application/json" -H "X-Auth-Token: JWT_TOKEN" -H "Content-Type: application/json" \
-d "{\"voice\":true,\"fax\":true,\"sms\":true,\"mms\":true,\"emergency\":true,\"tns\":[0],\"autorenew\":true,\"profile\":\"string\",\"sip_connection\":\"string\",\"sip_control_app\":\"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 = '{"voice":true,"fax":true,"sms":true,"mms":true,"emergency":true,"tns":[0],"autorenew":true,"profile":"string","sip_connection":"string","sip_control_app":"string"}';
$response = Requests::post('https://api.opentact.org/rest/order/price', $headers, $data);
import requests
headers = {
'accept': 'application/json',
'X-Auth-Token': 'JWT_TOKEN',
'Content-Type': 'application/json',
}
data = '{"voice":true,"fax":true,"sms":true,"mms":true,"emergency":true,"tns":[0],"autorenew":true,"profile":"string","sip_connection":"string","sip_control_app":"string"}'
response = requests.post('https://api.opentact.org/rest/order/price', headers=headers, data=data)
var fetch = require('node-fetch');
fetch('https://api.opentact.org/rest/order/price', {
method: 'POST',
headers: {
'accept': 'application/json',
'X-Auth-Token': 'JWT_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({"voice":true,"fax":true,"sms":true,"mms":true,"emergency":true,"tns":[0],"autorenew":true,"profile":"string","sip_connection":"string","sip_control_app":"string"})
});
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
"strings"
)
func main() {
client := &http.Client{}
var data = strings.NewReader(`{"voice":true,"fax":true,"sms":true,"mms":true,"emergency":true,"tns":[0],"autorenew":true,"profile":"string","sip_connection":"string","sip_control_app":"string"}`)
req, err := http.NewRequest("POST", "https://api.opentact.org/rest/order/price", 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)
}
ListOrders
POST
https://api.opentact.org/rest/order
This return the order list.
Headers
Authorization
string
JWT_TOKEN
Content-Type
string
application/json
{
"success": true,
"payload": {
"created_on": "2019-08-24T14:15:22Z",
"modified_on": "2019-08-24T14:15:22Z",
"uuid": "string",
"state": "created",
"tns": [],
"account": {},
"profile": {},
"sip_connection": {},
"sip_control_app": {},
"created_by": {},
"modified_by": {},
"request": {},
"price": {},
"autorenew": true,
"tnleases": []
}
}
{
"success": false,
"message": "Not enough account balance",
"status": 400
}
Code Example
curl -X GET "https://api.opentact.org/rest/order" \
-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/order', $headers);
import requests
headers = {
'accept': 'application/json',
'X-Auth-Token': 'JWT_TOKEN',
}
response = requests.get('https://api.opentact.org/rest/order', headers=headers)
var fetch = require('node-fetch');
fetch('https://api.opentact.org/rest/order', {
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/order", 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)
}
GetOrderByUUID
GET
https://api.opentact.org/rest/order/{uuid}
Get extended order info.
Path Parameters
uuid
string
Headers
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",
"state": "created",
"tns": [
{}
],
"account": {
"created_on": "2019-08-24T14:15:22Z",
"modified_on": "2019-08-24T14:15:22Z",
"uuid": "string",
"name": "string",
"email": "string",
"level": "ServiceAccount",
"balance": 0,
"class4_id": 0,
"deleted_on": "2019-08-24T14:15:22Z",
"time_zone": {},
"users": [],
"admin": {},
"messaging_profile_default": {},
"messaging_profiles": [],
"addresses": []
},
"profile": {
"created_on": "2019-08-24T14:15:22Z",
"modified_on": "2019-08-24T14:15:22Z",
"uuid": "string",
"name": "string",
"description": "string",
"priority": "high",
"tn_provider": {},
"toll_free": true,
"class4_client_billing_rule_id": 1,
"class4_vendor_res_id": 1,
"class4_vendor_billing_rule_id": 1,
"register_provider": {},
"nrc": 0,
"mrc": 0,
"sms_provider": {},
"sms_nrc": 0,
"sms_mrc": 0,
"sms_per_send_cost": 0,
"sms_per_receive_cost": 0,
"mms_nrc": 0,
"mms_mrc": 0,
"mms_per_send_cost": 0,
"mms_per_receive_cost": 0,
"voice_provider": {},
"voice_nrc": 0,
"voice_mrc": 0,
"voice_incoming_per_min_cost": 0,
"voice_outgoing_per_min_cost": 0,
"fax_nrc": 0,
"fax_mrc": 0,
"fax_incoming_per_min_cost": 0,
"fax_outgoing_per_min_cost": 0,
"emergency_nrc": 0,
"emergency_mrc": 0,
"emergency_incoming_per_min_cost": 0,
"emergency_outgoing_per_min_cost": 0
},
"sip_connection": {
"created_on": "2019-08-24T14:15:22Z",
"modified_on": "2019-08-24T14:15:22Z",
"uuid": "string",
"name": "string",
"is_active": true,
"tech_prefix": 0,
"product": {},
"subdomain": "string",
"ip": "string",
"port": 0,
"class4_ingress_trunk_id": 0,
"class4_ingress_trunk_settings": {},
"class4_ingress_resource_ip_id": 0,
"class4_egress_trunk_id": 0,
"class4_egress_trunk_settings": {},
"class4_egress_resource_ip_id": 0,
"class4_trunk_prefix_id": 0,
"tnleases": [],
"sipusers": [],
"sip_user_invites": [],
"account": {},
"created_by": {},
"modified_by": {},
"outbound_voice_profile": {}
},
"sip_control_app": {
"created_on": "2019-08-24T14:15:22Z",
"modified_on": "2019-08-24T14:15:22Z",
"uuid": "string",
"name": "string",
"is_active": true,
"subdomain": "string",
"tnleases": [],
"class4_egress_trunk_id": 0,
"class4_egress_trunk_settings": {},
"class4_egress_resource_ip_id": 0,
"account": {},
"created_by": {},
"modified_by": {},
"outbound_voice_profile": {},
"webhook_url": "string",
"webhook_method": "GET",
"webhook_request_timeout": 0,
"call_flow_url": "string",
"call_flow_request_timeout": 0,
"call_flow_method": "GET"
},
"created_by": {
"created_on": "2019-08-24T14:15:22Z",
"modified_on": "2019-08-24T14:15:22Z",
"uuid": "string",
"email": "string",
"password": "string",
"phone_number": "string",
"first_name": "string",
"last_name": "string",
"avatar": "string",
"gender": "Agender",
"dob": "2019-08-24T14:15:22Z",
"role": "Admin",
"gmail_user_id": "string",
"facebook_user_id": "string",
"apple_user_id": "string",
"wechat_user_id": "string",
"deleted_on": "2019-08-24T14:15:22Z",
"token": "string",
"account": {}
},
"modified_by": {
"created_on": "2019-08-24T14:15:22Z",
"modified_on": "2019-08-24T14:15:22Z",
"uuid": "string",
"email": "string",
"password": "string",
"phone_number": "string",
"first_name": "string",
"last_name": "string",
"avatar": "string",
"gender": "Agender",
"dob": "2019-08-24T14:15:22Z",
"role": "Admin",
"gmail_user_id": "string",
"facebook_user_id": "string",
"apple_user_id": "string",
"wechat_user_id": "string",
"deleted_on": "2019-08-24T14:15:22Z",
"token": "string",
"account": {}
},
"request": {
"voice": "true",
"fax": true,
"sms": "true",
"mms": true,
"emergency": true,
"tns": [],
"autorenew": true,
"profile": "US",
"sip_connection": "string",
"sip_control_app": "string"
},
"price": {
"nrc": 0,
"mrc": 0,
"items": []
},
"autorenew": true,
"tnleases": [
{}
]
}
}
{
"success": false,
"message": "Not enough account balance",
"status": 401
}
{
"success": false,
"message": "Not enough account balance",
"status": 404
}
Code Example
curl -X GET "https://api.opentact.org/rest/order/{uuid}" \
-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/order/{uuid}', $headers);
import requests
headers = {
'accept': 'application/json',
'X-Auth-Token': 'JWT_TOKEN',
}
response = requests.get('https://api.opentact.org/rest/order/%7Buuid%7D', headers=headers)
var fetch = require('node-fetch');
fetch('https://api.opentact.org/rest/order/{uuid}', {
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/order/{uuid}", 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?