AVOXI API Docs

AVOXI APIs

Badges

Endpoints can have badges under their title in the documentation below. These provide more information about their place in the API lifecycle and what to expect when attempting to use them.

  • Draft - The endpoint is under active development, unavailable to consumers, and subject to change. This is a great time to provide feedback.
  • Coming Soon - The endpoint is unavailable to consumers at this time, but the underlying schema and response structure have been finalized.
  • Deprecated - The endpoint currently works as described but will be removed in the future.

API SERVER

PROVISIONING

Countries used in AVOXI APIs

GET /countries

curl --request GET \
  --url https://genius.avoxi.com/api/v2/countries \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
const http = require("https");

const options = {
  "method": "GET",
  "hostname": "genius.avoxi.com",
  "port": null,
  "path": "/api/v2/countries",
  "headers": {
    "Authorization": "Bearer REPLACE_BEARER_TOKEN"
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://genius.avoxi.com/api/v2/countries");
xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

xhr.send(data);
import http.client

conn = http.client.HTTPSConnection("genius.avoxi.com")

headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

conn.request("GET", "/api/v2/countries", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.get("https://genius.avoxi.com/api/v2/countries")
  .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
  .asString();
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://genius.avoxi.com/api/v2/countries"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
var client = new RestClient("https://genius.avoxi.com/api/v2/countries");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
IRestResponse response = client.Execute(request);

Response

200

List of countries

[{
id: string
english_name: string
}]
[
{
id: "US",
english_name: "United States of America"
}
]

Where a number is allowed to forward to

GET /destinations/{country}/{number_type}

Given a country and number type, return the possible forwarding destinations, countries, SIP, and AVOXI services

 

Code Samples

curl --request GET \
  --url https://genius.avoxi.com/api/v2/destinations/{country}/{number_type}
const http = require("https");

const options = {
  "method": "GET",
  "hostname": "genius.avoxi.com",
  "port": null,
  "path": "/api/v2/destinations/{country}/{number_type}",
  "headers": {}
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://genius.avoxi.com/api/v2/destinations/{country}/{number_type}");

xhr.send(data);
import http.client

conn = http.client.HTTPSConnection("genius.avoxi.com")

conn.request("GET", "/api/v2/destinations/{country}/{number_type}")

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.get("https://genius.avoxi.com/api/v2/destinations/{country}/{number_type}")
  .asString();
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://genius.avoxi.com/api/v2/destinations/{country}/{number_type}"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
var client = new RestClient("https://genius.avoxi.com/api/v2/destinations/{country}/{number_type}");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);

Response

200

List of destinations

{
data: [{
id: string
name: string
default_destination: string
best_rate_dial_prefix: string
requires_user_input: boolean
}]
}
{
"data": [
{
"id": "US",
"name": "United States of America",
"default_destination": "+1",
"best_rate_dial_prefix": "+1404",
"requires_user_input": "1"
}
]
}

Response

400

Country or number type aren't allowed

OBJECT

{
message: string
error: {
}}
{
"message": "Invalid sip configuration",
"error": {
"message": "Invalid sip configuration",
"details": "invalid parameter"
}
}

Types of documents required to purchase a phone number

GET /document_types

There are different type of documents used throughout the world to prove ability to purchase a phone number. This API returns the different names AVOXI has for these documents. Document types rarely change and values are acceptable to be hard coded in client applications.

 

Code Samples

curl --request GET \
  --url https://genius.avoxi.com/api/v2/document_types \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
const http = require("https");

const options = {
  "method": "GET",
  "hostname": "genius.avoxi.com",
  "port": null,
  "path": "/api/v2/document_types",
  "headers": {
    "Authorization": "Bearer REPLACE_BEARER_TOKEN"
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://genius.avoxi.com/api/v2/document_types");
xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

xhr.send(data);
import http.client

conn = http.client.HTTPSConnection("genius.avoxi.com")

headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

conn.request("GET", "/api/v2/document_types", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.get("https://genius.avoxi.com/api/v2/document_types")
  .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
  .asString();
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://genius.avoxi.com/api/v2/document_types"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
var client = new RestClient("https://genius.avoxi.com/api/v2/document_types");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
IRestResponse response = client.Execute(request);
 

Response

200
[{
id: string
name: string
}]
[
{
"id": "passport_photo",
"name": "Passport Photo"
}
]

Current available inventory

GET /inventory/{country}

Returns phone numbers available for purchase in the given country, number_type, and region. Numbers are not reserved upon response and could be purchased by another user.

 

Code Samples

curl --request GET \
  --url 'https://genius.avoxi.com/api/v2/inventory/{country}?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE&contains=SOME_STRING_VALUE&sms_enabled=SOME_BOOLEAN_VALUE&exclude_all_documents_required=SOME_BOOLEAN_VALUE&exclude_documents=SOME_ARRAY_VALUE' \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
const http = require("https");

const options = {
  "method": "GET",
  "hostname": "genius.avoxi.com",
  "port": null,
  "path": "/api/v2/inventory/{country}?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE&contains=SOME_STRING_VALUE&sms_enabled=SOME_BOOLEAN_VALUE&exclude_all_documents_required=SOME_BOOLEAN_VALUE&exclude_documents=SOME_ARRAY_VALUE",
  "headers": {
    "Authorization": "Bearer REPLACE_BEARER_TOKEN"
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://genius.avoxi.com/api/v2/inventory/{country}?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE&contains=SOME_STRING_VALUE&sms_enabled=SOME_BOOLEAN_VALUE&exclude_all_documents_required=SOME_BOOLEAN_VALUE&exclude_documents=SOME_ARRAY_VALUE");
xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

xhr.send(data);
import http.client

conn = http.client.HTTPSConnection("genius.avoxi.com")

headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

conn.request("GET", "/api/v2/inventory/{country}?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE&contains=SOME_STRING_VALUE&sms_enabled=SOME_BOOLEAN_VALUE&exclude_all_documents_required=SOME_BOOLEAN_VALUE&exclude_documents=SOME_ARRAY_VALUE", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.get("https://genius.avoxi.com/api/v2/inventory/{country}?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE&contains=SOME_STRING_VALUE&sms_enabled=SOME_BOOLEAN_VALUE&exclude_all_documents_required=SOME_BOOLEAN_VALUE&exclude_documents=SOME_ARRAY_VALUE")
  .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
  .asString();
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://genius.avoxi.com/api/v2/inventory/{country}?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE&contains=SOME_STRING_VALUE&sms_enabled=SOME_BOOLEAN_VALUE&exclude_all_documents_required=SOME_BOOLEAN_VALUE&exclude_documents=SOME_ARRAY_VALUE"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
var client = new RestClient("https://genius.avoxi.com/api/v2/inventory/{country}?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE&contains=SOME_STRING_VALUE&sms_enabled=SOME_BOOLEAN_VALUE&exclude_all_documents_required=SOME_BOOLEAN_VALUE&exclude_documents=SOME_ARRAY_VALUE");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
IRestResponse response = client.Execute(request);

Response

200

A list of numbers matching the criteria 

[{
number_e164: string
number_local_format: string
country: string
number_type: string
region: string
required_documents: [{
document_type_id: string
name: string
more_information: string
}]
standard_capacity: string
geographic_restrictions: string
mobile_accessible: string
outside_country_display: string
portable: string
capabilities: {
sms: boolean
voice: boolean
}
}]
[
{
number_e164: "+528005551212",
number_local_format: "8005551212"
},
{
number_e164: "+528005551213",
number_local_format: "8005551213"
}
]

Response

400

The request could not be validated, e.g. a parameter was out of range or of an incorrect type

{
message: string
error: {
}
}
{
message: "Invalid sip configuration",
error:
{
message: "Invalid sip configuration",
details: "invalid parameter"
}
}

Response

401

The provided access token doesn't have permission to invoke this API

{
message: string
error: {
}
}
{
message: "Invalid sip configuration",
error:
{
message: "Invalid sip configuration",
details: "invalid parameter"
}
}

Current available inventory

GET /inventory/{country}/{number_type}

Returns phone numbers available for purchase in the given country, number_type, and region. Numbers are not reserved upon response and could be purchased by another user.

 

Code Samples

curl --request GET \
  --url 'https://genius.avoxi.com/api/v2/inventory/{country}/{number_type}?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE&contains=SOME_STRING_VALUE&sms_enabled=SOME_BOOLEAN_VALUE&exclude_all_documents_required=SOME_BOOLEAN_VALUE&exclude_documents=SOME_ARRAY_VALUE' \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
const http = require("https");

const options = {
  "method": "GET",
  "hostname": "genius.avoxi.com",
  "port": null,
  "path": "/api/v2/inventory/{country}/{number_type}?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE&contains=SOME_STRING_VALUE&sms_enabled=SOME_BOOLEAN_VALUE&exclude_all_documents_required=SOME_BOOLEAN_VALUE&exclude_documents=SOME_ARRAY_VALUE",
  "headers": {
    "Authorization": "Bearer REPLACE_BEARER_TOKEN"
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://genius.avoxi.com/api/v2/inventory/{country}/{number_type}?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE&contains=SOME_STRING_VALUE&sms_enabled=SOME_BOOLEAN_VALUE&exclude_all_documents_required=SOME_BOOLEAN_VALUE&exclude_documents=SOME_ARRAY_VALUE");
xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

xhr.send(data);
import http.client

conn = http.client.HTTPSConnection("genius.avoxi.com")

headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

conn.request("GET", "/api/v2/inventory/{country}/{number_type}?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE&contains=SOME_STRING_VALUE&sms_enabled=SOME_BOOLEAN_VALUE&exclude_all_documents_required=SOME_BOOLEAN_VALUE&exclude_documents=SOME_ARRAY_VALUE", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.get("https://genius.avoxi.com/api/v2/inventory/{country}/{number_type}?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE&contains=SOME_STRING_VALUE&sms_enabled=SOME_BOOLEAN_VALUE&exclude_all_documents_required=SOME_BOOLEAN_VALUE&exclude_documents=SOME_ARRAY_VALUE")
  .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
  .asString();
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://genius.avoxi.com/api/v2/inventory/{country}/{number_type}?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE&contains=SOME_STRING_VALUE&sms_enabled=SOME_BOOLEAN_VALUE&exclude_all_documents_required=SOME_BOOLEAN_VALUE&exclude_documents=SOME_ARRAY_VALUE"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
var client = new RestClient("https://genius.avoxi.com/api/v2/inventory/{country}/{number_type}?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE&contains=SOME_STRING_VALUE&sms_enabled=SOME_BOOLEAN_VALUE&exclude_all_documents_required=SOME_BOOLEAN_VALUE&exclude_documents=SOME_ARRAY_VALUE");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
IRestResponse response = client.Execute(request);
 

Response

200

A list of numbers matching the criteria 

[{
number_e164: string
number_local_format: string
country: string
number_type: string
region: string
required_documents: [{
document_type_id: string
name: string
more_information: string
}]
standard_capacity: string
geographic_restrictions: string
mobile_accessible: string
outside_country_display: string
portable: string
capabilities: {
sms: boolean
voice: boolean
}
}]
[
{
number_e164: "+528005551212",
number_local_format: "8005551212"
},
{
number_e164: "+528005551213",
number_local_format: "8005551213"
}
]

Response

400

The request could not be validated, e.g. a parameter was out of range or of an incorrect type

{
message: string
error: {
}
}
{
message: "Invalid sip configuration",
error:
{
message: "Invalid sip configuration",
details: "invalid parameter"
}
}

Response

401

The provided access token doesn't have permission to invoke this API

{
message: string
error: {
}
}
{
message: "Invalid sip configuration",
error:
{
message: "Invalid sip configuration",
details: "invalid parameter"
}
}

Types of phone numbers supported by AVOXI

GET /number_types

There are different type of phone numbers throughout the world. This API returns the different names AVOXI has for these numbers and their capabilities. Number types rarely change and values are acceptable to be hard coded in client applications

 

Code Samples

curl --request GET \
  --url https://genius.avoxi.com/api/v2/number_types \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
const http = require("https");

const options = {
  "method": "GET",
  "hostname": "genius.avoxi.com",
  "port": null,
  "path": "/api/v2/number_types",
  "headers": {
    "Authorization": "Bearer REPLACE_BEARER_TOKEN"
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://genius.avoxi.com/api/v2/number_types");
xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

xhr.send(data);
import http.client

conn = http.client.HTTPSConnection("genius.avoxi.com")

headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

conn.request("GET", "/api/v2/number_types", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.get("https://genius.avoxi.com/api/v2/number_types")
  .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
  .asString();
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://genius.avoxi.com/api/v2/number_types"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
var client = new RestClient("https://genius.avoxi.com/api/v2/number_types");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
IRestResponse response = client.Execute(request);

Response

200

List of number types

[{
name: string
description: string
}]
[
{
name: "itfs",
description: "International Toll Free. This type of number can be dialed internationally and the callee will pay necessary telephony charges. These numbers generally do not work as caller id"
}
]

Add phone number to account

POST /order

Add a phone number to your account. This API supports ordering one or more numbers that can be in stock or back ordered, with user selected or AVOXI selected numbers in a specific geography. If the API does not specify the product to use, the lowest monthly cost product will be selected for you

 

Code Samples

curl --request POST \
  --url https://genius.avoxi.com/api/v2/order \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
  --header 'content-type: application/json' \
  --data '{"contact_name":"string","reference_number":"string","items":[{"number_e164":"string","country":"string","number_type":"string","region":"string","product_id":"string","quantity":1}]}'
const http = require("https");

const options = {
  "method": "POST",
  "hostname": "genius.avoxi.com",
  "port": null,
  "path": "/api/v2/order",
  "headers": {
    "content-type": "application/json",
    "Authorization": "Bearer REPLACE_BEARER_TOKEN"
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({
  contact_name: 'string',
  reference_number: 'string',
  items: [
    {
      number_e164: 'string',
      country: 'string',
      number_type: 'string',
      region: 'string',
      product_id: 'string',
      quantity: 1
    }
  ]
}));
req.end();
const data = JSON.stringify({
  "contact_name": "string",
  "reference_number": "string",
  "items": [
    {
      "number_e164": "string",
      "country": "string",
      "number_type": "string",
      "region": "string",
      "product_id": "string",
      "quantity": 1
    }
  ]
});

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://genius.avoxi.com/api/v2/order");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

xhr.send(data);
import http.client

conn = http.client.HTTPSConnection("genius.avoxi.com")

payload = "{\"contact_name\":\"string\",\"reference_number\":\"string\",\"items\":[{\"number_e164\":\"string\",\"country\":\"string\",\"number_type\":\"string\",\"region\":\"string\",\"product_id\":\"string\",\"quantity\":1}]}"

headers = {
    'content-type': "application/json",
    'Authorization': "Bearer REPLACE_BEARER_TOKEN"
    }

conn.request("POST", "/api/v2/order", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.post("https://genius.avoxi.com/api/v2/order")
  .header("content-type", "application/json")
  .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
  .body("{\"contact_name\":\"string\",\"reference_number\":\"string\",\"items\":[{\"number_e164\":\"string\",\"country\":\"string\",\"number_type\":\"string\",\"region\":\"string\",\"product_id\":\"string\",\"quantity\":1}]}")
  .asString();
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://genius.avoxi.com/api/v2/order"

	payload := strings.NewReader("{\"contact_name\":\"string\",\"reference_number\":\"string\",\"items\":[{\"number_e164\":\"string\",\"country\":\"string\",\"number_type\":\"string\",\"region\":\"string\",\"product_id\":\"string\",\"quantity\":1}]}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/json")
	req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
var client = new RestClient("https://genius.avoxi.com/api/v2/order");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/json");
request.AddHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
request.AddParameter("application/json", "{\"contact_name\":\"string\",\"reference_number\":\"string\",\"items\":[{\"number_e164\":\"string\",\"country\":\"string\",\"number_type\":\"string\",\"region\":\"string\",\"product_id\":\"string\",\"quantity\":1}]}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);

Request

Contents of the order.

{
contact_name: string
reference_number: string
items: [{
number_e164: string
country: string
number_type: string
region: string
product_id: string
quantity: integer
}]
}
{
"contact_name": "string",
"reference_number": "string",
"items": [
{
"number_e164": "string",
"country": "string",
"number_type": "string",
"region": "string",
"product_id": "string",
"quantity": 1
}
]

Response

200

A list of numbers matching the criteria

{
data: {
reference_id: string
}
}
{
data:
{
reference_id: "abc123"
}
}

Response

400

The provided values don't correspond with each other, for example attempting to use a Toll Free package with a local number. The fields in conflict will be in the description field.

{
message: "Invalid sip configuration",
error:
{
message: "Invalid sip configuration",
details: "invalid parameter"
}
}
{
message: string
error: {
}
}

Response

401

The provided access token doesn't have permission to invoke this API

{
message: string
error: {
}
}
{
message: "Invalid sip configuration",
error:
{
message: "Invalid sip configuration",
details: "invalid parameter"
}
}

Location capabilities and cost information

GET /products/{country}

Returns coverage and pricing details about the products AVOXI offers in the given country, number_type, and/or region.

 

Code Samples

curl --request GET \
  --url https://genius.avoxi.com/api/v2/products/{country} \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
 

const http = require("https");

const options = {
  "method": "GET",
  "hostname": "genius.avoxi.com",
  "port": null,
  "path": "/api/v2/products/{country}",
  "headers": {
    "Authorization": "Bearer REPLACE_BEARER_TOKEN"
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
 

const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://genius.avoxi.com/api/v2/products/{country}");
xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

xhr.send(data);
 

import http.client

conn = http.client.HTTPSConnection("genius.avoxi.com")

headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

conn.request("GET", "/api/v2/products/{country}", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
 
HttpResponse<String> response = Unirest.get("https://genius.avoxi.com/api/v2/products/{country}")
  .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
  .asString();
 

package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://genius.avoxi.com/api/v2/products/{country}"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
 
var client = new RestClient("https://genius.avoxi.com/api/v2/products/{country}");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
IRestResponse response = client.Execute(request);
 

Response

200

A list of products grouped by their geography and type

{
_ISO Country code_: {
_Number Type_: {
_Region_: [{
id: string
name: string
monthly_fee: string
setup_fee: string
included_minutes: string
overage_fixed_rate_per_minute: string
overage_mobile_rate_per_minute: string
required_documents: [{
document_type_id: string
name: string
more_information: string
}]
standard_capacity: string
estimated_lead_time: string
geographic_restrictions: string
mobile_accessible: string
outside_country_display: string
portable: string
}]
}
}
}
{
US:
{
DID:
{
US GA Atlanta 470:
[
{
estimated_lead_time: "1 Days",
geographic_restrictions: "",
id: 487,
included_minutes: 0,
mobile_accessible: "Yes",
monthly_fee: 4.49,
name: "Business Classic",
outside_country_display: "Yes, In Most Cases",
overage_fixed_rate_per_minute: 0.04,
overage_mobile_rate_per_minute: 0.04,
portable: "Yes For more information please review your porting documentation. Review the KB for More details. https://support.avoxi.com/90307-porting/porting-availability?from_search=41872834",
required_documents: [ ],
setup_fee: 0,
standard_capacity: "Unlimited"
},
{
estimated_lead_time: "1 Days",
geographic_restrictions: "",
id: 488,
included_minutes: 430,
mobile_accessible: "Yes",
monthly_fee: 7.99,
name: "Business Basic",
outside_country_display: "Yes, In Most Cases",
overage_fixed_rate_per_minute: 0.035,
overage_mobile_rate_per_minute: 0.035,
portable: "Yes For more information please review your porting documentation. Review the KB for More details. https://support.avoxi.com/90307-porting/porting-availability?from_search=41872834",
required_documents: [ ],
setup_fee: 0,standard_capacity: "Unlimited"
},
{
estimated_lead_time: "1 Days",
geographic_restrictions: "",
id: 489,
included_minutes: 1151,
mobile_accessible: "Yes",
monthly_fee: 16.99,
name: "Business Connect",
outside_country_display: "Yes, In Most Cases",
overage_fixed_rate_per_minute: 0.028,
overage_mobile_rate_per_minute: 0.028,
portable: "Yes For more information please review your porting documentation. Review the KB for More details. https://support.avoxi.com/90307-porting/porting-availability?from_search=41872834",
required_documents: [ ],
setup_fee: 0,
standard_capacity: "Unlimited"
},
{
estimated_lead_time: "1 Days",
geographic_restrictions: "",
id: 490,
included_minutes: 2196,
mobile_accessible: "Yes",
monthly_fee: 25.99,name: "Business Standard",
outside_country_display: "Yes, In Most Cases",
overage_fixed_rate_per_minute: 0.024,
overage_mobile_rate_per_minute: 0.024,
portable: "Yes For more information please review your porting documentation. Review the KB for More details. https://support.avoxi.com/90307-porting/porting-availability?from_search=41872834",
required_documents: [ ],
setup_fee: 0,
standard_capacity: "Unlimited"
},
{
estimated_lead_time: "1 Days",
geographic_restrictions: "",
id: 491,
included_minutes: 4579,
mobile_accessible: "Yes",
monthly_fee: 43.99,
name: "Business Advanced",
outside_country_display: "Yes, In Most Cases",
overage_fixed_rate_per_minute: 0.015,
overage_mobile_rate_per_minute: 0.015,
portable: "Yes For more information please review your porting documentation. Review the KB for More details. https://support.avoxi.com/90307-porting/porting-availability?from_search=41872834",
required_documents: [ ],
setup_fee: 0,
standard_capacity: "Unlimited"
},
{
estimated_lead_time: "1 Days",
geographic_restrictions: "",
id: 492,
included_minutes: 8977,
mobile_accessible: "Yes",
monthly_fee: 70.99,
name: "Business Premium",
outside_country_display: "Yes, In Most Cases",
overage_fixed_rate_per_minute: 0.013,
overage_mobile_rate_per_minute: 0.013,
portable: "Yes For more information please review your porting documentation. Review the KB for More details. https://support.avoxi.com/90307-porting/porting-availability?from_search=41872834",
required_documents: [ ],
setup_fee: 0,
standard_capacity: "Unlimited"
}
]
}
}
}

Response

400

Either the country or number type (if provided) is not recognized by AVOXI

{
message: "Invalid sip configuration",
error:
{
message: "Invalid sip configuration",
details: "invalid parameter"
}
}
{
message: string
error: {
}
}

Response

401

The provided access token doesn't have permission to invoke this API

{
message: string
error: {
}
}
{
message: "Invalid sip configuration",
error:
{
message: "Invalid sip configuration",
details: "invalid parameter"
}
}

Location capabilities and cost information

GET /products/{country}/{number_type}

Returns coverage and pricing details about the products AVOXI offers in the given country, number_type, and/or region.

 

Code Samples

curl --request GET \
  --url https://genius.avoxi.com/api/v2/products/{country}/{number_type} \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
 
const http = require("https");

const options = {
  "method": "GET",
  "hostname": "genius.avoxi.com",
  "port": null,
  "path": "/api/v2/products/{country}/{number_type}",
  "headers": {
    "Authorization": "Bearer REPLACE_BEARER_TOKEN"
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
 
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://genius.avoxi.com/api/v2/products/{country}/{number_type}");
xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

xhr.send(data);
 
import http.client

conn = http.client.HTTPSConnection("genius.avoxi.com")

headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

conn.request("GET", "/api/v2/products/{country}/{number_type}", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.get("https://genius.avoxi.com/api/v2/products/{country}/{number_type}")
  .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
  .asString();
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://genius.avoxi.com/api/v2/products/{country}/{number_type}"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
 
var client = new RestClient("https://genius.avoxi.com/api/v2/products/{country}/{number_type}");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
IRestResponse response = client.Execute(request)
 

Response

200

A list of products grouped by their geography and type

{
_ISO Country code_: {
_Number Type_: {
_Region_: [{
id: string
name: string
monthly_fee: string
setup_fee: string
included_minutes: string
overage_fixed_rate_per_minute: string
overage_mobile_rate_per_minute: string
required_documents: [{
document_type_id: string
name: string
more_information: string
}]
standard_capacity: string
estimated_lead_time: string
geographic_restrictions: string
mobile_accessible: string
outside_country_display: string
portable: string
}]
}
}
}
{
US:
{
DID:
{
US GA Atlanta 470:
[
{
estimated_lead_time: "1 Days",
geographic_restrictions: "",
id: 487,
included_minutes: 0,
mobile_accessible: "Yes",
monthly_fee: 4.49,
name: "Business Classic",
outside_country_display: "Yes, In Most Cases",
overage_fixed_rate_per_minute: 0.04,
overage_mobile_rate_per_minute: 0.04,
portable: "Yes For more information please review your porting documentation. Review the KB for More details. https://support.avoxi.com/90307-porting/porting-availability?from_search=41872834",
required_documents: [ ],
setup_fee: 0,
standard_capacity: "Unlimited"
},
{
estimated_lead_time: "1 Days",
geographic_restrictions: "",
id: 488,
included_minutes: 430,
mobile_accessible: "Yes",
monthly_fee: 7.99,
name: "Business Basic",
outside_country_display: "Yes, In Most Cases",
overage_fixed_rate_per_minute: 0.035,
overage_mobile_rate_per_minute: 0.035,
portable: "Yes For more information please review your porting documentation. Review the KB for More details. https://support.avoxi.com/90307-porting/porting-availability?from_search=41872834",
required_documents: [ ],
setup_fee: 0,standard_capacity: "Unlimited"
},
{
estimated_lead_time: "1 Days",
geographic_restrictions: "",
id: 489,
included_minutes: 1151,
mobile_accessible: "Yes",
monthly_fee: 16.99,
name: "Business Connect",
outside_country_display: "Yes, In Most Cases",
overage_fixed_rate_per_minute: 0.028,
overage_mobile_rate_per_minute: 0.028,
portable: "Yes For more information please review your porting documentation. Review the KB for More details. https://support.avoxi.com/90307-porting/porting-availability?from_search=41872834",
required_documents: [ ],
setup_fee: 0,
standard_capacity: "Unlimited"
},
{
estimated_lead_time: "1 Days",
geographic_restrictions: "",
id: 490,
included_minutes: 2196,
mobile_accessible: "Yes",
monthly_fee: 25.99,name: "Business Standard",
outside_country_display: "Yes, In Most Cases",
overage_fixed_rate_per_minute: 0.024,
overage_mobile_rate_per_minute: 0.024,
portable: "Yes For more information please review your porting documentation. Review the KB for More details. https://support.avoxi.com/90307-porting/porting-availability?from_search=41872834",
required_documents: [ ],
setup_fee: 0,
standard_capacity: "Unlimited"
},
{
estimated_lead_time: "1 Days",
geographic_restrictions: "",
id: 491,
included_minutes: 4579,
mobile_accessible: "Yes",
monthly_fee: 43.99,
name: "Business Advanced",
outside_country_display: "Yes, In Most Cases",
overage_fixed_rate_per_minute: 0.015,
overage_mobile_rate_per_minute: 0.015,
portable: "Yes For more information please review your porting documentation. Review the KB for More details. https://support.avoxi.com/90307-porting/porting-availability?from_search=41872834",
required_documents: [ ],
setup_fee: 0,
standard_capacity: "Unlimited"
},
{
estimated_lead_time: "1 Days",
geographic_restrictions: "",
id: 492,
included_minutes: 8977,
mobile_accessible: "Yes",
monthly_fee: 70.99,
name: "Business Premium",
outside_country_display: "Yes, In Most Cases",
overage_fixed_rate_per_minute: 0.013,
overage_mobile_rate_per_minute: 0.013,
portable: "Yes For more information please review your porting documentation. Review the KB for More details. https://support.avoxi.com/90307-porting/porting-availability?from_search=41872834",
required_documents: [ ],
setup_fee: 0,
standard_capacity: "Unlimited"
}
]
}
}
}

Response

400

Either the country or number type (if provided) is not recognized by AVOXI

{
message: "Invalid sip configuration",
error:
{
message: "Invalid sip configuration",
details: "invalid parameter"
}
}
{
message: string
error: {
}
}

Response

401

The provided access token doesn't have permission to invoke this API

{
message: string
error: {
}
}
{
message: "Invalid sip configuration",
error:
{
message: "Invalid sip configuration",
details: "invalid parameter"
}
}

Location capabilities and cost information

GET /products/{country}/{number_type}/{region}

Returns coverage and pricing details about the products AVOXI offers in the given country, number_type, and/or region.

 

Code Samples

curl --request GET \
  --url https://genius.avoxi.com/api/v2/products/{country}/{number_type}/{region} \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
 
const http = require("https");

const options = {
  "method": "GET",
  "hostname": "genius.avoxi.com",
  "port": null,
  "path": "/api/v2/products/{country}/{number_type}/{region}",
  "headers": {
    "Authorization": "Bearer REPLACE_BEARER_TOKEN"
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
 
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://genius.avoxi.com/api/v2/products/{country}/{number_type}/{region}");
xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

xhr.send(data);
import http.client

conn = http.client.HTTPSConnection("genius.avoxi.com")

headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

conn.request("GET", "/api/v2/products/{country}/{number_type}/{region}", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.get("https://genius.avoxi.com/api/v2/products/{country}/{number_type}/{region}")
  .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
  .asString();
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://genius.avoxi.com/api/v2/products/{country}/{number_type}/{region}"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
 
var client = new RestClient("https://genius.avoxi.com/api/v2/products/{country}/{number_type}/{region}");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
IRestResponse response = client.Execute(request);

Response

200

A list of products grouped by their geography and type

{
_ISO Country code_: {
_Number Type_: {
_Region_: [{
id: string
name: string
monthly_fee: string
setup_fee: string
included_minutes: string
overage_fixed_rate_per_minute: string
overage_mobile_rate_per_minute: string
required_documents: [{
document_type_id: string
name: string
more_information: string
}]
standard_capacity: string
estimated_lead_time: string
geographic_restrictions: string
mobile_accessible: string
outside_country_display: string
portable: string
}]
}
}
}
{
US:
{
DID:
{
US GA Atlanta 470:
[
{
estimated_lead_time: "1 Days",
geographic_restrictions: "",
id: 487,
included_minutes: 0,
mobile_accessible: "Yes",
monthly_fee: 4.49,
name: "Business Classic",
outside_country_display: "Yes, In Most Cases",
overage_fixed_rate_per_minute: 0.04,
overage_mobile_rate_per_minute: 0.04,
portable: "Yes For more information please review your porting documentation. Review the KB for More details. https://support.avoxi.com/90307-porting/porting-availability?from_search=41872834",
required_documents: [ ],
setup_fee: 0,
standard_capacity: "Unlimited"
},
{
estimated_lead_time: "1 Days",
geographic_restrictions: "",
id: 488,
included_minutes: 430,
mobile_accessible: "Yes",
monthly_fee: 7.99,
name: "Business Basic",
outside_country_display: "Yes, In Most Cases",
overage_fixed_rate_per_minute: 0.035,
overage_mobile_rate_per_minute: 0.035,
portable: "Yes For more information please review your porting documentation. Review the KB for More details. https://support.avoxi.com/90307-porting/porting-availability?from_search=41872834",
required_documents: [ ],
setup_fee: 0,standard_capacity: "Unlimited"
},
{
estimated_lead_time: "1 Days",
geographic_restrictions: "",
id: 489,
included_minutes: 1151,
mobile_accessible: "Yes",
monthly_fee: 16.99,
name: "Business Connect",
outside_country_display: "Yes, In Most Cases",
overage_fixed_rate_per_minute: 0.028,
overage_mobile_rate_per_minute: 0.028,
portable: "Yes For more information please review your porting documentation. Review the KB for More details. https://support.avoxi.com/90307-porting/porting-availability?from_search=41872834",
required_documents: [ ],
setup_fee: 0,
standard_capacity: "Unlimited"
},
{
estimated_lead_time: "1 Days",
geographic_restrictions: "",
id: 490,
included_minutes: 2196,
mobile_accessible: "Yes",
monthly_fee: 25.99,name: "Business Standard",
outside_country_display: "Yes, In Most Cases",
overage_fixed_rate_per_minute: 0.024,
overage_mobile_rate_per_minute: 0.024,
portable: "Yes For more information please review your porting documentation. Review the KB for More details. https://support.avoxi.com/90307-porting/porting-availability?from_search=41872834",
required_documents: [ ],
setup_fee: 0,
standard_capacity: "Unlimited"
},
{
estimated_lead_time: "1 Days",
geographic_restrictions: "",
id: 491,
included_minutes: 4579,
mobile_accessible: "Yes",
monthly_fee: 43.99,
name: "Business Advanced",
outside_country_display: "Yes, In Most Cases",
overage_fixed_rate_per_minute: 0.015,
overage_mobile_rate_per_minute: 0.015,
portable: "Yes For more information please review your porting documentation. Review the KB for More details. https://support.avoxi.com/90307-porting/porting-availability?from_search=41872834",
required_documents: [ ],
setup_fee: 0,
standard_capacity: "Unlimited"
},
{
estimated_lead_time: "1 Days",
geographic_restrictions: "",
id: 492,
included_minutes: 8977,
mobile_accessible: "Yes",
monthly_fee: 70.99,
name: "Business Premium",
outside_country_display: "Yes, In Most Cases",
overage_fixed_rate_per_minute: 0.013,
overage_mobile_rate_per_minute: 0.013,
portable: "Yes For more information please review your porting documentation. Review the KB for More details. https://support.avoxi.com/90307-porting/porting-availability?from_search=41872834",
required_documents: [ ],
setup_fee: 0,
standard_capacity: "Unlimited"
}
]
}
}
}

Response

400

Either the country or number type (if provided) is not recognized by AVOXI

{
message: string
error: {
}
}
{
message: "Invalid sip configuration",
error:
{
message: "Invalid sip configuration",
details: "invalid parameter"
}
}

Response

401

The provided access token doesn't have permission to invoke this API

{
message: string
error: {
}
}
{
message: "Invalid sip configuration",
error:
{
message: "Invalid sip configuration",
details: "invalid parameter"
}
}

Regions in each country

GET /regions/{country}

Code Samples

curl --request GET \
  --url https://genius.avoxi.com/api/v2/regions/{country} \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
const http = require("https");

const options = {
  "method": "GET",
  "hostname": "genius.avoxi.com",
  "port": null,
  "path": "/api/v2/regions/{country}",
  "headers": {
    "Authorization": "Bearer REPLACE_BEARER_TOKEN"
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://genius.avoxi.com/api/v2/regions/{country}");
xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

xhr.send(data);
import http.client

conn = http.client.HTTPSConnection("genius.avoxi.com")

headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

conn.request("GET", "/api/v2/regions/{country}", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.get("https://genius.avoxi.com/api/v2/regions/{country}")
  .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
  .asString();
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://genius.avoxi.com/api/v2/regions/{country}"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
var client = new RestClient("https://genius.avoxi.com/api/v2/regions/{country}");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
IRestResponse response = client.Execute(request);

Response

200

List of regions

[{
id: string
name: string
}]
[
{
id: "US GA Atlanta 470",
name: "Georgia, Atlanta 470"
}
]

Response

400

The country is not recognized by AVOXI.

{
message: string
error: {
}
}
{
message: "Invalid sip configuration",
error:
{
message: "Invalid sip configuration",
details: "invalid parameter"
}
}

NUMBERS

GET /numbers

Get configuration of all numbers matching search parameters

curl --request GET \
  --url 'https://genius.avoxi.com/api/v2/numbers?number_id=116ab66e-c49f-11eb-b101-ee7b4f68c57a&number=%2B17709379735&numbers=%2B17709379735&name=Main Call Center Number' \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
 
const http = require("https");

const options = {
  "method": "GET",
  "hostname": "genius.avoxi.com",
  "port": null,
  "path": "/api/v2/numbers?number_id=116ab66e-c49f-11eb-b101-ee7b4f68c57a&number=%2B17709379735&numbers=%2B17709379735&name=Main Call Center Number",
  "headers": {
    "Authorization": "Bearer REPLACE_BEARER_TOKEN"
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://genius.avoxi.com/api/v2/numbers?number_id=116ab66e-c49f-11eb-b101-ee7b4f68c57a&number=%2B17709379735&numbers=%2B17709379735&name=Main Call Center Number");
xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

xhr.send(data);
import http.client

conn = http.client.HTTPSConnection("genius.avoxi.com")

headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

conn.request("GET", "/api/v2/numbers?number_id=116ab66e-c49f-11eb-b101-ee7b4f68c57a&number=%2B17709379735&numbers=%2B17709379735&name=Main Call Center Number", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.get("https://genius.avoxi.com/api/v2/numbers?number_id=116ab66e-c49f-11eb-b101-ee7b4f68c57a&number=%2B17709379735&numbers=%2B17709379735&name=Main Call Center Number")
  .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
  .asString();
 
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://genius.avoxi.com/api/v2/numbers?number_id=116ab66e-c49f-11eb-b101-ee7b4f68c57a&number=%2B17709379735&numbers=%2B17709379735&name=Main Call Center Number"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
 
var client = new RestClient("https://genius.avoxi.com/api/v2/numbers?number_id=116ab66e-c49f-11eb-b101-ee7b4f68c57a&number=%2B17709379735&numbers=%2B17709379735&name=Main Call Center Number");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
IRestResponse response = client.Execute(request);
 

Response

200

Number configurations

{
data[{
number_id*: string
organization_id: string
number*: string
name*: string
rules[{
target_id: string
name*: string
priority*: integer
disabled*: boolean
activations: [{
start*: integer
stop: integer┃null
days: [enum]
start_time: string┃null
stop_time: string┃null
time_zone*: string
}]
action:
ONE OF
1 {
type: enum
destination: string
timeout_sec: integer
caller_id: enum
tags: {
<any-key>: string
}
}
2{
type: enum
tags: {
<any-key>: string
}
}
<any-key>: {missing-type-info}
}]
country_code: string 🆁
local_format: string 🆁
}]
}
{
"data": [
{
"number_id": "US",
"organization_id": "US",
"number": "e164 example: +17709379735 or user extension example: 4242",
"name": "Main Call Center Number",
"rules": [
{
"target_id": "abcd1c35-81b6-3333-2222-1ecaf4912345",
"name": "My Forwarding Rule",
"priority": 5000,
"disabled": true,
"activations": [
{
"start": 1622851200,
"stop": 1622851700,
"days": [
"M",
"Tu",
"W",
"Th",
"F"
],
"start_time": "07:30",
"stop_time": "15:45",
"time_zone": "America/New_York"
}
],
"action": {
"type": "Dial",
"destination": "+12604379623 or sip:580d5655-471a-4d3f-96df-8086db4ba493",
"timeout_sec": 60,
"caller_id": "Show Caller's Number",
"tags": {}
}
}
],
"country_code": "US",
"local_format": "7709379735"
}
]
}

Response

400
{
message: "Invalid sip configuration",
error:
{
message: "Invalid sip configuration",
details: "invalid parameter"
}
}
{
message: string
error: {
}
}

Regions in each country

GET /regions/{country}

Code Samples

curl --request GET \
  --url 'https://genius.avoxi.com/api/v2/numbers?number_id=116ab66e-c49f-11eb-b101-ee7b4f68c57a&number=%2B17709379735&numbers=%2B17709379735&name=Main Call Center Number' \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
 
const http = require("https");

const options = {
  "method": "GET",
  "hostname": "genius.avoxi.com",
  "port": null,
  "path": "/api/v2/numbers?number_id=116ab66e-c49f-11eb-b101-ee7b4f68c57a&number=%2B17709379735&numbers=%2B17709379735&name=Main Call Center Number",
  "headers": {
    "Authorization": "Bearer REPLACE_BEARER_TOKEN"
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://genius.avoxi.com/api/v2/numbers?number_id=116ab66e-c49f-11eb-b101-ee7b4f68c57a&number=%2B17709379735&numbers=%2B17709379735&name=Main Call Center Number");
xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

xhr.send(data);
import http.client

conn = http.client.HTTPSConnection("genius.avoxi.com")

headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

conn.request("GET", "/api/v2/numbers?number_id=116ab66e-c49f-11eb-b101-ee7b4f68c57a&number=%2B17709379735&numbers=%2B17709379735&name=Main Call Center Number", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.get("https://genius.avoxi.com/api/v2/numbers?number_id=116ab66e-c49f-11eb-b101-ee7b4f68c57a&number=%2B17709379735&numbers=%2B17709379735&name=Main Call Center Number")
  .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
  .asString();
 
 

package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://genius.avoxi.com/api/v2/numbers?number_id=116ab66e-c49f-11eb-b101-ee7b4f68c57a&number=%2B17709379735&numbers=%2B17709379735&name=Main Call Center Number"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
 
var client = new RestClient("https://genius.avoxi.com/api/v2/numbers?number_id=116ab66e-c49f-11eb-b101-ee7b4f68c57a&number=%2B17709379735&numbers=%2B17709379735&name=Main Call Center Number");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
IRestResponse response = client.Execute(request);
 
 

Response

200

Number configurations

{
data[{
number_id*: string
organization_id: string
number*: string
name*: string
rules[{
target_id: string
name*: string
priority*: integer
disabled*: boolean
activations: [{
start*: integer
stop: integer┃null
days: [enum]
start_time: string┃null
stop_time: string┃null
time_zone*: string
}]
action:
ONE OF
1 {
type: enum
destination: string
timeout_sec: integer
caller_id: enum
tags: {
<any-key>: string
}
}
2{
type: enum
tags: {
<any-key>: string
}
}
<any-key>: {missing-type-info}
}]
country_code: string 🆁
local_format: string 🆁
}]
}
{
"data": [
{
"number_id": "US",
"organization_id": "US",
"number": "e164 example: +17709379735 or user extension example: 4242",
"name": "Main Call Center Number",
"rules": [
{
"target_id": "abcd1c35-81b6-3333-2222-1ecaf4912345",
"name": "My Forwarding Rule",
"priority": 5000,
"disabled": true,
"activations": [
{
"start": 1622851200,
"stop": 1622851700,
"days": [
"M",
"Tu",
"W",
"Th",
"F"
],
"start_time": "07:30",
"stop_time": "15:45",
"time_zone": "America/New_York"
}
],
"action": {
"type": "Dial",
"destination": "+12604379623 or sip:580d5655-471a-4d3f-96df-8086db4ba493",
"timeout_sec": 60,
"caller_id": "Show Caller's Number",
"tags": {}
}
}
],
"country_code": "US",
"local_format": "7709379735"
}
]
}

Response

400
{
message: "Invalid sip configuration",
error:
{
message: "Invalid sip configuration",
details: "invalid parameter"
}
}
{
message: string
error: {
}
}

EXTENSIONS

Get configuration of all extensions matching search parameters

GET /extension/{extension}

Get configuration of all extensions matching search parameters

Code Samples

curl --request GET \
  --url https://genius.avoxi.com/api/v2/extension/{extension} \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
 
const http = require("https");

const options = {
  "method": "GET",
  "hostname": "genius.avoxi.com",
  "port": null,
  "path": "/api/v2/extension/{extension}",
  "headers": {
    "Authorization": "Bearer REPLACE_BEARER_TOKEN"
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://genius.avoxi.com/api/v2/extension/{extension}");
xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

xhr.send(data);
import http.client

conn = http.client.HTTPSConnection("genius.avoxi.com")

headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

conn.request("GET", "/api/v2/extension/{extension}", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.get("https://genius.avoxi.com/api/v2/extension/{extension}")
  .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
  .asString();
 
 
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://genius.avoxi.com/api/v2/extension/{extension}"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
 
var client = new RestClient("https://genius.avoxi.com/api/v2/extension/{extension}");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
IRestResponse response = client.Execute(request);
 
 

Response

200

Extension configurations

{
data[{
number_id*: string
organization_id: string
number*: string
name*: string
rules[{
target_id: string
name*: string
priority*: integer
disabled*: boolean
activations: [{
start*: integer
stop: integer┃null
days: [enum]
start_time: string┃null
stop_time: string┃null
time_zone*: string
}]
action:
ONE OF
1 {
type: enum
destination: string
timeout_sec: integer
caller_id: enum
tags: {
<any-key>: string
}
}
2{
type: enum
tags: {
<any-key>: string
}
}
<any-key>: {missing-type-info}
}]
}]
}
{
"data": [
{
"number_id": "US",
"organization_id": "US",
"number": "e164 example: +17709379735 or user extension example: 4242",
"name": "Main Call Center Number",
"rules": [
{
"target_id": "abcd1c35-81b6-3333-2222-1ecaf4912345",
"name": "My Forwarding Rule",
"priority": 5000,
"disabled": true,
"activations": [
{
"start": 1622851200,
"stop": 1622851700,
"days": [
"M",
"Tu",
"W",
"Th",
"F"
],
"start_time": "07:30",
"stop_time": "15:45",
"time_zone": "America/New_York"
}
],
"action": {
"type": "Dial",
"destination": "+12604379623 or sip:580d5655-471a-4d3f-96df-8086db4ba493",
"timeout_sec": 60,
"caller_id": "Show Caller's Number",
"tags": {}
}
}
],
"country_code": "US",
"local_format": "7709379735"
}
]
}

Response

400
{
message: string
error: {
}
}
{
message: "Invalid sip configuration",
error:
{
message: "Invalid sip configuration",
details: "invalid parameter"
}
}

Set the configuration for an extension

PUT /extension/{extension}

Set configuration for an extension. Note: All rules for the extension must be provided, all existing rules will be removed

Code Samples

curl --request PUT \
  --url https://genius.avoxi.com/api/v2/extension/{extension} \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
  --header 'content-type: application/json' \
  --data '{"extension":{"number_id":"US","organization_id":"US","number":"e164 example: +17709379735 or user extension example: 4242","name":"Main Call Center Number","rules":[{"target_id":"abcd1c35-81b6-3333-2222-1ecaf4912345","name":"My Forwarding Rule","priority":5000,"disabled":true,"activations":[{"start":1622851200,"stop":1622851700,"days":["M","Tu","W","Th","F"],"start_time":"07:30","stop_time":"15:45","time_zone":"America/New_York"}],"action":{"type":"Dial","destination":"+12604379623 or sip:580d5655-471a-4d3f-96df-8086db4ba493","timeout_sec":60,"caller_id":"Show Caller'\''s Number","tags":{"property1":"string","property2":"string"}}}]}}'
 
const http = require("https");

const options = {
  "method": "PUT",
  "hostname": "genius.avoxi.com",
  "port": null,
  "path": "/api/v2/extension/{extension}",
  "headers": {
    "content-type": "application/json",
    "Authorization": "Bearer REPLACE_BEARER_TOKEN"
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({
  extension: {
    number_id: 'US',
    organization_id: 'US',
    number: 'e164 example: +17709379735 or user extension example: 4242',
    name: 'Main Call Center Number',
    rules: [
      {
        target_id: 'abcd1c35-81b6-3333-2222-1ecaf4912345',
        name: 'My Forwarding Rule',
        priority: 5000,
        disabled: true,
        activations: [
          {
            start: 1622851200,
            stop: 1622851700,
            days: ['M', 'Tu', 'W', 'Th', 'F'],
            start_time: '07:30',
            stop_time: '15:45',
            time_zone: 'America/New_York'
          }
        ],
        action: {
          type: 'Dial',
          destination: '+12604379623 or sip:580d5655-471a-4d3f-96df-8086db4ba493',
          timeout_sec: 60,
          caller_id: 'Show Caller\'s Number',
          tags: {property1: 'string', property2: 'string'}
        }
      }
    ]
  }
}));
req.end();
const data = JSON.stringify({
  "extension": {
    "number_id": "US",
    "organization_id": "US",
    "number": "e164 example: +17709379735 or user extension example: 4242",
    "name": "Main Call Center Number",
    "rules": [
      {
        "target_id": "abcd1c35-81b6-3333-2222-1ecaf4912345",
        "name": "My Forwarding Rule",
        "priority": 5000,
        "disabled": true,
        "activations": [
          {
            "start": 1622851200,
            "stop": 1622851700,
            "days": [
              "M",
              "Tu",
              "W",
              "Th",
              "F"
            ],
            "start_time": "07:30",
            "stop_time": "15:45",
            "time_zone": "America/New_York"
          }
        ],
        "action": {
          "type": "Dial",
          "destination": "+12604379623 or sip:580d5655-471a-4d3f-96df-8086db4ba493",
          "timeout_sec": 60,
          "caller_id": "Show Caller's Number",
          "tags": {
            "property1": "string",
            "property2": "string"
          }
        }
      }
    ]
  }
});

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "https://genius.avoxi.com/api/v2/extension/{extension}");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

xhr.send(data);
import http.client

conn = http.client.HTTPSConnection("genius.avoxi.com")

payload = "{\"extension\":{\"number_id\":\"US\",\"organization_id\":\"US\",\"number\":\"e164 example: +17709379735 or user extension example: 4242\",\"name\":\"Main Call Center Number\",\"rules\":[{\"target_id\":\"abcd1c35-81b6-3333-2222-1ecaf4912345\",\"name\":\"My Forwarding Rule\",\"priority\":5000,\"disabled\":true,\"activations\":[{\"start\":1622851200,\"stop\":1622851700,\"days\":[\"M\",\"Tu\",\"W\",\"Th\",\"F\"],\"start_time\":\"07:30\",\"stop_time\":\"15:45\",\"time_zone\":\"America/New_York\"}],\"action\":{\"type\":\"Dial\",\"destination\":\"+12604379623 or sip:580d5655-471a-4d3f-96df-8086db4ba493\",\"timeout_sec\":60,\"caller_id\":\"Show Caller's Number\",\"tags\":{\"property1\":\"string\",\"property2\":\"string\"}}}]}}"

headers = {
    'content-type': "application/json",
    'Authorization': "Bearer REPLACE_BEARER_TOKEN"
    }

conn.request("PUT", "/api/v2/extension/{extension}", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.put("https://genius.avoxi.com/api/v2/extension/{extension}")
  .header("content-type", "application/json")
  .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
  .body("{\"extension\":{\"number_id\":\"US\",\"organization_id\":\"US\",\"number\":\"e164 example: +17709379735 or user extension example: 4242\",\"name\":\"Main Call Center Number\",\"rules\":[{\"target_id\":\"abcd1c35-81b6-3333-2222-1ecaf4912345\",\"name\":\"My Forwarding Rule\",\"priority\":5000,\"disabled\":true,\"activations\":[{\"start\":1622851200,\"stop\":1622851700,\"days\":[\"M\",\"Tu\",\"W\",\"Th\",\"F\"],\"start_time\":\"07:30\",\"stop_time\":\"15:45\",\"time_zone\":\"America/New_York\"}],\"action\":{\"type\":\"Dial\",\"destination\":\"+12604379623 or sip:580d5655-471a-4d3f-96df-8086db4ba493\",\"timeout_sec\":60,\"caller_id\":\"Show Caller's Number\",\"tags\":{\"property1\":\"string\",\"property2\":\"string\"}}}]}}")
  .asString();
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://genius.avoxi.com/api/v2/extension/{extension}"

	payload := strings.NewReader("{\"extension\":{\"number_id\":\"US\",\"organization_id\":\"US\",\"number\":\"e164 example: +17709379735 or user extension example: 4242\",\"name\":\"Main Call Center Number\",\"rules\":[{\"target_id\":\"abcd1c35-81b6-3333-2222-1ecaf4912345\",\"name\":\"My Forwarding Rule\",\"priority\":5000,\"disabled\":true,\"activations\":[{\"start\":1622851200,\"stop\":1622851700,\"days\":[\"M\",\"Tu\",\"W\",\"Th\",\"F\"],\"start_time\":\"07:30\",\"stop_time\":\"15:45\",\"time_zone\":\"America/New_York\"}],\"action\":{\"type\":\"Dial\",\"destination\":\"+12604379623 or sip:580d5655-471a-4d3f-96df-8086db4ba493\",\"timeout_sec\":60,\"caller_id\":\"Show Caller's Number\",\"tags\":{\"property1\":\"string\",\"property2\":\"string\"}}}]}}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("content-type", "application/json")
	req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
var client = new RestClient("https://genius.avoxi.com/api/v2/extension/{extension}");
var request = new RestRequest(Method.PUT);
request.AddHeader("content-type", "application/json");
request.AddHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
request.AddParameter("application/json", "{\"extension\":{\"number_id\":\"US\",\"organization_id\":\"US\",\"number\":\"e164 example: +17709379735 or user extension example: 4242\",\"name\":\"Main Call Center Number\",\"rules\":[{\"target_id\":\"abcd1c35-81b6-3333-2222-1ecaf4912345\",\"name\":\"My Forwarding Rule\",\"priority\":5000,\"disabled\":true,\"activations\":[{\"start\":1622851200,\"stop\":1622851700,\"days\":[\"M\",\"Tu\",\"W\",\"Th\",\"F\"],\"start_time\":\"07:30\",\"stop_time\":\"15:45\",\"time_zone\":\"America/New_York\"}],\"action\":{\"type\":\"Dial\",\"destination\":\"+12604379623 or sip:580d5655-471a-4d3f-96df-8086db4ba493\",\"timeout_sec\":60,\"caller_id\":\"Show Caller's Number\",\"tags\":{\"property1\":\"string\",\"property2\":\"string\"}}}]}}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
 
 

Request Body

Extension configuration

{
extension*{
number_id*: string
organization_id: string
number*: string
name*: string
rules[{
target_id: string
name*: string
priority*: integer
disabled*: boolean
activations: [{
start*: integer
stop: integer┃null
days: [enum]
start_time: string┃null
stop_time: string┃null
time_zone*: string
}]
action:
ONE OF
1 {
type: enum
destination: string
timeout_sec: integer
caller_id: enum
tags: {
<any-key>: string
}
}
2{
type: enum
tags: {
<any-key>: string
}
}
<any-key>: {missing-type-info}
}]
}]
}
{
"extension":
{
"number_id": "US",
"organization_id": "US",
"number": "e164 example: +17709379735 or user extension example: 4242",
"name": "Main Call Center Number",
"rules": [
{
"target_id": "abcd1c35-81b6-3333-2222-1ecaf4912345",
"name": "My Forwarding Rule",
"priority": 5000,
"disabled": true,
"activations": [
{
"start": 1622851200,
"stop": 1622851700,
"days": [
"M",
"Tu",
"W",
"Th",
"F"
],
"start_time": "07:30",
"stop_time": "15:45",
"time_zone": "America/New_York"
}
],
"action": {
"type": "Dial",
"destination": "+12604379623 or sip:580d5655-471a-4d3f-96df-8086db4ba493",
"timeout_sec": 60,
"caller_id": "Show Caller's Number",
"tags": {}
}
}
],
"country_code": "US",
"local_format": "7709379735"
}
]
}

Response

200

Extension configurations

{
data[{
number_id*: string
organization_id: string
number*: string
name*: string
rules[{
target_id: string
name*: string
priority*: integer
disabled*: boolean
activations: [{
start*: integer
stop: integer┃null
days: [enum]
start_time: string┃null
stop_time: string┃null
time_zone*: string
}]
action:
ONE OF
1 {
type: enum
destination: string
timeout_sec: integer
caller_id: enum
tags: {
<any-key>: string
}
}
2{
type: enum
tags: {
<any-key>: string
}
}
<any-key>: {missing-type-info}
}]
}]
}
{
"data": [
{
"number_id": "US",
"organization_id": "US",
"number": "e164 example: +17709379735 or user extension example: 4242",
"name": "Main Call Center Number",
"rules": [
{
"target_id": "abcd1c35-81b6-3333-2222-1ecaf4912345",
"name": "My Forwarding Rule",
"priority": 5000,
"disabled": true,
"activations": [
{
"start": 1622851200,
"stop": 1622851700,
"days": [
"M",
"Tu",
"W",
"Th",
"F"
],
"start_time": "07:30",
"stop_time": "15:45",
"time_zone": "America/New_York"
}
],
"action": {
"type": "Dial",
"destination": "+12604379623 or sip:580d5655-471a-4d3f-96df-8086db4ba493",
"timeout_sec": 60,
"caller_id": "Show Caller's Number",
"tags": {}
}
}
],
"country_code": "US",
"local_format": "7709379735"
}
]
}

Response

400
{
message: "Invalid sip configuration",
error:
{
message: "Invalid sip configuration",
details: "invalid parameter"
}
}
{
message: string
error: {
}
}

ENTITLEMENTS

Returns user's permissions for endpoints along with their token details and expiration

GET /entitlements

(COMING SOON)

Code Samples

curl --request GET \
  --url https://genius.avoxi.com/api/v2/entitlements \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
 
const http = require("https");

const options = {
  "method": "GET",
  "hostname": "genius.avoxi.com",
  "port": null,
  "path": "/api/v2/entitlements",
  "headers": {
    "Authorization": "Bearer REPLACE_BEARER_TOKEN"
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://genius.avoxi.com/api/v2/entitlements");
xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

xhr.send(data);
import http.client

conn = http.client.HTTPSConnection("genius.avoxi.com")

headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

conn.request("GET", "/api/v2/entitlements", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.get("https://genius.avoxi.com/api/v2/entitlements")
  .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
  .asString();
 
 
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://genius.avoxi.com/api/v2/entitlements"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
var client = new RestClient("https://genius.avoxi.com/api/v2/entitlements");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
IRestResponse response = client.Execute(request);
 
 

Response

200

User's permissions and token details

{
endpoint_families* {
<any-key>: enum
}
endpoints* [{
url*: string
methods*: [string]
}]
token* {
organization_id*: string
organization_name*: string
user_id*: string
user_email*: string
expiration*: integer
expiration_formatted*: string
}
}
{
"endpoint_families": {
"Numbers": "Enabled",
"Provisioning": "Disabled",
"Entitlements": "Enabled"
},
"endpoints": [
{
"url": "/numbers",
"methods": "[\"GET\", \"POST\", \"PUT\", \"DELETE\"]"
}
],
"token": {
"organization_id": "504aa2fa-467f-444b-95f0-f50787a76ede",
"organization_name": "J21012 - Business Inc.",
"user_id": "18a06368-80b0-4636-b417-d446f8ae807a",
"user_email": "[email protected]",
"expiration": "1618882688",
"expiration_formatted": "2021-04-20T01:38:08.000Z"
}
}

Response

400
{
message: string
error: {
}
}
{
message: "Invalid sip configuration",
error:
{
message: "Invalid sip configuration",
details: "invalid parameter"
}
}