How to Send SMS via API February 07, 2024 03:13 Updated Index: Introduction of New Security Measures New Process for Sending SMS How to Request Template Creation Sending SMS via API SMS Channel Best Practices Support We are enhancing our services to ensure the security and efficiency of our platform. In this context, we would like to inform you about some significant changes in the SMS channel and the implementation of additional security measures. Introduction of New Security Measures These measures are essential to ensure the integrity and confidentiality of the information transmitted through our services. New Process for Sending SMS From now on, it is necessary to create a template for SMS sending. Our responsible team has already created some pre-configured templates, but it is extremely important that you inform us of the messages you wish to transmit via SMS so that we can create the templates according to the content. This template creation will be carried out upon request to our support team or via WhatsApp. If you encounter difficulties in opening the request, please send an email to support. How to Request Template Creation To request the creation of templates for your SMS sends, please open a request through our support system with the content of the message you use at the time of sending, so that we can create the template accurately, avoiding any future errors. Example: Request Subject: SMS channel template creation Request Content: Please include here the description of the text you wish to be implemented in the template. Note: It is important to emphasize that requests need to be opened at least 48 business hours before the template's usage need for the team to be able to register it. Sending SMS via API The process of sending SMS via API is quite simple. Follow the steps below to send your message: Note: Images and videos are sent through a link that redirects to the sent image/video. Before sending your message, pay attention to the number of characters and special characters in your message, as different message lengths incur different charges. An SMS text can contain up to 160 characters, but when using special characters, all characters in the messages are counted differently, and the message limit becomes 70 instead of 160. Examples of characters considered special: (ç, á, ã, etc.) Attention: Due to the SMS sending protocol, when sending a message that exceeds the character limit of a single message, the sending of multiple SMS consumes some characters of the message to combine the text at the destination. That is, for a message with a special character (70-character limit to count as 1 SMS), a 140-character text will not charge for two messages but three, since the message sending will consume 3 characters from each part of the message. For sending a message with a 160-character limit, the sending will consume 7 characters from each part of the message. Example of character limit Character Quantity Limit per Message Division Quantity of Messages 70 (with special) 70 1 71 (with special) 67 2 135 (with special) 67 3 160 160 1 320 153 3 Examples of words and their number of characters due to the use of special characters, note that these characters are in bold: Word Message character limit Olá 70 Ola 160 Atenção! 70 Atencao 160 Below is an example of sending a message with your number of characters and the quantity of messages due to the use of special characters. Message Number of characters Quantity of Messages Hola a todos!! ¿Cómo están? Atención, este es un mensaje de prueba de envío de SMS. ¡Has sido premiado con 10.000 dólares en bonos! Accede a Instagram @testDeMensaje ¡y compruébalo! 193 3 Hola a todos! ¿Como estan? Atencion, este es un mensaje de prueba de envío de SMS. Has sido premiado con 10 mil dolares en bonos. Accede al enlace ¡y compruebalo! 147 1 (Table of characters considered "non-special") 1) Requests To send a request via API, it is necessary for you to access an HTTP request application, for example, Postman. If you haven't installed it, you can access here: Furthermore, just for informational purposes, most requests in this documentation will have the fields below: Field Enter the information Id Unique message identifier to Enter the phone number of the person who will receive the message (“+” + DDI + DDD + 9th digit) + @sms.gw.msging.net. For example: +5511988887777@sms.gw.msging.net type text/plain content Enter the text of the desired message and the created template; Note: in the "to" field, it is mandatory to include the "+" before the country code, since the "+" is used for international SMS. To generate the ID of the requests below, you can generate it manually or through a free GUID generator. Microsoft GUID Guideline Link: Guid.NewGuid Method (System) | Microsoft Docs Free Online GUID Generator Link: Free Online GUID Generator 2) Individual Dispatch If you want to send an SMS to just one number, your dispatch will be individual. First, use the 'Send a Message' request. You can access more details about this request at: Blip Docs | API Reference Modify the 'to' field to the following pattern. This field indicates to whom you want to send the message: “+” + Country Code + Area Code (with the 9th digit included) + phone number + @sms.gw.msging.net Number Number with Pattern +5511988887777 +5511988887777@sms.gw.msging.net 4) In the 'content' field, which represents the message content, add the desired message text and the created template. 5) Select the "POST" option to set the request type and send. 6) Your request will follow the following template: 6) There you go, you've sent an SMS via API! 3) Multiple Dispatches: If you wish to send an SMS to several numbers, your dispatch will be to multiple contacts. Create a distribution list using the 'Create a List' request, POST method. You can access more details about this request at: Blip Docs | API Reference With the list created, add the users you want to impact using the 'Add a member to a list' request following the format below. You can access more details about this request at: Blip Docs | API Reference. {{complete user number with the ninth digit}}@sms.gw.msging.net. To send the message, use the 'Send a message' request with the full name of the list created in the 'to' field, the message content, and the template in the 'content' field. You can access more details about this request at: Blip Docs | API Reference. There you go, you've sent an SMS via API! SMS Channel Best Practices 1) Activate SMS on a chatbot exclusive for SMS To facilitate message control, we recommend that the SMS flow be exclusive to an SMS chatbot, meaning it is not recommended to activate SMS in a chatbot that has WhatsApp flow. In this case, create a separate chatbot just for the SMS flow. If you activate SMS in a chatbot that has WhatsApp flow and trigger an interactive component, such as buttons or dynamic content, since these components do not exist in SMS and both channels are using the same flow, the component will not be sent in the expected format, and you may also be charged a greater number of messages due to the number of characters that this behavior will generate. Thus, the message will not work as intended, will be very extensive, and will also contain various special characters that will be financially counted. Types of messages allowed in SMS Types of messages not allowed in SMS Texts Buttons Images* Quick Reply Video Menu Web link Audio Carousel Search Location Dynamic Content Images and videos: are sent through a link that redirects to the sent image/video. 2) To only send active messages, there's no need for a chatbot flow. If you only want to send messages to your user, without needing to receive responses to that message, simply activate your SMS in a chatbot that doesn't have a flow in the Builder. If such a flow exists, waiting for user responses and continuing the “conversation” between the client and the chatbot, there will be a charge for the continued messages sent. Support We are committed to providing continuous support during this transition period. Our support team is available to assist you in the template request process and to help with any questions if necessary. We appreciate your understanding and collaboration during this security enhancement process. We are confident that these changes will further strengthen the reliability of our services. For more information, visit the discussion on the subject in our community or the videos on our channel. 😃 Related articles Sending WhatsApp Active Messages on Blip Desk Finding my bot's API-KEY FAQ - Channels How to send WhatsApp notifications through Blip API Custom Breaks