How to Send SMS via API January 24, 2025 13:17 Updated Index: New process for sending SMS How to request the creation of templates Sending SMS via API Best Practices for the SMS Channel Support We are improving our services to ensure the security and efficiency of our platform. In this context, we would like to inform you about some significant changes to the SMS channel and the implementation of additional security measures. New process for sending SMS From now on, it is required to create and approve a template for SMS sending (also known as Message Template). Unlike WhatsApp message templates, which are created in Blip or directly in your company's WhatsApp account, for the SMS channel, you need to submit a request through our support system with the desired message content. Our team will review the requested content for compliance before making it available for use. The template information is registered in our database, adding an extra layer of security to the use of the channel. This measure aims to prevent the sending of malicious messages to numbers associated with customer channels, ensuring the protection and integrity of the communication process. How to request the creation of templates To request the creation of templates for your SMS sends, you need to submit a request through our support system, via the website or WhatsApp, at least 48 business hours before using the template. This request must include the message content that will be used at the time of the SMS send, so our team can review and create the template accurately, avoiding any future mistakes. Before creating your message template, pay attention to the number of characters and special characters in your message, as there are different charges based on the message size. Also, images and videos are sent through a link that redirects to the image/video. The use of variables in templates is allowed. To do this, you must specify the exact points in the text where the variables will be used, placing the content between {{}} and specifying the type of each variable (text only, numbers only, or alphanumeric). An SMS text can contain up to 160 characters, but when using special characters, each character is counted differently, and the message limit changes to 70 instead of 160. See more details in the Sending SMS via API section below. Note: the characters of the variables are also counted in the total character count of the message. Request: Now that you have created the structure of your template following the above guidelines, submit a request to our support team, following the example below: Request subject: SMS channel template creation Request content: include here the description of the text you want to be implemented in the template. Example: Example 1: “Hi {{1}}! Your ticket is available right now at www.blipid.com.br/{{2}}” {{1}} = text variable {{2}} = alphanumeric variable (text and numbers)Character count, without the variable content: 74 Example 2: “Your code is: {{1}}” {{1}} = numeric variable, 6 digits Total character count for the template: 19 Example 3: “EXCLUSIVE offer to pay off your debt today, {{1}}! Don’t miss the opportunity: https://blipbank.com.br/{{2}}” {{1}} = text variable {{2}} = alphanumeric variable (text and numbers) In this example, note that we’ve included the words without the correct accents to prevent them from being transformed into special characters, which would reduce the character limit. Character count, without the variable content: 100 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. Observation:To check the status of sent notifications, you need to query the event: First you need to get the identifier of the active message sent via API in the links: Get last messages (per user identity) Get logged messages (all users) Dthen, get the status of that specific active message using the following request: Get notifications of a message Possible events (status): event: Event related to the message. The recipient's events depend on the channel and may not be available. The valid values are: accepted: The message has been accepted by the server. dispatched: The message has left the server and was dispatched to recipient. received: The recipient has received the message. consumed: The recipient has read the message. failed: The message has failed. In this case, the property reason must be present. reason: In case of failed events, it represents the reason of the message failure. It contains the following properties: code: The failure's numeric code. This value is mandatory. description: Failure's description message. 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 How to send WhatsApp notifications through Blip API How to build bots using SDKs or HTTP API Audience file configuration - Bulk notification sending Sending WhatsApp Active Messages on Blip Desk Action: HTTP request