Purchase Number
curl --request POST \
--url https://api-qa.interactly.ai/assistants/v1/numbers/purchase \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"number": "+1234567890"
}
'import requests
url = "https://api-qa.interactly.ai/assistants/v1/numbers/purchase"
payload = { "number": "+1234567890" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({number: '+1234567890'})
};
fetch('https://api-qa.interactly.ai/assistants/v1/numbers/purchase', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-qa.interactly.ai/assistants/v1/numbers/purchase",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'number' => '+1234567890'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-qa.interactly.ai/assistants/v1/numbers/purchase"
payload := strings.NewReader("{\n \"number\": \"+1234567890\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-qa.interactly.ai/assistants/v1/numbers/purchase")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"number\": \"+1234567890\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-qa.interactly.ai/assistants/v1/numbers/purchase")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"number\": \"+1234567890\"\n}"
response = http.request(request)
puts response.read_body{
"_id": "a12f9c88-c155-461f-9771-4d240cdc9a04",
"teamId": "1f7b1b1b1b1b1b1b1b1b1b1b",
"number": "+1234567890",
"provider": {
"name": "twilio"
},
"assistantId": "a12f9c88-c155-461f-9771-4d240cdc9a04",
"inboundEnabled": true,
"outboundEnabled": true,
"label": "friendly-name-1"
}{
"message": "Not received valid inputs!"
}{
"message": "number already sold"
}{
"message": "Failed to purchase number",
"error": "INTERNAL_ERROR"
}Phone Numbers
Purchase Number
Purchases a number.
POST
/
assistants
/
v1
/
numbers
/
purchase
Purchase Number
curl --request POST \
--url https://api-qa.interactly.ai/assistants/v1/numbers/purchase \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"number": "+1234567890"
}
'import requests
url = "https://api-qa.interactly.ai/assistants/v1/numbers/purchase"
payload = { "number": "+1234567890" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({number: '+1234567890'})
};
fetch('https://api-qa.interactly.ai/assistants/v1/numbers/purchase', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-qa.interactly.ai/assistants/v1/numbers/purchase",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'number' => '+1234567890'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-qa.interactly.ai/assistants/v1/numbers/purchase"
payload := strings.NewReader("{\n \"number\": \"+1234567890\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-qa.interactly.ai/assistants/v1/numbers/purchase")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"number\": \"+1234567890\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-qa.interactly.ai/assistants/v1/numbers/purchase")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"number\": \"+1234567890\"\n}"
response = http.request(request)
puts response.read_body{
"_id": "a12f9c88-c155-461f-9771-4d240cdc9a04",
"teamId": "1f7b1b1b1b1b1b1b1b1b1b1b",
"number": "+1234567890",
"provider": {
"name": "twilio"
},
"assistantId": "a12f9c88-c155-461f-9771-4d240cdc9a04",
"inboundEnabled": true,
"outboundEnabled": true,
"label": "friendly-name-1"
}{
"message": "Not received valid inputs!"
}{
"message": "number already sold"
}{
"message": "Failed to purchase number",
"error": "INTERNAL_ERROR"
}Authorizations
Retrieve your API Key from Dashboard API Keys Section.
Body
application/json
Phone number to purchase. Please provide in E.164 format, Ex: +1234567890
Example:
"+1234567890"
Response
Successfully purchased the number.
Unique identifier of the number
Example:
"a12f9c88-c155-461f-9771-4d240cdc9a04"
This is unique identifier of the team.
Example:
"1f7b1b1b1b1b1b1b1b1b1b1b"
Phone number associated with the team
Example:
"+1234567890"
Show child attributes
Show child attributes
ID of the associated assistant (if any)
Example:
"a12f9c88-c155-461f-9771-4d240cdc9a04"
If true, inbound call is enabled. If false, inbound call is disabled.
Example:
true
If true, outbound call is enabled. If false, outbound call is disabled.
Example:
true
Label for the number
Example:
"friendly-name-1"
⌘I