Before you start
- An API connection created in the web panel (app.grupotecnophone.com), with its sandbox or production Bearer Token.
- The public IP of the machine or server where you run cURL, registered as authorized for that token.
- A User-Agent that identifies your application, for example MyCompany/1.0.
- cURL, which comes preinstalled on Linux, macOS and Windows 10 or later. The scripts use jq to read the response, which is optional.
Store the token in an environment variable (GTP_SMS_TOKEN in these examples) so it is not written into your scripts. On Windows, use curl.exe and save the JSON to a file (-d @sms.json) to avoid quoting issues.
Send an SMS with cURL
This command sends an SMS and prints the HTTP status code of the response at the end:
curl -sS https://api.grupotecnophone.com/prod/v1/sms/send \
-H "Authorization: Bearer $GTP_SMS_TOKEN" \
-H "Content-Type: application/json" \
-H "User-Agent: MyCompany/1.0" \
--max-time 30 \
-w "\nHTTP %{http_code}\n" \
-d '{"to":"+525512345678","body":"Your verification code is 482913. It expires in 5 minutes."}'
It is the fastest way to check that the token, the authorized IP and the message format are correct before integrating the API into your application.
API response
If the message was accepted, the API responds with HTTP 200 and a JSON body like this:
{
"sid": "sms_20261012143201_39bdafbd",
"status": "success",
"to": "+525512345678",
"body": "Your verification code is 482913. It expires in 5 minutes.",
"encoding": "GSM7",
"num_chars": 56,
"num_segments": 1,
"error": null
}
Store the sid: it is the identifier you will use to reconcile the message’s delivery report. The num_segments field indicates how many segments will be billed; see how segments are calculated.
Send SMS to multiple recipients from the terminal
For a short list, you can loop over a file of numbers with a Bash script. The script prints the sid of each message or the error code:
#!/usr/bin/env bash
# recipients.txt: one number per line, in +52... format
while IFS= read -r number; do
response=$(curl -sS https://api.grupotecnophone.com/prod/v1/sms/send \
-H "Authorization: Bearer $GTP_SMS_TOKEN" \
-H "Content-Type: application/json" \
-H "User-Agent: MyCompany/1.0" \
--max-time 30 \
-d "{\"to\":\"$number\",\"body\":\"Your order has shipped. Thank you for your purchase.\"}")
echo "$number $(echo "$response" | jq -r '.sid // .error.code')"
sleep 0.2
done < recipients.txt
For high volumes or recurring sends, integrate the API from your application with a send queue. Without coding, you can also send bulk SMS from Excel or CSV.
Test in sandbox with cURL
Switch to the sandbox endpoint and use the sandbox token. That environment validates token, IP, payload and encryption with the same logic as production, but does not send real SMS:
curl -sS https://api.grupotecnophone.com/test/v1/sms/send \
-H "Authorization: Bearer $GTP_SMS_TOKEN_SANDBOX" \
-H "Content-Type: application/json" \
-H "User-Agent: MyCompany/1.0" \
-d '{"to":"+525512345678","body":"Test message"}'
Common errors
| HTTP | Code | Meaning |
|---|---|---|
| 400 | ENCRYPTION_REQUIRED | The connection requires to and body to be encrypted with RSA-OAEP |
| 400 | ENCRYPTION_NOT_ALLOWED | The connection operates in plain text and encrypted content was received |
| 400 | INPUT_PHONE_BLACKLISTED | The destination number is on the blacklist |
| 400 | INSUFFICIENT_BALANCE | Insufficient balance for the send |
| 401 | — | Missing or invalid token |
| 403 | — | The source IP is not authorized for the token |
| 500 | — | Unexpected internal error |
On 400 errors the response includes an error object with code, code_num and message.
From the command to your application
The cURL command has the same parts as any integration: the endpoint, the Authorization header with the Bearer Token, the User-Agent and a JSON body with to and body. Once the test works, take that same request into your backend language with our guides for PHP, Laravel, Python, Node.js, Java and C# (.NET).
Best practices
- Set a timeout and log each response with its
sid. - After a network error with no response, do not resend blindly: check first so you don’t duplicate the message to the user.
- Retry only 500 errors, with progressive backoff and a maximum number of attempts.
- Queue bulk sends instead of sending them within a web request cycle.
- If the content is sensitive, enable connection encryption; the API documentation describes the RSA-OAEP encryption format.
See also the SMS API for Mexico, the SMPP connection and the guides for PHP, Laravel, Python, Node.js, Java and C# (.NET). If you need test credentials, contact us.


