Building
Test mode
# Test mode
## How it works
- A test key sends on the simulator: messages are recorded and pass the same checks, but go nowhere.
- In test mode `channel` is `simulator` in responses and webhooks, and that alone marks a test: there is no separate mode field. A test key sees only test messages, and the consent it records counts only on the simulator.
## Writing as a customer
- `POST /v1/test/inbound` writes as a customer. The `message.received` webhook arrives, and until its `free_text_until` you can answer this number with text.
- `POST /v1/test/inbound` with `type` `voice`, `audio`, `image` or `video` sends a sample file: `message.received` carries its `media_id`, and `GET /v1/media/{id}` downloads it with the test key. A file uploaded with a test key is checked and goes nowhere.
```javascript Node.js
import { Airbox } from "@airboxhq/api";
const client = new Airbox(process.env.AIRBOX_API_KEY);
const { data, error } = await client.test.inbound({
from: "+77011234567",
text: { body: "Hello! When will my order be ready?" },
name: "Asel",
});
if (error) {
throw new Error(`${error.code}: ${error.message} (${error.requestId})`);
}
console.log(data);
```
```php PHP
<?php
require __DIR__.'/vendor/autoload.php';
$client = new Airbox\Client(getenv('AIRBOX_API_KEY'));
$data = $client->test->inbound([
'from' => '+77011234567',
'text' => ['body' => 'Hello! When will my order be ready?'],
'name' => 'Asel',
]);
print_r($data);
```
```python Python
import os
from airboxhq import Airbox
client = Airbox(api_key=os.environ["AIRBOX_API_KEY"])
data = client.test.inbound(
from_="+77011234567",
text={"body": "Hello! When will my order be ready?"},
name="Asel",
)
print(data)
```
```go Go
package main
import (
"context"
"fmt"
"os"
"github.com/airboxhq/airbox-go"
)
func main() {
client := airbox.NewClient(os.Getenv("AIRBOX_API_KEY"))
data, err := client.Test.Inbound(context.Background(), airbox.InboundParams{
From: "+77011234567",
Text: "Hello! When will my order be ready?",
Name: "Asel",
})
if err != nil {
panic(err)
}
fmt.Println(data)
}
```
```csharp .NET
using Airbox;
var client = new AirboxClient(Environment.GetEnvironmentVariable("AIRBOX_API_KEY"));
var data = await client.Test.InboundAsync(
new InboundParams
{
From = "+77011234567",
Text = "Hello! When will my order be ready?",
Name = "Asel",
});
Console.WriteLine(data);
```
```rust Rust
use airboxhq::Airbox;
use airboxhq::models::*;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Airbox::new(std::env::var("AIRBOX_API_KEY")?);
let data = client
.test()
.inbound(Inbound {
from: "+77011234567".into(),
text: "Hello! When will my order be ready?".into(),
name: Some("Asel".into()),
..Default::default()
})
.await?;
println!("{data:#?}");
Ok(())
}
```
```bash cURL
curl -X POST https://crm.fintelligence.kz/api/v1/test/inbound \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "+77011234567",
"text": {
"body": "Hello! When will my order be ready?"
},
"name": "Asel"
}'
```
## What differs from live
- The simulator reports no delivery or reading, so test messages stay `sent`.
- In test mode too, templates come from the ones Meta approved for the number.
- A test key sends on the simulator with `whatsapp` and `auto` alike, and `auto` chooses from what the customer wrote through `POST /v1/test/inbound`.
Updated 4 December 2026
How it works
- A test key sends on the simulator: messages are recorded and pass the same checks, but go nowhere.
- In test mode
channelissimulatorin responses and webhooks, and that alone marks a test: there is no separate mode field. A test key sees only test messages, and the consent it records counts only on the simulator.
Writing as a customer
- POST /v1/test/inbound writes as a customer. The
message.receivedwebhook arrives, and until itsfree_text_untilyou can answer this number with text. - POST /v1/test/inbound with
typevoice,audio,imageorvideosends a sample file:message.receivedcarries itsmedia_id, and GET /v1/media/{id} downloads it with the test key. A file uploaded with a test key is checked and goes nowhere.
import { Airbox } from "@airboxhq/api";
const client = new Airbox(process.env.AIRBOX_API_KEY);
const { data, error } = await client.test.inbound({
from: "+77011234567",
text: { body: "Hello! When will my order be ready?" },
name: "Asel",
});
if (error) {
throw new Error(`${error.code}: ${error.message} (${error.requestId})`);
}
console.log(data);
What differs from live
- The simulator reports no delivery or reading, so test messages stay
sent. - In test mode too, templates come from the ones Meta approved for the number.
- A test key sends on the simulator with
whatsappandautoalike, andautochooses from what the customer wrote through POST /v1/test/inbound.