Amarseba API
Developer documentation
নিবন্ধন
Encoding, parts and pricing
Long SMS are split into parts, and you pay per part. How many characters fit in a part depends on the encoding the body needs. Try any body in the calculator next to the navigation to estimate parts and cost.
Encodings
| Encoding | When | Single SMS | Per part when longer |
|---|---|---|---|
gsm7 | Every character is in the GSM 03.38 basic set or its extension table (English letters, digits and common punctuation). | 160 characters | 153 characters |
ucs2 (Unicode) | Any other character. A single Bangla letter or emoji makes the whole body Unicode. | 70 characters | 67 characters |
- The GSM-7 extension characters
^ { } \ [ ~ ] | €count as two characters each. - Emoji need Unicode, and most emoji count as two characters.
- The API counts exactly the characters it receives: a
\nline break counts as one character and\r\nas two. The calculator counts each line break as two, because browsers submit\r\n. - A body can be at most 10 parts: 1,530 GSM-7 characters or 670 Unicode characters. Longer bodies return
422underbody.
Examples
| Body | Encoding | Characters | Parts |
|---|---|---|---|
| Your OTP is 4821. It expires in 5 minutes. | gsm7 | 42 | 1 |
| 161 English characters | gsm7 | 161 | 2 |
| আপনার ওটিপি ৪৮২১ | ucs2 | 16 | 1 |
| 71 Bangla characters | ucs2 | 71 | 2 |
Pricing
Cost per message is parts × rate, and a batch costs the sum of its messages. For a broadcast that is parts × rate × recipients. For example, "Your OTP is 4821. It expires in 5 minutes." is 1 part; sent to 500 recipients at ৳0.30 per part it costs ৳150.00.
- Your rate per part depends on your account tier (user, entrepreneur or center) and on the sender: masking names cost more than the default non-masking sender.
- Each send response reports
partsandcostper message andtotal_partsandtotal_costfor the batch, so you always know the exact charge. - Amounts are strings with two decimals, in BDT.
- Failed messages are refunded to your wallet exactly once; sent messages are final and charged.