๐ Authentication
Each user has a unique API Key to authenticate requests.
Include your API key in the request header like this:
token: YOUR_API_KEY
Replace YOUR_API_KEY
.
๐ฅ Get Messages
Retrieve messages for a specific phone number.
Request
Method | POST |
---|---|
URL |
|
Headers |
|
Body (JSON) | { "number": "12025550181" } |
Response
{
"success": true,
"messages": [
{
"time": 1748403027,
"sender": "Telegram",
"content": "Login code: 998877"
}
]
}
โ Request New Number
Request a new temporary phone number to use.
Request
Method | POST |
---|---|
URL |
|
Headers |
|
Body (JSON) | { "country": "US" } optional, ISO country code |
Response
{
"success": true,
"number": "+12025550182",
"msg": "New number assigned successfully"
}
๐ Get All Your Numbers
Retrieve all temporary numbers assigned to your account.
Request
Method | GET |
---|---|
URL |
|
Headers |
|
Response
{
"success": true,
"numbers": [
"+12025550181",
"+12025550182",
"+12025550183"
]
}
๐งช Test Your Key
Verify your API key validity.
Request
Method | GET |
---|---|
URL |
|
Headers |
|
Response
{
"success": true,
"user": {
"name": "test",
"email": "[email protected]",
"verified": "1"
}
}
๐ป Code Examples
PHP (cURL)
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://smsinbox.online/api/messages");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"token: YOUR_API_KEY",
"Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(["number" => "+12025550181"]));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Python (requests)
import requests
url = "https://smsinbox.online/api/messages"
headers = {
"token": "YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {"number": "+12025550181"}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
Node.js (axios)
const axios = require('axios');
axios.post('https://smsinbox.online/api/messages',
{ number: '+12025550181' },
{ headers: {
token: 'YOUR_API_KEY',
'Content-Type': 'application/json'
}
}
)
.then(res => {
console.log(res.data);
})
.catch(err => {
console.error(err);
});
C# (.NET HttpClient)
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("token", "YOUR_API_KEY");
var content = new StringContent("{\"number\": \"+12025550181\"}", Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://smsinbox.online/api/messages", content);
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
}
}
Go (net/http)
package main
import (
"bytes"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://smsinbox.online/api/messages"
jsonData := []byte(`{"number": "+12025550181"}`)
req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
if err != nil {
panic(err)
}
req.Header.Set("token", "YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
panic(err)
}
fmt.Println(string(body))
}
PHP (cURL)
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://smsinbox.online/api/request-number");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"token: YOUR_API_KEY",
"Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(["country" => "US"])); // optional
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Python (requests)
import requests
url = "https://smsinbox.online/api/request-number"
headers = {
"token": "YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {"country": "US"} # optional
response = requests.post(url, headers=headers, json=payload)
print(response.json())
Node.js (axios)
const axios = require('axios');
axios.post('https://smsinbox.online/api/request-number',
{ country: 'US' }, // optional
{ headers: {
token: 'YOUR_API_KEY',
'Content-Type': 'application/json'
}
}
)
.then(res => {
console.log(res.data);
})
.catch(err => {
console.error(err);
});
C# (.NET HttpClient)
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("token", "YOUR_API_KEY");
var content = new StringContent("{\"country\": \"US\"}", Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://smsinbox.online/api/request-number", content);
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
}
}
Go (net/http)
package main
import (
"bytes"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://smsinbox.online/api/request-number"
jsonData := []byte(`{"country": "US"}`)
req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
if err != nil {
panic(err)
}
req.Header.Set("token", "YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
panic(err)
}
fmt.Println(string(body))
}
PHP (cURL)
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://smsinbox.online/api/my-numbers");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"token: YOUR_API_KEY"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Python (requests)
import requests
url = "https://smsinbox.online/api/my-numbers"
headers = {
"token": "YOUR_API_KEY"
}
response = requests.get(url, headers=headers)
print(response.json())
Node.js (axios)
const axios = require('axios');
axios.get('https://smsinbox.online/api/my-numbers', {
headers: { token: 'YOUR_API_KEY' }
})
.then(res => {
console.log(res.data);
})
.catch(err => {
console.error(err);
});
C# (.NET HttpClient)
using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("token", "YOUR_API_KEY");
var response = await client.GetAsync("https://smsinbox.online/api/my-numbers");
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
}
}
Go (net/http)
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://smsinbox.online/api/my-numbers"
req, err := http.NewRequest("GET", url, nil)
if err != nil {
panic(err)
}
req.Header.Set("token", "YOUR_API_KEY")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
panic(err)
}
fmt.Println(string(body))
}
PHP (cURL)
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://smsinbox.online/api/validate-key");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"token: YOUR_API_KEY"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Python (requests)
import requests
url = "https://smsinbox.online/api/validate-key"
headers = {
"token": "YOUR_API_KEY"
}
response = requests.get(url, headers=headers)
print(response.json())
Node.js (axios)
const axios = require('axios');
axios.get('https://smsinbox.online/api/validate-key', {
headers: { token: 'YOUR_API_KEY' }
})
.then(res => {
console.log(res.data);
})
.catch(err => {
console.error(err);
});
C# (.NET HttpClient)
using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("token", "YOUR_API_KEY");
var response = await client.GetAsync("https://smsinbox.online/api/validate-key");
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
}
}
Go (net/http)
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://smsinbox.online/api/validate-key"
req, err := http.NewRequest("GET", url, nil)
if err != nil {
panic(err)
}
req.Header.Set("token", "YOUR_API_KEY")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
panic(err)
}
fmt.Println(string(body))
}