Eliminación masiva de mensajes SMS
Con esta API puedes borrar cualquier mensaje SMS
Authorizations
Sección titulada «Authorizations »Parameters
Sección titulada « Parameters »Query Parameters
Sección titulada «Query Parameters »Sort order direction (ascending or descending)
Ordenar por marca de tiempo cuando se creó la entidad
Sort order direction (ascending or descending)
Ordenar por fecha y hora de transmisión del mensaje a la red móvil
Boolean filtrar SMS por el is_sent campo para distinguir entre sms ya enviados y aún no enviados
Boolean filtrar SMS por el is_unicode para distinguir entre mensajes GSM y Unicodes
UUID único de entidad
Buscar un SMS por el identificador único
Buscar muchos SMS por los identificadores únicos
Exact filtrar SMS por países del teléfono (ISO 3166-1 alpha-2)
Status of the SMS delivery desde gateway
Example
1Exact filtrar SMS por el estado del informe de entrega
Exact filtrar SMS por los estados del informe de entrega
Estado del SMS. Para más información, consulte SMS status codes
Exact filtrar SMS por el código de estado
Exact filtrar SMS por los códigos de estado
Fecha y hora de envío del mensaje al gateway
Exact filtrar SMS por la fecha y hora de envío a la pasarel
Exact y range filtrar SMS por marcas de tiempo de envío a pasarela
Unix-timestamp de una entrega programada. Si 0 SMS se entrega inmediatamente.
Exact filtrar SMS por la fecha y hora de entrega
Exact y range filtrar SMS por las marcas de tiempo de entrega
Fecha en la que se añadió la entidad al sistema por el usuario
Exact filtrar entidades por la fecha de creación
Exact y range filtrar entidades por las marcas de tiempo de creación
Range filtrar SMS por el número de caracteres del mensaje
Exact y range filtrar SMS por el número de caracteres del mensaje
Recuento de las partes del SMS
Exact filter SMS por el recuento de partes del mensaje
Exact and range filtrar SMS por el recuento de partes del mensaje
UUID único de entidad
Exact filtrar SMS por el Bulk
Exact y range filtrar SMS por el Bulk
Exact filtrar SMS por las fuentes
Exact y range filtrar SMS por las fuentes
El texto del mensaje puede tener una longitud de hasta 1530 caracteres. Con un SMS Unicode, la longitud máxima de caracteres se reduce a 670 caracteres. La codificación interna es UTF-8.
Partial filtro de texto sin distinción entre mayúsculas y minúsculas SMS por el texto del mensaje
Partial text filter SMS by the phone number
ID del remitente del mensaje. Puede ser un número (hasta 15 dígitos) o un texto (hasta 11 caracteres). Si se trata de un número, utilice preferentemente el formato de número de teléfono E.164. Un remitente de texto puede contener espacios pero no otros caracteres especiales. Tenga en cuenta que algunos países no admiten identificadores de remitente propios o exigen un registro previo. Nuestro sistema intenta detectar automáticamente si un ID de remitente es un texto o un número de teléfono. Evite los caracteres especiales en un número e introdúzcalo de la misma forma que se marcaría en un teléfono.
Para mensajes de voz (text2speech, text2speech_ssml): si sender_id no cumple con el formato E.164 (por ejemplo, sin el prefijo +, con caracteres no numéricos), el mensaje se enviará desde el número predeterminado del sistema +493075435114. Algunos proveedores de telefonía posteriores pueden anular o no respetar el número de remitente definido por el usuario — el identificador de llamada real presentado al destinatario depende de las capacidades del proveedor.
Partial texto Filtro de SMS sin distinción entre mayúsculas y minúsculas por el número o el texto del remitente
Dirección IP del host que envió la solicitud
Example
192.168.1.1Partial filtro de texto SMS por la IP que creó el mensaje
Identificador de clave API
Exact filtrar entidades por la clave API utilizada
Exact filtrar entidades por las claves API utilizadas
Valor (String) que se envía de vuelta a su endpoint. Por ejemplo, puede pasar su propio ID de esta forma y recibirlo de vuelta con el informe de entrega (DLR).
Exact filrar por SMS callback_data propiedad
Exact filtrar por SMS callback_data propiedad
Responses
Sección titulada « Responses »Count of the deleted SMS
Batch delete operation response
object
Count of the SMS which was deleted
Example generated
{ "deleted_sms_count": 1}Entrada no valida
El ID de cliente o la clave API no están activos o no son válidos.
La cuenta no está activada. Espere o póngase en contacto con el servicio de asistencia.
La solicitud estaba bien formada pero no se pudo procesar debido a errores semánticos
La dirección IP fue bloqueada temporalmente, ya que durante poco tiempo se enviaron muchas solicitudes con credenciales no válidas. Espere y pruebe más tarde.
Code Samples
#!/usr/bin/env bashcurl -X POST https://api.lox24.eu/sms/ops/batch_delete?uuid=20f39273-0566-11ea-a637-96000028b339 \ -H 'X-LOX24-AUTH-TOKEN: 1234567:e3f3a759b6677959b6ebfcxxxxxxxxxx'using Newtonsoft.Json.Linq;using System;using System.IO;using System.Net;using System.Text;
namespace Lox24.Api{ class client { static void Main() { string key = "1234567:e3f3a759b6677959b6ebfcxxxxxxxxxx"; string text = "Test";
var query = "text=" + text + "&uuid[]=ab6b6ceb-903a-11ea-aa81-96000028b339&uuid[]=7c7a6661-902e-11ea-aa81-96000028b339"; string url = "https://api.lox24.eu/sms/ops/batch_delete?" + query;
var httpWebRequest = (HttpWebRequest)WebRequest.Create(url); httpWebRequest.ReadWriteTimeout = 100000; httpWebRequest.Accept = "application/json"; httpWebRequest.Method = "POST"; //httpWebRequest.KeepAlive = true; httpWebRequest.Headers.Add("X-LOX24-AUTH-TOKEN", key); httpWebRequest.Credentials = CredentialCache.DefaultNetworkCredentials;
try { using (HttpWebResponse resp = (HttpWebResponse)httpWebRequest.GetResponse()) { if(resp.StatusCode == HttpStatusCode.OK) { Console.WriteLine("Success: SMS was deleted!"); } else { Console.WriteLine("Error: SMS wasn't deleted!"); }
Stream respStream = resp.GetResponseStream(); using (StreamReader sr = new StreamReader(respStream, Encoding.UTF8)) { string responseText = sr.ReadToEnd(); Console.WriteLine("responseText : {0}", responseText); } }
} catch (WebException ex) { var webResponse = ex.Response as System.Net.HttpWebResponse; Console.WriteLine("Error:{0}", webResponse.StatusCode);
switch (webResponse.StatusCode) { case HttpStatusCode.Unauthorized: // 401 Console.WriteLine("Error:401 Client ID or API key isn't active or invalid!"); break; case HttpStatusCode.Forbidden: // 403 Console.WriteLine("Error:403 Account isn't activated. Please wait or contact to support!"); break; case HttpStatusCode.InternalServerError: // 500 case HttpStatusCode.BadGateway: //502 case HttpStatusCode.ServiceUnavailable: // 503 case HttpStatusCode.GatewayTimeout: // 504 Console.WriteLine("System error! Please contact to LOX24 support!"); break; } } } }package main
import ( "fmt" "io/ioutil" "log" "net/http")
func main() {
const Method = "POST" const URL = "https://api.lox24.eu/sms/ops/batch_delete?uuid=20f39273-0566-11ea-a637-96000028b339" const Token = "1234567:e3f3a759b6677959b6ebfcxxxxxxxxxx"
client := &http.Client{}
req, err := http.NewRequest(Method, URL, nil) if err != nil { log.Fatal(err) }
req.Header.Add("X-LOX24-AUTH-TOKEN", Token) req.Header.Add("Accept", "application/json")
res, err := client.Do(req) if err != nil { log.Fatal(err) }
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body) if err != nil { log.Fatal(err) }
switch res.StatusCode { case 200: fmt.Println((string(body))) case 401: fmt.Println("Error: code = 401 - Client ID or API key isn't active or invalid!") case 403: fmt.Println("Error: code = 403 - Account isn't activated. Please wait or contact to support!") default: fmt.Printf("Error: code = %d\n", res.StatusCode) }}package eu.lox24.doc.sms;
import java.io.IOException;import java.net.HttpURLConnection;import java.net.URI;import java.net.http.HttpClient;import java.net.http.HttpRequest;import java.net.http.HttpResponse;import java.time.Duration;
public class SmsOpsCancelSmsCollection {
public static void main(String[] args) {
var key = "1234567:e3f3a759b6677959b6ebfcxxxxxxxxxx";
var text = ""; var query = "text=" + text + "&uuid[]=ab6b6ceb-903a-11ea-aa81-96000028b339&uuid[]=7c7a6661-902e-11ea-aa81-96000028b339"; var url = "https://api.lox24.eu/sms/ops/batch_delete?" + query;
var httpRequest = HttpRequest.newBuilder(URI.create(url)) .timeout(Duration.ofMillis(100000)) .setHeader("Accept", "application/json") // or application/ld+json .setHeader("X-LOX24-AUTH-TOKEN", key) .POST(HttpRequest.BodyPublishers.ofString("")) .build();
var client = HttpClient.newBuilder() .version(HttpClient.Version.HTTP_1_1) // Http 1.1 clients are kept alive be default .build();
try { var httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
if (httpResponse.statusCode() == HttpURLConnection.HTTP_OK) { System.out.println("Success:" + httpResponse.statusCode() + " " + "Success: SMS was canceled!"); System.out.println("Response text : \n" + httpResponse.body()); } else { System.out.println("Error: SMS wasn't canceled!"); System.out.println("Response text : \n" + httpResponse.body());
System.out.println("Error: " + httpResponse.statusCode());
switch (httpResponse.statusCode()) {
case HttpURLConnection.HTTP_UNAUTHORIZED: // 401 System.out.println("Error:401 Client ID or API key isn't active or invalid!"); break; case HttpURLConnection.HTTP_FORBIDDEN: // 403 System.out.println("Error:403 Account isn't activated. Please wait or contact to support!"); break; case HttpURLConnection.HTTP_NOT_FOUND: // 404 System.out.println("Error:404 Resource not found"); break; case HttpURLConnection.HTTP_INTERNAL_ERROR: // 500 case HttpURLConnection.HTTP_BAD_GATEWAY: //502 case HttpURLConnection.HTTP_UNAVAILABLE: // 503 case HttpURLConnection.HTTP_GATEWAY_TIMEOUT: // 504 System.out.println("System error! Please contact to LOX24 support!"); break; }
}
} catch (IOException | InterruptedException e) { e.printStackTrace(); } }}const host = 'api.lox24.eu';const token = "1234567:e3f3a759b6677959b6ebfcxxxxxxxxxx";
var query = "uuid[]=44657141-9830-11ea-aa81-96000028b339&uuid[]=5dd2ba0e-9830-11ea-aa81-96000028b339&_order[created_at]=desc";
const https = require('https');const options = { hostname: host, path: '/sms/ops/batch_delete?' + query, method: 'POST', headers: { 'Accept': 'application/json', 'Content-Type': 'application/json', 'X-LOX24-AUTH-TOKEN': token }}
const req = https.request(options, res => { if (res.statusCode == 200) { console.log("Success: code = 200 - Count of the deleted SMS"); res.on('data', d => { process.stdout.write(d) }) } else if (res.statusCode == 401) { console.log("Error: code = 401 - Client ID or API key isn't active or invalid!"); } else if (res.statusCode == 403) { console.log("Error: code = 403 - Account isn't activated. Please wait or contact to support!"); } else { console.log("Error: code = " + res.statusCode ); }})
req.on('error', error => { console.error(error)})
req.end();<?php
$token = '1234567:e3f3a759b6677959b6ebfcxxxxxxxxxx';
$uri = 'https://api.lox24.eu/sms/ops/batch_delete';
$filters = [ //'text' => 'Test', 'uuid' => [ '8481900d-86ce-11ea-aa81-96000028b339', 'd5ceb189-86cd-11ea-aa81-96000028b339', ],];
$uri .= $filters ? '?' . http_build_query($filters) : '';$curl = curl_init();
echo $uri;
curl_setopt_array($curl, [ CURLOPT_POST => true, CURLOPT_URL => $uri, CURLOPT_HTTPHEADER => [ "X-LOX24-AUTH-TOKEN: {$token}", 'Accept: application/json', // or application/ld+json ], CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 20, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,]);
$response = curl_exec($curl);$code = curl_getinfo($curl, CURLINFO_HTTP_CODE);curl_close($curl);
$data = json_decode($response, JSON_OBJECT_AS_ARRAY);
if(200 === $code) { echo 'SMS canceled, info = ' . var_export($data, true);} else { echo "Error: code = {$code}, data = " . var_export($data, true);}import jsonimport requests
token = "1234567:e3f3a759b6677959b6ebfcxxxxxxxxxx"text = "Test"
query = f"text={text}&uuid[]=ab6b6ceb-903a-11ea-aa81-96000028b339&uuid[]=7c7a6661-902e-11ea-aa81-96000028b339"
url = f"https://api.lox24.eu/sms/ops/batch_delete?{query}"
headers = { 'Accept': 'application/json', 'X-LOX24-AUTH-TOKEN': token,}
try: # timeout is 100 seconds, the payload is automatically converted to json format res = requests.post(url, headers=headers, timeout=100) if res.status_code != 200: # Ok print("Error: SMS wasn't canceled") res.raise_for_status() else: print(f'Success: code = {res.status_code} - SMS was canceled') print("Response: ", json.dumps(res.json(), indent=4))
except requests.HTTPError: if res.status_code == 401: print("Error: code = 401 - Client ID or API key isn't active or invalid!") elif res.status_code == 403: print("Error: code = 403 - Account isn't activated. Please wait or contact to support!") elif res.status_code in (500, 502, 503, 504): print("System error! Please contact to LOX24 support!") else: print(f"Error: code {res.status_code}") print(json.dumps(res.json(), indent=4))