
LabsMobile SMS: Getting Started for Developers
At LabsMobile, we know that SMS communication is key to any project. That’s why we offer you a robust and easy-to-use SMS API, designed to integrate message sending into your applications or systems automatically. With it, you can send individual or bulk SMS, check your balance, and receive delivery notifications.
In this article, we’ll guide you step-by-step on how to integrate the LabsMobile SMS API, with technical details and practical examples specially designed for developers.
Regístrate y prueba enviar SMS con LabsMobile
¡Empieza aquí y ahora!Index
Choose the version that fits your environment
At LabsMobile, we offer several versions of our API depending on your environment and requirements, including SDK Libraries, HTTP/POST (JSON), HTTP/GET, WebService, MailSMS, OTP, Admin, and HLR. We recommend using the HTTP/POST API with JSON for its security and ease of use, although you can choose another version if it better fits your project.
Each version has its own detailed documentation describing the available endpoints and parameters. For example, in the “API Versions” section of the developer portal, you’ll find all the options and features of each API.
Explore our code examples
On the LabsMobile website, you’ll find code examples in multiple languages to make integration easier. There are guides and snippets in C#, Java, PHP, Python, Node.js, Go, Ruby, Swift, and many more.
These examples demonstrate how to perform common tasks: sending individual or bulk SMS, checking your balance, receiving delivery or inbound message notifications, and more. For instance, in the documentation you’ll find examples of sending SMS in Go, Python, and other languages, with step-by-step explanations. Use these resources to speed up your development. Additionally, the “API Documentation” section provides more examples and details about each functionality.
Test the API with our Postman collection
To make testing easier, each version of the LabsMobile API includes a Postman collection that you can download and run right away. For example, in the HTTP/POST API documentation, you’ll find a link to download its Postman collection.
There are also collections for the HLR API and other versions. Import the collection into Postman and you’ll find preconfigured endpoints and required headers (such as HTTP Basic authentication). This allows you to test your API calls interactively without writing code — perfect for validating parameters and viewing JSON responses.
Authentication and security
To start the integration, you need a LabsMobile account (registered with your email) and to generate an API token that acts as your password for authentication. This can be done from the “API Configuration” section in your WebSMS account dashboard.
The API uses HTTP Basic Auth, sending the user:APItoken credentials encoded in Base64 with each request. For example, if your username is myUser and your token is abc123, you’d include in the Authorization header: Basic base64("myUser:abc123").
Optionally, you can configure security filters to strengthen your integration. These include allowing only specific sending IP addresses, defining a default sender, setting daily or batch limits, applying country filters, and enabling an anti-duplicate filter to avoid repeated messages.
These options can also be adjusted in your account’s configuration section. Note that there’s a limit of 10 requests per second; exceeding this may lead to temporary account blocks.
Use LabsMobile native libraries
The easiest and most recommended way to integrate SMS sending is through the official LabsMobile native libraries (SDKs). These libraries encapsulate all connection, authentication, and validation logic, greatly simplifying development and reducing errors.
Currently, LabsMobile provides native libraries for PHP and Node.js environments, publicly available on GitHub and in the Libraries and SDKs section of the developer portal. With them, you can send messages, check balances, or process notifications with just a few lines of code.
For other languages or environments, we recommend using the HTTP/POST API with JSON format, which offers the same functionality and can be easily integrated with any technology capable of making HTTPS requests.
These options ensure a stable, secure integration officially maintained by LabsMobile, with ongoing support and updates.
Select the endpoint of the API version you want to test
If your development environment doesn’t have a LabsMobile native library or you prefer to implement your own connection, you can integrate the service directly using any of the available API versions. All versions (HTTP/POST JSON, HTTP/GET, WebService, MailSMS, OTP, HLR, etc.) are fully documented and can be easily implemented from any language or framework that supports secure HTTP requests.
Once authenticated, choose the appropriate endpoint for the action you want to perform. Each API has its own endpoints; here are some practical examples for the HTTP/POST API:
- Send SMS (POST) – https://api.labsmobile.com/json/send: Allows sending individual or batch SMS messages.
- Check balance (GET) – https://api.labsmobile.com/json/balance: Returns the available credits in your account. No additional parameters required.
- Check prices (GET) – https://api.labsmobile.com/json/prices: Retrieves pricing (in credits) for one or several destination countries. Send a JSON with the array of country codes.
- Manage scheduled messages (POST) – https://api.labsmobile.com/json/scheduled: Allows you to cancel or execute pending messages. You must send a JSON specifying the command (
sendorcancel) and thesubidof the scheduled message. - HLR Lookup (GET) – https://api.labsmobile.com/hlr: (HLR API) validates the status of a mobile number. Send parameters such as the phone number to obtain HLR information.
These are just examples. In the official documentation, you’ll find all available endpoints for each API version. Requests are generally built by specifying the method (GET or POST), the endpoint URL, and the appropriate authorization and content headers.
Make your first request
Once everything is set up, it’s time to send a real request! For example, using cURL to send an SMS with the HTTP/POST API:
curl -X POST "https://api.labsmobile.com/json/send" \ -H "Content-Type: application/json" \
-u "myUser:myAPIToken" \
-d '{"message":"Hello from LabsMobile!","tpoa":"LabsM","recipient":[{"msisdn":"123456789"}]}'
In this example, replace myUser:myAPIToken with your actual credentials. The JSON body must include at least the message text (message), sender (tpoa), and an array of recipients with their phone numbers (msisdn). The API will respond with a JSON indicating whether the send was successful. A typical successful result would be:
{ "subid": "65f33a88ceb3d",
"code": "0",
"message": "Message has been successfully sent."
}
In case of an error, the code field will have a non-zero value and message will describe the problem (e.g., insufficient balance). Check the error codes section in the documentation for more details.
Once you understand how the basic send works, you can try other endpoints: for example, using GET for /json/balance only requires sending credentials via Basic Auth, or using POST with the appropriate JSON for /json/prices or /json/scheduled. The previously mentioned Postman collection makes these tests easy without writing commands.
Common errors and how to fix them
- 401 – Unauthorized: Incorrect user or token. Check your credentials or generate a new token.
- 400 – Bad Request: Malformed JSON or missing required fields.
- 429 – Too Many Requests: Exceeded requests per second limit. Adjust your rate or implement queues.
Recommendations for production environments
- Implement retries with exponential backoff.
- Store send codes or IDs (
subid) for later tracking. - Enable delivery notifications (DLR) to receive automatic confirmations.
- Monitor your delivery rates and errors from the control panel.
- The standard limit is 10 requests per second per account. If you need more capacity, implement send queues (RabbitMQ, Redis, etc.) or an asynchronous retry system.
Conclusion
Integrating the LabsMobile SMS API is quick if you follow these steps. Choose the version that best suits your environment, explore the available code examples, generate your API token in the WebSMS dashboard, and select the correct endpoint. With authentication ready and security filters configured to your needs, you’re ready to send your first test message.
At LabsMobile, we provide all the documentation and support you need for a smooth integration. With each message sent, your project benefits from a professional SMS platform that efficiently connects you with your end users.
For more information, check the official LabsMobile API documentation and the code examples section, where you’ll find detailed guides and integration samples for different development environments. Start sending your SMS today!
Additional resources
- Official SMS API documentation: Find the full technical specification and integration guides.
- Code examples: Explore practical examples in various languages.
- Postman collection: Download the collection and test the API directly.
- Knowledge base and FAQs: Access guides, articles, and troubleshooting help.
- Direct contact: If you need personalized help, fill out the contact form.
Start sending your first SMS messages today with LabsMobile. Create a free account and get your API token in minutes.

Our team advises you
Interested in our services?
Our managers and technical team are always available to answer all your questions about our SMS solutions and to advise you on the implementation of any action or campaign.
Contact us

