To send Hindi or other Unicode SMS with the Fast2SMS API, send your text as UTF-8 and, if you use a GET request, URL-encode every value. You do not need a language parameter: Fast2SMS detects English or Unicode text on its own. This guide shows how to encode messages and variables correctly, which characters break a GET URL, and how to read the errors you get when the text arrives broken.
The short answer
- Use POST with JSON where you can. JSON carries Hindi text as it is, and you never have to think about URL encoding.
- With GET, URL-encode every parameter value. Characters like
&,+,#and%change the meaning of a URL if you send them raw. - Always UTF-8. Text in another encoding is refused with error 429 before anything is sent or charged.
- No language setting. The language is detected from the text. A Unicode SMS fits 70 characters in one part instead of 160.
Before you start
- Your API key from Account Setting > API Key, sent in the
authorizationheader. - For DLT SMS: an approved DLT template in DLT Manager. If the message is in Hindi, the template must be registered in Hindi with the same text.
- Wallet balance for the message.
How Hindi SMS are counted and charged
| Text type | 1 part | 2 parts | 3 parts |
|---|---|---|---|
| English (basic keyboard characters only) | 160 characters | 306 | 459 |
| Unicode (Hindi, other Indian languages, many symbols) | 70 characters | 133 | 199 |
A message counts as Unicode as soon as it has one character outside the basic English keyboard set, for example a Hindi letter, the ₹ sign, a curly quote copied from Word, or an emoji. The charge for an SMS is your per-SMS rate × valid numbers × parts. A long Hindi message can use 2 or 3 parts where the same English text uses 1, so check the length before a big send. Add sms_details=1 to a bulkV2 request to get sms_language, character_count, sms_count and amount_debited back in the response. See the current per-SMS rates on the pricing page.
Sending in bulk? For high SMS volumes our team offers discounted rates. Talk to our team or see SMS pricing.
Option 1: POST with JSON (recommended)
Send the body as JSON with Content-Type: application/json. Make sure your file or code saves the text as UTF-8.
DLT SMS with a Hindi variable (cURL)
curl -X POST "https://www.fast2sms.com/dev/bulkV2" \
-H "authorization: YOUR_API_KEY" \
-H "Content-Type: application/json; charset=utf-8" \
-d '{"route":"dlt","sender_id":"FSTSMS","message":"111111","variables_values":"राहुल|4821","numbers":"9999999999","sms_details":"1"}'
Here message is the Message ID from DLT Manager and variables_values fills the template’s variables in order, separated by |. Each value is cut to 40 characters.
PHP
<?php
$payload = [
'route' => 'dlt',
'sender_id' => 'FSTSMS',
'message' => '111111',
'variables_values' => 'राहुल|4821',
'numbers' => '9999999999',
];
$ch = curl_init('https://www.fast2sms.com/dev/bulkV2');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['authorization: YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode($payload, JSON_UNESCAPED_UNICODE),
]);
echo curl_exec($ch);
json_encode without JSON_UNESCAPED_UNICODE writes Hindi as र... escapes. That is also valid JSON and works the same way.
Python
import requests
payload = {
"route": "dlt",
"sender_id": "FSTSMS",
"message": "111111",
"variables_values": "राहुल|4821",
"numbers": "9999999999",
}
r = requests.post(
"https://www.fast2sms.com/dev/bulkV2",
headers={"authorization": "YOUR_API_KEY"},
json=payload, # requests sends UTF-8 JSON for you
timeout=30,
)
print(r.json())
Option 2: GET with URL encoding
GET puts every value in the URL. A URL can only carry plain ASCII characters, and some of them have a special meaning, so each value must be percent-encoded. Most tools do this for you when you pass values as parameters instead of building the URL by hand.
| Character in your text | What happens if you send it raw in a URL | Encoded form |
|---|---|---|
| & | Starts a new parameter. “Tom & Co” is cut to “Tom “. | %26 |
| + | Becomes a space. “+91″ turns into ” 91″. | %2B |
| # | Everything after it is dropped by the client. | %23 |
| % | Read as the start of an encoded character. “50% off” can break. | %25 |
| Space | Breaks the URL in many tools. | %20 |
| New line | Ends or breaks the request line. | %0A |
| Hindi letters | Must be sent as UTF-8 bytes. | Example: र = %E0%A4%B0 |
cURL
curl -G "https://www.fast2sms.com/dev/bulkV2" \
-H "authorization: YOUR_API_KEY" \
--data-urlencode "route=dlt" \
--data-urlencode "sender_id=FSTSMS" \
--data-urlencode "message=111111" \
--data-urlencode "variables_values=राहुल|4821" \
--data-urlencode "numbers=9999999999"
JavaScript
const params = new URLSearchParams({
route: 'dlt',
sender_id: 'FSTSMS',
message: '111111',
variables_values: 'राहुल|4821',
numbers: '9999999999',
});
// URLSearchParams encodes each value as UTF-8 for you
const res = await fetch('https://www.fast2sms.com/dev/bulkV2?' + params, {
headers: { authorization: 'YOUR_API_KEY' },
});
console.log(await res.json());
If you build a URL by hand, wrap each value in encodeURIComponent() in JavaScript, rawurlencode() in PHP or urllib.parse.quote() in Python.
authorization header, not in the URL. URLs are saved in server and proxy logs.Pipes and commas inside values
variables_valuesuses|to separate values, so a value cannot contain a pipe of its own. Replace it with another character before sending.numbersuses commas to separate numbers. Commas inside a variable value are fine.
Check what Fast2SMS received
Open Account Setting > API Logs. Each API call is listed with its endpoint, HTTP code and result. Click the three dots and View Details: the Request Data tab shows the query parameters and request body exactly as they reached us, so you can see if the Hindi text arrived correctly or as broken characters. API logs are kept for 7 days.


Errors you may see
| status_code | Message | Fix |
|---|---|---|
| 429 | “Invalid characters in … The text is not valid UTF-8 … No SMS was sent and nothing was charged.” | Your text is in another encoding, often from an Excel or CSV file saved as ANSI. Convert it to UTF-8, and URL-encode GET values. |
| 404 | “Language Missing” (DLT Manual and Quick SMS) | The language of the text could not be detected. Send the full text as UTF-8. |
| 424 | “Invalid Message ID (or Template, Entity ID)” | For route=dlt, message must be the Message ID from DLT Manager, not the text and not the 19-digit DLT template ID. |
| Failed at operator | The SMS fails as a template mismatch | With DLT Manual, the full Hindi text must match the registered template exactly, including spaces and punctuation. |
The 429 code in Fast2SMS is about invalid characters. It is not a “too many requests” limit.
Common problems and fixes
The SMS arrives as ???? or strange symbols
The text was converted to another encoding somewhere before it reached the API, often by a database or file that is not UTF-8. Check Request Data in API Logs. If the text is already broken there, fix the encoding in your system.
Only half my message was sent
An unencoded & or # cut the GET URL. Use --data-urlencode, URLSearchParams or POST JSON.
My Hindi SMS used more parts than I expected
Unicode SMS fit 70 characters per part, and 133 for two parts. Shorten the message or the variable values.
A long variable value is cut
Each DLT variable value is cut to 40 characters. Keep values short or split them across more variables in your template.
Frequently asked questions
How do I send Hindi SMS with the Fast2SMS API?
Register the template in Hindi in DLT, add it to DLT Manager, then send it with route=dlt. Send the request as UTF-8 JSON, or URL-encode values in a GET request.
Do I need to pass language=unicode?
No. The language is detected from the text, so you do not need to set it.
Can I mix English and Hindi in one SMS?
Yes, if the registered template has the same mix. The message is then sent as Unicode and counted at 70 characters per part.
Can a variable value contain Hindi when the template is in English?
The final message must still match your DLT template. The Hindi characters also make the whole SMS Unicode, which changes the part count. Test with one number first.
Why does a plus sign disappear from my message?
In a URL, a raw + means a space. Encode it as %2B or use POST JSON.
Does POST need URL encoding?
Not with JSON. With form-urlencoded POST bodies, the same encoding rules as GET apply, and most HTTP libraries do it for you.
Is error 429 a rate limit?
No. In the Fast2SMS SMS API, status_code 429 means the text is not valid UTF-8. Nothing is sent or charged.