Messages
Estimate message cost
Shows how many segments a message will use and what it will cost, without sending it.
POST
Shows how many segments a message will use and what it will cost, without sending it.
bearerheader
AuthorizationBearer <JWT>Your secret API key: sk_live_… for live traffic or sk_test_… for testing.
application/json- body
text*stringThe message text to price, up to 480 characters including spaces.
Length
length <= 480recipients?numberNumber of recipients to price for. Defaults to 1.
Range
1 <= value <= 10000The estimate.
application/jsoncurl -X POST 'https://api.appstractone.com/v1/messages/estimate' \
-H 'Content-Type: application/json' \
-d '{
"text": "Your order #1042 is on its way."
}'Example Response
{
"encoding": "GSM-7",
"characters": 31,
"segments": 1,
"recipients": 250,
"costPerMessage": {
"amount": "0.04",
"currency": "GHS"
},
"totalCost": {
"amount": "10.00",
"currency": "GHS"
}
}