Buy number
curl --request POST \
--url https://api.sendo.dev/v1/number/buy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"number": "<string>",
"campaignId": "<string>"
}
'import requests
url = "https://api.sendo.dev/v1/number/buy"
payload = {
"number": "<string>",
"campaignId": "<string>"
}
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: '<string>', campaignId: '<string>'})
};
fetch('https://api.sendo.dev/v1/number/buy', 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.sendo.dev/v1/number/buy",
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' => '<string>',
'campaignId' => '<string>'
]),
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.sendo.dev/v1/number/buy"
payload := strings.NewReader("{\n \"number\": \"<string>\",\n \"campaignId\": \"<string>\"\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.sendo.dev/v1/number/buy")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"number\": \"<string>\",\n \"campaignId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sendo.dev/v1/number/buy")
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\": \"<string>\",\n \"campaignId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"status": "PENDING",
"number": "+14155941075",
"campaignId": "U7fQ3123"
}
{
"success": false,
"error": "Number not available"
}
Number
Buy number
Purchase a number for a campaign.
POST
/
v1
/
number
/
buy
Buy number
curl --request POST \
--url https://api.sendo.dev/v1/number/buy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"number": "<string>",
"campaignId": "<string>"
}
'import requests
url = "https://api.sendo.dev/v1/number/buy"
payload = {
"number": "<string>",
"campaignId": "<string>"
}
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: '<string>', campaignId: '<string>'})
};
fetch('https://api.sendo.dev/v1/number/buy', 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.sendo.dev/v1/number/buy",
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' => '<string>',
'campaignId' => '<string>'
]),
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.sendo.dev/v1/number/buy"
payload := strings.NewReader("{\n \"number\": \"<string>\",\n \"campaignId\": \"<string>\"\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.sendo.dev/v1/number/buy")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"number\": \"<string>\",\n \"campaignId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sendo.dev/v1/number/buy")
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\": \"<string>\",\n \"campaignId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"status": "PENDING",
"number": "+14155941075",
"campaignId": "U7fQ3123"
}
{
"success": false,
"error": "Number not available"
}
This endpoint can only be used to purchase additional local phone numbers for a campaign that is already fully provisioned.
Body
string
required
The phone number to purchase in format.
string
required
The ID of the campaign for the number.
Response
boolean
required
Whether the number was purchased successfully.
string
The status of the number after purchase.
string
The phone number that was purchased.
string
The campaign ID attached to the number.
Charges
Your balance will be charged $2 for each active number on the date that the associated campaign renews. You can find the campaign renewal date on the Balance page of the Sendo dashboard. Because of this, when you purchase a number, your balance will instantly be charged a prorated amount equal to the number of days remaining until the campaign renews (i.e. the next $2 charge).{
"success": true,
"status": "PENDING",
"number": "+14155941075",
"campaignId": "U7fQ3123"
}
{
"success": false,
"error": "Number not available"
}
⌘I

