Best Practices and Recommendations

Modified on Tue, 10 Sep at 1:05 PM

API Recommendations

Tips for SMS API integration



In this section, you will find recommendations and technical aspects to consider in any integration with an SMS API. The tips and recommendations gathered here can be applied to any integration with any SMS provider. However, some functionalities and characteristics specific to the LabsMobile platform are described.


Our technical department has professionals with more than 10 years of experience in the SMS sector. After countless integrations, we have compiled this list of key points and topics to review in any SMS integration.


We strongly request that all users who integrate their applications with our SMS API check and review the following points:



 Configuration


It is recommended to review the account configuration. In particular:


Account preferences

  • Language
  • Default country (to add the prefix to messages, import processes, etc.).
  • Time Zone
  • Currency
  • Maximum messages per day


Notification settings

  • Activation of desired notifications
  • Email(s) for receiving notifications, alerts, 2FA codes.
  • Custom balance alert


Billing and contact information

  • Verified mobile phone



 Security


Https connection


You should always use a URL that incorporates the HTTPS protocol in any API version.


https://api.labsmobile.com/...


API Token


It is highly recommended to use an API token as a password in API connections. It is possible to generate as many API tokens as necessary in the 'Security and passwords' section of the LabsMobile account.


The benefit of this measure is twofold. It adds more security by not exposing the general account password and also eliminates the need to modify the API integration when the account password is changed.


It is advisable to create an API token for each different project, application, or use.


IP Filter


It is possible to limit the allowed IP addresses to make requests to the LabsMobile API.


In the 'Account Preferences' section, you can add one or more IP addresses of the client's servers or systems that access the API.


This measure blocks any unauthorized access by third parties even if they have a valid password or token.


Passwords and 2FA


It is necessary to store the account access password (and API tokens) encrypted and in a safe place following security standards.


It is recommended not to exchange or communicate any credentials via email or unencrypted channels that could be intercepted by third parties.


We also recommend frequently modifying any access or authentication credentials (changing the password at least every 6 months).


2FA authentication (using a password and security code) is mandatory for accessing the LabsMobile account control panel. This protects against unauthorized access to confidential/personal data and preserves the account balance and payment methods.




 Consumption and SMS types


Types of SMS messages


There are two types of SMS messages: Standard and Unicode. These two types of messages differ in the characters they can contain and their capacity.


Standard SMS messages can contain up to 160 characters from the GSM alphabet. This means that, it is possible to send the following characters: ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz0123456789@£¥èéùìòÇØøÅåΔΦΓΛΩΠΨΣΘΞÄÖÑܧäöñüà_^|{}[~]€ÆæßÉ!/"#¤%&'()*+,-.|:;<=>?.


Unicode SMS messages can contain any character, symbol, emoji, etc., but the maximum capacity is 70 characters.


It is possible to send concatenated SMS messages (either standard or unicode) that the recipient will see as a single message.


Credits per message or bulk messages


The credit consumption of a message is calculated based on the destination country, SMS type (standard or unicode), and the length of the message characters.


Each destination country has its SMS cost (unit cost per standard SMS) which can be consulted in the SMS Prices section.


If the message text contains only characters from the GSM alphabet, standard SMS will be sent, and the credit cost will depend on the destination country and message length:


From 1 to 160 GSM characters => X

From 161 to 306 GSM characters => 2X

From 307 to 459 GSM characters => 3X

From 460 to 612 GSM characters => 4X


(Where X is the unit cost of the destination country or countries)


In the case of unicode SMS, the credit calculation is performed as follows:


From 1 to 70 characters => X

From 71 to 134 characters => 2X

From 135 to 201 characters => 3X

From 202 to 268 characters => 4X


(Where X is the unit cost of the destination country or countries)


It is not recommended to send messages with a length greater than 4 concatenated segments.


It is possible to consult the number of credits for a message or bulk messages, with our message sending tool within the WebSMS application.



 Characteristics by destination


Each destination has specific SMS messages characteristics determined by the telecom operators of each country.


Specifically, depending on the country, the following may vary:


  • Sender. Depending on the legislation or telecom operators of each country, the sender field can be customized in each message (dynamic), have a fixed value (numeric, alphanumeric - longcode or shortcode), or be random.
  • Delivery confirmation. There are delivery confirmations where the local operator confirms the validity of the message. Or device delivery confirmations where the recipient's terminal confirms the reception of the SMS.
  • Allowed schedule. According to the legislation or the rules of the operators, there may be a time limitation for sending SMS messages. Messages sent outside this allowed schedule will be blocked and not delivered.
  • Content and uses. Depending on the destination, there may be limitations on the content (political messages, trademarks, financial entities, prohibited keywords, etc.) and the use or application (transactional or promotional).
  • SMS reception. The SMS reception service may be available with virtual longcode or shortcode numbers.


You can consult the particularities of each country in the 'Credits and services by country' section, they will also appear as a warning when making any SMS sendings from WebSMS. You can also contact our Support Center.



 Filters and limits


Duplication filter


The LabsMobile platform has a filter to avoid sending duplicate messages to the same recipient.


Duplicate messages are considered from the second SMS with the same text and sender sent to the same recipient within 60 minutes. These messages are not sent, do not generate cost, and are labeled as duplicates.


It is possible to deactivate this filter in the 'Account Preferences'.


Time filter


Through the 'Account Preferences' section, it is possible to establish a non-allowed SMS sending schedule.


Any attemps made during these non-allowed hours will be temporarily blocked and will be sent in the next allowed hour.


Blocked messages can be consulted and canceled in the 'Scheduled' section of the account.


Country filter


In the 'Account Preferences', you can configure the possible destination countries for the account's messages. If no country is defined, the account will be able to send to any destination.


Messages sent to non-allowed countries will be blocked and will not have a cost.


Daily maximum and per bulk sending


In the 'Account Preferences', a maximum of messages per day (100,000 by default) and a maximum number in the same sending (10,000 by default) are defined.


If any of the limits are reached, the messages will be temporarily blocked pending manual validation by our staff.



 Alerts and notifications


Balance alert


The platform will send an email when the account reaches a limit of 10 credits or lower.


In addition, in the 'Notification Settings', it is possible to set a custom alert when the balance reaches a certain number of messages to the default country.


Automatic recharges


To avoid running out of account balance and not interrupting messages, it is recommended to configure 'Automatic Recharges'.


Automatic recharges set a balance limit at which an established credit purchase or recharge will be made.



 Suggested tests


Special characters: Depending on the API version and format (URL, XML, JSON, etc.), it is necessary to encode the values or escape a series of special characters (such as & ' " ! + < = >).


Country prefix: It is mandatory to add the prefix of the destination country for each number. The only exception is messages to the default configured country. In this case, the platform will add the prefix automatically.


Without text: Verify that a message is never sent out without the text field or with an empty message.


Without sender: It is possible to send messages without the sender field, and in that case, the default sender of the account will be adopted.


Without recipient: Verify that a message is never sent out without recipients.


Concatenated messages: Check the length of the messages and limit, if desired, to a certain number of concatenated segments.


Unicode messages: Choose whether to send unicode messages and, if so, check the cost and variables.


Variables: Check the possible values of variables and ensure that these variables do not contain not allowed characters or exceed the allowed or desired length.


API call result: Check the result (error codes) of any API call. This way, alerts can be set, sent messages can be labeled, and retries can be made in case of connection errors.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article