Quickstart
This guide sends a single transactional SMS. You'll need your API-Key, X-TenantID, and one approved sender name.
1. Set your credentials
bash
export ME_API_KEY="your-app-token"
export ME_TENANT="your-tenant-id"
export ME_BASE="https://api.messageeagle.com/api/v1/app1/platform"2. Send a message
bash
curl -X POST "$ME_BASE/sms/send_messages/message" \
-H "API-Key: $ME_API_KEY" \
-H "X-TenantID: $ME_TENANT" \
-H "Content-Type: application/json" \
-d '{
"check_spam_msg_mode": "not_check",
"data": [
{
"sender_name": "MyBrand",
"operator": "ais",
"message": "Hi {{first_name}}, your order has shipped.",
"phone_number": "+66886578553",
"first_name": "Mali",
"transaction_uuid": "018f7b2a-7c3e-7a1b-9c2d-1a2b3c4d5e6f"
}
]
}'go
package main
import (
"context"
"log"
"github.com/lodashventure/messageeagle/sms-voice/sdk"
)
func main() {
client, err := sdk.New(sdk.Config{
BaseURL: "https://api.messageeagle.com",
APIKey: "your-api-key",
TenantID: "your-organization-id",
})
if err != nil {
log.Fatal(err)
}
resp, err := client.SMS.SendMessage(context.Background(), &sdk.SendMessageRequest{
CheckSpamMsgMode: "not_check",
Data: []sdk.SendMessageItem{{
SenderName: "MyBrand",
Operator: "ais",
PhoneNumber: "+66886578553",
Message: "Hi Mali, your order has shipped.",
}},
})
if err != nil {
log.Fatal(err)
}
log.Printf("accepted=%d rejected=%d batches=%+v", resp.Accepted, resp.Rejected, resp.Batches)
}ts
const res = await fetch(`${ME_BASE}/sms/send_messages/message`, {
method: "POST",
headers: {
"API-Key": ME_API_KEY,
"X-TenantID": ME_TENANT,
"Content-Type": "application/json",
},
body: JSON.stringify({
check_spam_msg_mode: "not_check",
data: [
{
sender_name: "MyBrand",
operator: "ais",
message: "Hi {{first_name}}, your order has shipped.",
phone_number: "+66886578553",
first_name: "Mali",
transaction_uuid: "018f7b2a-7c3e-7a1b-9c2d-1a2b3c4d5e6f",
},
],
}),
});
console.log(await res.json());3. Read the result
The response reports the fan-out, wrapped in a data envelope. Rows sharing operator + sender + message become one batch each:
json
{
"data": {
"accepted": 1,
"rejected": 0,
"batches": [
{ "batch_id": "018f7b2a-7c3e-7a1b-9c2d-1a2b3c4d5e6f", "accepted": 1, "rejected": 0 }
]
}
}undeliverable_chars
A batch may also carry undeliverable_chars — codepoints the carrier is known to destroy. The loss is otherwise invisible: the message is accepted, the unit is billed, and the handset shows nothing there.
Sender name must be approved
If sender_name is not approved for the target carrier, those recipients are counted in rejected rather than failing the whole request.
Next steps
- Authentication — header details and errors.
- SMS Messaging — broadcasts, scheduling, templating.
- Webhooks & Delivery Reports — get notified when messages land.
