Última actualización: 13.04.2022
¿Como se realiza la integración de un servicio SMS en un CRM o sistema de gestión empresarial? En este post explicamos qué es una plataforma SMS API y cómo realizar la migración.
Es un sistema que permite gestionar el envío de notificaciones SMS a los clientes a través de una interfaz práctica y completa. Gracias a la API SMS podemos enviar mensajes de forma rápida y segura.
Ofrece un canal de comunicación rápido y eficaz para enviar mensajes de texto programables y personalizables de forma masiva.
Es también versátil y seguro. Permite realizar puentes de verificación OTP (One time password) y procesos de autentificación de usuarios a través del número de teléfono.
En la página web se pueden descargar los manuales con los detalles para cada servicio:
– JSON
– GET (Http/GET)
– POST (Http/POST XML)
– WSDL (Webservice)
– SMTP (MailSMS)
También están disponibles conexiones OneAPI, SMPP, GSMA, 2FA, OTP y para funciones administrativas como subcuentas.
Aquí algunos ejemplo de códigos para insertar en distintos lenguajes:
– PHP
<?php $auth_basic = base64_encode("myusername:mypassword"); $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://api.labsmobile.com/json/send", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => '{"message":"Text of the SMS message", "tpoa":"Sender","recipient":[{"msisdn":"12015550123"},{"msisdn":"447400123456"},{"msisdn":"5212221234567"}]}', CURLOPT_HTTPHEADER => array( "Authorization: Basic ".$auth_basic, "Cache-Control: no-cache", "Content-Type: application/json" ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
– JAVA
HttpResponse<String> response = Unirest.post("https://api.labsmobile.com/json/send") .header("Content-Type", "application/json") .basicAuth("myusername","mypassword") .header("Cache-Control", "no-cache") .body("{\"message\":\"Text of the SMS message\", \"tpoa\":\"Sender\",\"recipient\":[{\"msisdn\":\"12015550123\"},{\"msisdn\":\"447400123456\"},{\"msisdn\":\"5212221234567\"}]}") .asString();
– VB.net
Dim myReq As HttpWebRequest Dim myResp As HttpWebResponse myReq = HttpWebRequest.Create("https://api.labsmobile.com/json/send") myReq.Method = "POST" myReq.ContentType = "application/json" myReq.Headers.add("Authorization", "Basic " & Convert.ToBase64String(Encoding.UTF8.GetBytes("myusername:mypassword"))) Dim myData As String = "{\"message\":\"Text of the SMS message\", \"tpoa\":\"Sender\",\"recipient\":[{\"msisdn\":\"12015550123\"},{\"msisdn\":\"447400123456\"},{\"msisdn\":\"5212221234567\"}]}" myReq.GetRequestStream.Write(System.Text.Encoding.UTF8.GetBytes(myData), 0, System.Text.Encoding.UTF8.GetBytes(myData).Count) myResp = myReq.GetResponse Dim myreader As New System.IO.StreamReader(myResp.GetResponseStream) Dim myText As String myText = myreader.ReadToEnd
– Ruby
require 'uri' require 'net/http' require 'base64' url = URI("https://api.labsmobile.com/json/send") http = Net::HTTP.new(url.host, url.port) request = Net::HTTP::Post.new(url) request["Content-Type"] = 'application/json' request["Authorization"] = 'Basic ' + Base64::encode64("myusername:mypassword") request["Cache-Control"] = 'no-cache' request.body = "{\"message\":\"Text of the SMS message\", \"tpoa\":\"Sender\",\"recipient\":[{\"msisdn\":\"12015550123\"},{\"msisdn\":\"447400123456\"},{\"msisdn\":\"5212221234567\"}]}" response = http.request(request) puts response.read_body
– C#
var client = new RestClient("https://api.labsmobile.com/json/send"); client.Authenticator = new HttpBasicAuthenticator("myusername", "mypassword"); var request = new RestRequest(Method.POST); request.AddHeader("Cache-Control", "no-cache"); request.AddHeader("Content-Type", "application/json"); request.AddParameter("undefined", "{\"message\":\"Text of the SMS message\", \"tpoa\":\"Sender\",\"recipient\":[{\"msisdn\":\"12015550123\"},{\"msisdn\":\"447400123456\"},{\"msisdn\":\"5212221234567\"}]}", ParameterType.RequestBody); IRestResponse response = client.Execute(request);
Lo mejor de la SMS API de LabsMobile es que puede probarse de forma totalmente gratuita. Una forma perfecta de realizar la integración SMS y comprobar por uno mismo las ventajas del envío masivo de mensajes de texto. Un modo de comunicación eficaz y versátil. Además de seguro, y con mucho potencial de futuro.