Estado del Mensaje
URL:https://www.onurix.com/api/v1/messages-state
Verifica el estado de un grupo de mensajes SMS y llamadas
Parametros.
Nombre | Tipo | Requerido | Descripción |
---|---|---|---|
client | integer(int64) | true | El Id del cliente |
key | string | true | Key de la cuenta Onurix |
id | string | true | Id del mensaje |
Respuesta.
Estado | Significado | Descripción | Esquema |
---|---|---|---|
200 | OK | Operación exitosa | JsonResponse |
400 | Error | Parametros invalidos | JsonResponse |
520 | Unknown | Error interno del sistema | ErrorResponse |
Code request
curl -X GET "https://www.onurix.com/api/v1/messages-state?client=AQUI_SU_CLIENT_ID&key=AQUI_SU_KEY&id=AQUI_SU_MENSAJE_ID"
Code request
<?php
// Ejecutar: composer require guzzlehttp/guzzle:*
require'vendor/autoload.php';
$headers=array(
'Content-Type'=>'application/x-www-form-urlencoded',
'Accept'=>'application/json',
);
$client= new \GuzzleHttp\Client();
try{
$response=$client->request('GET','https://www.onurix.com/api/v1/messages-state?client=AQUI_SU_CLIENT&key=AQUI_SU_KEY&id=AQUI_ID',array(
'headers'=>$headers,
)
);
print_r($response->getBody()->getContents());
}
catch(\GuzzleHttp\Exception\BadResponseException $e){
// Manejar excepciones o errores de API
print_r($e->getMessage());
}
Code request
import requests
headers ={
'Content-Type':'application/x-www-form-urlencoded',
'Accept':'application/json'
}
r = requests.get('https://www.onurix.com/api/v1/messages-state?client=AQUI_SU_CLIENT&key=AQUI_SU_KEY&id=AQUI_ID_MENSAJE', headers = headers)
print(r.json())
Code request
//Este codigo fue hecho en .net 6
using System.Net.Http;
namespace PruebaOnurix
{
public class Program
{
public static void Main(string[] args)
{
VerificationMessage("AQUI_SU_CLIENT", "AQUI_SU_KEY", "AQUI_SU_MENSAJE_ID");
}
public static void VerificationMessage(string client, string key,string idMensaje)
{
using var httpClient = new HttpClient()
{
BaseAddress = new Uri("https://www.onurix.com/"),
};
HttpResponseMessage request = httpClient.GetAsync($"api/v1/messages-state?client={client}&key={key}&id={idMensaje}").Result;
string responseString = request.Content.ReadAsStringAsync().Result;
Console.WriteLine(responseString);
}
}
}
Code request
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/x-www-form-urlencoded"},
"Accept": []string{"application/json"},
}
req, err := http.NewRequest("GET", "https://www.onurix.com/api/v1/messages-state?client=AQUI_SU_CLIENT&key=AQUI_SU_KEY&id=AQUI_SU_MENSAJE_ID", nil)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
Code request
// Ejecutar: npm install axios --save
const axios = require('axios').default;
let headers = {headers:
{ 'content-type': 'application/x-www-form-urlencoded'}
};
axios.get('https://www.onurix.com/api/v1/messages-state?key=AQUI_SU_KEY&client=AQUI_SU_CLIENT&id=AQUI_SU_MENSAJE_ID',headers)
.then(resp=>{
console.log(resp.data);
}).catch(error=>{
console.log(error);
});
Code request
//Para este codigo se uso jdk 11
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class VerificationMessage {
public static void main(String[] args) throws IOException, InterruptedException {
// TODO Auto-generated method stub
var httpClient = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder(URI.create("https://www.onurix.com/api/v1/messages-state?client=AQUI_SU_CLIENT&key=AQUI_SU_KEY&id=AQUI_SU_MENSAJE_ID"))
.version(HttpClient.Version.HTTP_2)
.GET()
.build();
var response = httpClient.send(request, HttpResponse.BodyHandlers.ofString());
//System.out.println(response.body());
}
}
Body parameters
client: 0,
key: "string",
id: "string"
Respuesta de ejemplo
Response 200
{
"state": "string",
"credits": 0,
"phone": 0,
"created": "string",
"sms": "string",
"dispatch_id": "string",
"id": "string"
}
Si requiere asistencia o tiene un problema, envienos un mensaje para poder ayudarlo
soporte@onurix.com