NAV Navigation
CurlPHPPythonC#GONodeJava

Onurix API v1.0.0

Desplácese hacia abajo para ver ejemplos de código, solicitudes de ejemplo y respuestas. Seleccione un idioma para las muestras de código de las pestañas de arriba o del menú de navegación móvil.

Aqui se describe el API -REST a fin de enviar mensajes de texto por medio de la plataforma https://www.onurix.com, para utilizarlos usted previamente debe haber permitido la IP del servidor donde se va a ejecutar el script que va a consumir el API, el key key y codigo de client client siempre debe enviarse en cada petición, para realizar la configuracion de la IP y consultar estos parametros ingrese a su cuenta menu Seguridad.

Base URLs:

Email: Support

Balance

Consulta el numero disponible de creditos de una cuenta

URL

Obtiene el balance de una cuenta

Code samples

# También puede usar wget
curl -X GET https://www.onurix.com/api/v1/messages-state?client=AQUI_SU_CLIENT&key=AQUI_SU_KEY
# Ejecutar: composer require guzzlehttp/guzzle:*
<?php

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/balance?client=AQUI_SU_CLIENT&key=AQUI_SU_KEY',
array(
'headers'=>$headers,
)
);
print_r($response->getBody()->getContents());
}
catch(\GuzzleHttp\Exception\BadResponseException$e){
// Manejar excepciones o errores de API
print_r($e->getMessage());
}

// ...
import requests
headers ={
'Content-Type':'application/x-www-form-urlencoded',
'Accept':'application/json'
}

r = requests.get('https://www.onurix.com/api/v1/balance?client=AQUI_SU_CLIENT&key=AQUI_SU_KEY', headers = headers)

print(r.json())
usingSystem;
usingSystem.Collections.Generic;
usingSystem.Net.Http;
usingSystem.Net.Http.Headers;
usingSystem.Text;
usingSystem.Threading.Tasks;
usingNewtonsoft.Json;

/// <<summary>>
/// Ejemplo de Http Client
/// <</summary>>
publicclassHttpExample
{
privateHttpClient Client {get;set;}

/// <<summary>>
/// Configurar http client
/// <</summary>>
publicHttpExample()
{
Client = new HttpClient();
}

/// Hacer una solicitud
public async Task MakeGetRequest()
{
string url ="https://www.onurix.com/api/v1/balance?client=AQUI_SU_CLIENT&key=AQUI_SU_KEY";
var result = await GetAsync(url);
}

/// Realiza una solicitud GET
public async Task GetAsync(string url)
{
//Iniciar la solicitud
HttpResponseMessage response =await Client.GetAsync(url);

//Validar resultado
response.EnsureSuccessStatusCode();

//Contenido de la petición
response.Content.ReadAsStringAsync();

}

}
package main

import(
"fmt"
"strings"
"net/http"
"io/ioutil"
"io/ioutil"
)

funcmain(){

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/balance?client=AQUI_SU_CLIENT&key=AQUI_SU_KEY", 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))
}
// Ejecutar: npm install request --save
var requests = require("request");

var options = {
method: 'GET',
url: 'https://www.onurix.com/api/v1/balance?key=AQUI_SU_KEY&client=AQUI_SU_CLIENT',
headers:{ 'content-type': 'application/x-www-form-urlencoded' },
};
var test = requests(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});



URL obj =newURL("https://www.onurix.com/api/v1/balance?client=AQUI_SU_CLIENT&key=AQUI_SU_KEY");
HttpURLConnection con =(HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setDoOutput(true);
con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
con.setRequestProperty("charset","utf-8");
int responseCode = con.getResponseCode();
BufferedReader in =newBufferedReader(
newInputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response =newStringBuffer();
while((inputLine = in.readLine())!=null){
response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /balance

Body parameter

client:0
key: stringstri

Parameters

NameInTypeRequiredDescription
bodybodyobjecttruenone
» clientbodyinteger(int64)trueEl Id del cliente
» keybodystringtrueKey de la cuenta Onurix

Example responses

200 Response

{
"status":0
}

Responses

StatusMeaningDescriptionSchema
200OKOperación exitosaResponseBalance
520UnknownParametros invalidosErrorResponseBalance

Security

Bloquea un numero de telefono para que el sistema no envie mensajes de texto SMS

URL

Bloquea un numero de telefono para evitar enviar mensajes

Code samples

# También puede usar wget
curl -X POST https://www.onurix.com/api/v1/block-phone
-d key="AQUI_SU_KEY" -d client="AQUI_SU_CLIENT"
-d phone="AQUI_EL_NUMERO_DE_CELULAR" -d name="AQUI_NOMBRE_CONTACTO" \

-H 'Content-Type: application/x-www-form-urlencoded'\
-H 'Accept: application/json'
# Ejecutar: composer require guzzlehttp/guzzle:*
<?php

require'vendor/autoload.php';

$headers=array(
'Content-Type'=>'application/x-www-form-urlencoded',
'Accept'=>'application/json',
);

$client=new\GuzzleHttp\Client();

// Define la matriz del cuerpo de la solicitud.
$request_body=array(
"client"=>"AQUI_SU_CLIENT",
"key"=>"AQUI_SU_KEY",
"phone"=>"AQUI_EL_NUMERO_DE_CELULAR",
"name"=>"AQUI_NOMBRE_CONTACTO");

try{
$response=$client->request('POST','https://www.onurix.com/api/v1/block-phone',array(
'headers'=>$headers,
'form_params'=>$request_body,
)
);
print_r($response->getBody()->getContents());
}
catch(\GuzzleHttp\Exception\BadResponseException$e){
// Manejar excepciones o errores de API
print_r($e->getMessage());
}

// ...
import requests
headers ={
'Content-Type':'application/x-www-form-urlencoded',
'Accept':'application/json'
}

data = {
'client':'AQUI_SU_CLIENT',
'key':'AQUI_SU_KEY',
'phone':'AQUI_EL_NUMERO_DE_CELULAR',
'name':'AQUI_NOMBRE_CONTACTO'
}

r = requests.post('https://www.onurix.com/api/v1/block-phone', headers = headers, data = data)

print(r.json())
usingSystem;
usingSystem.Collections.Generic;
usingSystem.Net.Http;
usingSystem.Net.Http.Headers;
usingSystem.Text;
usingSystem.Threading.Tasks;
usingNewtonsoft.Json;

/// <<summary>>
/// Ejemplo de Http Client
/// <</summary>>
publicclassHttpExample
{
privateHttpClient Client {get;set;}

/// <<summary>>
/// Configurar http client
/// <</summary>>
publicHttpExample()
{
Client = new HttpClient();
}


/// Hacer una solicitud
public async Task MakePostRequest ()
{
string url ="https://www.onurix.com/api/v1/block-phone";

var dict = new Dictionary<string, string>();
dict.Add("client", "AQUI_SU_CLIENT");
dict.Add("key", "AQUI_SU_KEY");
dict.Add("phone", "AQUI_EL_NUMERO_DE_CELULAR");
dict.Add("name", "AQUI_NOMBRE_CONTACTO");


awaitPostAsync( url,dict);

}

/// Realiza una solicitud POST
public async Task PostAsync( string url , Dictionary<string, string> dict )
{
// Ejecutar método post
HttpResponseMessage response =await Client.PostAsync(url, new FormUrlEncodedContent(dict));
// contenido de la petición
var contents = await response.Content.ReadAsStringAsync();
}

package main

import(
"fmt"
"strings"
"net/http"
"io/ioutil"
)

funcmain(){

headers :=map[string][]string{
"Content-Type":[]string{"application/x-www-form-urlencoded"},
"Accept":[]string{"application/json"},
}

data := strings.NewReader("client=AQUI_SU_CLIENT&key=AQUI_SU_KEY&phone=AQUI_EL_NUMERO_DE_CELULAR&name=AQUI_NOMBRE_CONTACTO")
req, err := http.NewRequest("POST","https://www.onurix.com/api/v1/block-phone", data)
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))

}
// Ejecutar: npm install request --save
var requests = require("request");

var options = {
method: 'POST',
url: 'https://www.onurix.com/api/v1/block-phone',
headers: { 'content-type': 'application/x-www-form-urlencoded'},
formData: {
key:'AQUI_SU_KEY',
client:'AQUI_SU_CLIENT',
phone:'AQUI_EL_NUMERO_DE_CELULAR',
name:'AQUI_NOMBRE_CONTACTO'
}
};

var test = requests(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});


String urlParameters = "key=AQUI_SU_KEY&client=AQUI_SU_CLIENT&phone=AQUI_EL_NUMERO_DE_CELULAR&name=AQUI_NOMBRE_CONTACTO";
URL obj =newURL("https://www.onurix.com/api/v1/block-phone");
HttpURLConnection con =(HttpURLConnection) obj.openConnection();
con.setDoOutput(true);
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
con.setRequestProperty("charset", "utf-8");

OutputStream outputStream = con.getOutputStream();
outputStream.write(urlParameters.getBytes());
outputStream.flush();
outputStream.close();
int responseCode = con.getResponseCode();
BufferedReader in =newBufferedReader(
newInputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response =newStringBuffer();
while((inputLine = in.readLine())!=null){
response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /block-phone

Body parameter

client:0
key: stringstri
phone: stringstri
name: string

Parameters

NameInTypeRequiredDescription
bodybodyobjecttruenone
» clientbodyinteger(int64)trueEl Id del cliente
» keybodystringtrueKey de la cuenta Onurix
» phonebodystringtrueNumero de telefono a bloquear
» namebodystringfalseNombre del contacto a bloquear

Example responses

200 Response

{
"id":"string",
"status":"string",
"phone":"string",
"name":"string"
}

Responses

StatusMeaningDescriptionSchema
200OKOperación exitosaResponseSecurity
520UnknownParametros invalidosErrorResponseSecurity

SMS

Envia un mensaje SMS a cada numero de telefono suministrado

URL

Envia un mensaje de texto

Code samples

# También puede usar wget
curl -X POST https://www.onurix.com/api/v1/send-sms
-d key="AQUI_SU_KEY" -d client="AQUI_SU_CLIENT"
-d phone="AQUI_EL_NUMERO_DE_CELULAR" -d sms="AQUI_EL_SMS_A_ENVIAR"
-d country-code="CO"\
-H 'Content-Type: application/x-www-form-urlencoded'\
-H 'Accept: application/json'
# Ejecutar: composer require guzzlehttp/guzzle:*
<?php

require'vendor/autoload.php';

$headers=array(
'Content-Type'=>'application/x-www-form-urlencoded',
'Accept'=>'application/json',
);

$client=new\GuzzleHttp\Client();

// Define la matriz del cuerpo de la solicitud.
$request_body = array(
"client"=>"AQUI_SU_CLIENT",
"key"=>"AQUI_SU_KEY",
"phone"=>"AQUI_EL_NUMERO_DE_CELULAR",
"sms"=>"AQUI_EL_SMS_A_ENVIAR",
"country-code"=>"CO");

try{
$response=$client->request('POST','https://www.onurix.com/api/v1/send-sms',array(
'headers'=>$headers,
'form_params'=>$request_body,
)
);
print_r($response->getBody()->getContents());
}
catch(\GuzzleHttp\Exception\BadResponseException$e){
// Manejar excepciones o errores de API
print_r($e->getMessage());
}

// ...
import requests
headers ={
'Content-Type':'application/x-www-form-urlencoded',
'Accept':'application/json'
}

data = {
'client':'AQUI_SU_CLIENT',
'key':'AQUI_SU_KEY',
'phone':'AQUI_EL_NUMERO_DE_CELULAR',
'sms':'sms',
'country-code':'CO'}

r = requests.post('https://www.onurix.com/api/v1/send-sms', headers = headers, data = data)

print(r.json())
usingSystem;
usingSystem.Collections.Generic;
usingSystem.Net.Http;
usingSystem.Net.Http.Headers;
usingSystem.Text;
usingSystem.Threading.Tasks;
usingNewtonsoft.Json;

/// <<summary>>
/// Ejemplo de Http Client
/// <</summary>>
publicclassHttpExample
{
privateHttpClient Client {get;set;}

/// <<summary>>
/// Configurar http client
/// <</summary>>
publicHttpExample()
{
Client = new HttpClient();
}


/// Hacer una solicitud
public async Task MakePostRequest()
{
string url ="https://www.onurix.com/api/v1/send-sms";

var dict = new Dictionary<string, string>();
dict.Add("client", "AQUI_SU_CLIENT");
dict.Add("key", "AQUI_SU_KEY");
dict.Add("phone", "AQUI_EL_NUMERO_DE_CELULAR");
dict.Add("sms", "AQUI_EL_SMS_A_ENVIAR");
dict.Add("country-code", "CO");

await PostAsync( url,dict);

}

/// Realiza una solicitud POST
public async Task PostAsync( string url , Dictionary<string, string> dict )
{
// Ejecutar método post
HttpResponseMessage response =await Client.PostAsync(url, new FormUrlEncodedContent(dict));
// contenido de la petición
var contents = await response.Content.ReadAsStringAsync();
}

package main

import(
"fmt"
"strings"
"net/http"
"io/ioutil"
)

funcmain(){

headers :=map[string][]string{
"Content-Type":[]string{"application/x-www-form-urlencoded"},
"Accept":[]string{"application/json"},
}

data := strings.NewReader("client=AQUI_SU_CLIENT&key=AQUI_SU_KEY&phone=AQUI_EL_NUMERO_DE_CELULAR&sms=AQUI_EL_SMS_A_ENVIAR&country-code=CO")
req, err := http.NewRequest("POST","https://www.onurix.com/api/v1/send-sms", data)
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))

}
// Ejecutar: npm install request --save
var requests = require("request");

var options = {
method: 'POST',
url: 'https://www.onurix.com/api/v1/send-sms',
headers: { 'content-type': 'application/x-www-form-urlencoded'},
formData: {
key:'AQUI_SU_KEY',
client:'AQUI_SU_CLIENT',
phone:'AQUI_EL_NUMERO_DE_CELULAR',
sms:'AQUI_EL_SMS_A_ENVIAR',
country-code:'CO'
}
};

var test = requests(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});


String urlParameters = "key=AQUI_SU_KEY&client=AQUI_SU_CLIENT&phone=AQUI_EL_NUMERO_DE_CELULAR&sms=AQUI_EL_SMS_A_ENVIAR&country=CO";
URL obj =newURL("https://www.onurix.com/api/v1/send-sms");
HttpURLConnection con =(HttpURLConnection) obj.openConnection();
con.setDoOutput(true);
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
con.setRequestProperty("charset", "utf-8");

OutputStream outputStream = con.getOutputStream();
outputStream.write(urlParameters.getBytes());
outputStream.flush();
outputStream.close();
int responseCode = con.getResponseCode();
BufferedReader in =newBufferedReader(
newInputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response =newStringBuffer();
while((inputLine = in.readLine())!=null){
response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /send-sms

Body parameter

client:0
key: stringstri
country-code: CO
phone: stringstri
sms: stringstri

Parameters

NameInTypeRequiredDescription
bodybodyobjecttruenone
» clientbodyinteger(int64)trueEl Id del cliente
» keybodystringtrueKey de la cuenta Onurix
» country-codebodystringfalseCodigo ISO 3166, para Colombia enviar “CO”
» phonebodystringtrueNumero o numeros de telefono separados por coma ejemplo “573150123456” ó “573150123456,573150012345”
» smsbodystringtrueMensaje de texto a enviar a los numeros de telefono

Example responses

200 Response

{
"id":"string",
"status":0,
"data":[
{
"id":"string",
"status":"string",
"credits":0,
"sms":"string",
"phone":"string"
}
]
}

Responses

StatusMeaningDescriptionSchema
200OKOperación exitosaResponseSMS
520UnknownParametros invalidosErrorResponse

Call

Genera una llamada con cada numero de telefono proporcionado

URL

Genera una llamada con cada numero de telefono proporcionado

Code samples

# También puede usar wget
curl -X POST https://www.onurix.com/api/v1/call/send
-d key="AQUI_SU_KEY" -d client="AQUI_SU_CLIENT"
-d phone="AQUI_EL_NUMERO_DE_CELULAR" -d message="AQUI_EL_MENSAJE_A_ENVIAR"
-d voice="AQUI_TIPO_DE_VOZ" -d retries="AQUI_NUMERO_DE_INTENTOS"
-d leave-voicemail="false"
-d audio-code="7b9765ef-48b0-494c-8671-89ddb8f75fa4"
-d country-code="CO"\
-H 'Content-Type: application/x-www-form-urlencoded'\
-H 'Accept: application/json'
# Ejecutar: composer require guzzlehttp/guzzle:*
<?php

require'vendor/autoload.php';

$headers=array(
'Content-Type'=>'application/x-www-form-urlencoded',
'Accept'=>'application/json',
);

$client=new\GuzzleHttp\Client();

// Define la matriz del cuerpo de la solicitud.
$request_body = array(
"client"=>"AQUI_SU_CLIENT",
"key"=>"AQUI_SU_KEY",
"phone"=>"AQUI_EL_NUMERO_DE_CELULAR",
"message"=>"AQUI_EL_MENSAJE_A_ENVIAR",
"voice"=>"AQUI_TIPO_DE_VOZ",
"retries"=>"AQUI_NUMERO_DE_INTENTOS",
"leave-voicemail"=>"false",
"audio-code"=>"7b9765ef-48b0-494c-8671-89ddb8f75fa4",
"country-code"=>"CO");

try{
$response=$client->request('POST','https://www.onurix.com/api/v1/call/send',array(
'headers'=>$headers,
'form_params'=>$request_body,
)
);
print_r($response->getBody()->getContents());
}
catch(\GuzzleHttp\Exception\BadResponseException$e){
// Manejar excepciones o errores de API
print_r($e->getMessage());
}

// ...
import requests
headers ={
'Content-Type':'application/x-www-form-urlencoded',
'Accept':'application/json'
}

data = {
'client':'AQUI_SU_CLIENT',
'key':'AQUI_SU_KEY',
'phone':'AQUI_EL_NUMERO_DE_CELULAR',
'message':'AQUI_EL_MENSAJE_A_ENVIAR',
'voice':'AQUI_TIPO_DE_VOZ',
'retries':'AQUI_NUMERO_DE_INTENTOS',
'leave-voicemail':'false',
'audio-code':'7b9765ef-48b0-494c-8671-89ddb8f75fa4',
'country-code':'CO'
}

r = requests.post('https://www.onurix.com/api/v1/call/send', headers = headers, data = data)

print(r.json())
usingSystem;
usingSystem.Collections.Generic;
usingSystem.Net.Http;
usingSystem.Net.Http.Headers;
usingSystem.Text;
usingSystem.Threading.Tasks;
usingNewtonsoft.Json;

/// <<summary>>
/// Ejemplo de Http Client
/// <</summary>>
publicclassHttpExample
{
privateHttpClient Client {get;set;}

/// <<summary>>
/// Configurar http client
/// <</summary>>
publicHttpExample()
{
Client = new HttpClient();
}


/// Hacer una solicitud
public async Task MakePostRequest()
{
string url ="https://www.onurix.com/api/v1/call/send";

var dict = new Dictionary<string, string>();
dict.Add("client", "AQUI_SU_CLIENT");
dict.Add("key", "AQUI_SU_KEY");
dict.Add("phone", "AQUI_EL_NUMERO_DE_CELULAR");
dict.Add("message", "AQUI_EL_MENSAJE_A_ENVIAR");
dict.Add("voice", "AQUI_TIPO_DE_VOZ");
dict.Add("retries", "AQUI_NUMERO_DE_INTENTOS");
dict.Add("leave-voicemail", "false");
dict.Add("audio-code", "7b9765ef-48b0-494c-8671-89ddb8f75fa4");
dict.Add("country-code", "CO");


await PostAsync( url,dict);

}

/// Realiza una solicitud POST
public async Task PostAsync( string url , Dictionary<string, string> dict )
{
// Ejecutar método post
HttpResponseMessage response =await Client.PostAsync(url, new FormUrlEncodedContent(dict));
// contenido de la petición
var contents = await response.Content.ReadAsStringAsync();
}

package main

import(
"fmt"
"strings"
"net/http"
"io/ioutil"
)

funcmain(){

headers :=map[string][]string{
"Content-Type":[]string{"application/x-www-form-urlencoded"},
"Accept":[]string{"application/json"},
}

data := strings.NewReader("client=AQUI_SU_CLIENT&key=AQUI_SU_KEY&phone=AQUI_EL_NUMERO_DE_CELULAR&message=AQUI_EL_MENSAJE_A_ENVIAR&voice=AQUI_TIPO_DE_VOZ&retries=AQUI_NUMERO_DE_INTENTOS&leave-voicemail=false&audio-code=7b9765ef-48b0-494c-8671-89ddb8f75fa4&country-code=CO")
req, err := http.NewRequest("POST","https://www.onurix.com/api/v1/call/send", data)
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))

}
// Ejecutar: npm install request --save
var requests = require("request");

var options = {
method: 'POST',
url: 'https://www.onurix.com/api/v1/call/send',
headers: { 'content-type': 'application/x-www-form-urlencoded'},
formData: {
key:'AQUI_SU_KEY',
client:'AQUI_SU_CLIENT',
phone:'AQUI_EL_NUMERO_DE_CELULAR',
message:'AQUI_EL_MENSAJE_A_ENVIAR',
voice:'AQUI_TIPO_DE_VOZ',
retries:'AQUI_NUMERO_DE_INTENTOS',
leave-voicemail:'false',
audio-code:'7b9765ef-48b0-494c-8671-89ddb8f75fa4',
country-code:'CO'
}
};

var test = requests(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});


String urlParameters = "key=AQUI_SU_KEY&client=AQUI_SU_CLIENT&phone=AQUI_EL_NUMERO_DE_CELULAR&message=AQUI_EL_MENSAJE_A_ENVIAR&voice=AQUI_TIPO_DE_VOZ&retries=AQUI_NUMERO_DE_INTENTOS&leave-voicemail=false&audio-code=7b9765ef-48b0-494c-8671-89ddb8f75fa4&country-code=CO";
URL obj =newURL("https://www.onurix.com/api/v1/call/send");
HttpURLConnection con =(HttpURLConnection) obj.openConnection();
con.setDoOutput(true);
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
con.setRequestProperty("charset", "utf-8");

OutputStream outputStream = con.getOutputStream();
outputStream.write(urlParameters.getBytes());
outputStream.flush();
outputStream.close();
int responseCode = con.getResponseCode();
BufferedReader in =newBufferedReader(
newInputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response =newStringBuffer();
while((inputLine = in.readLine())!=null){
response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /call/send

Body parameter

client:0
key: stringstri
phone: stringstri
message: stringstri
voice: stringstri
retries: stringstri
leave-voicemail: false
audio-code: stringstri
country-code: CO

Parameters

NameInTypeRequiredDescription
bodybodyobjecttruenone
» clientbodyinteger(int64)trueEl Id del cliente
» keybodystringtrueKey de la cuenta Onurix
» phonebodystringtrueNumero o numeros de telefono separados por coma ejemplo “573150123456” ó “573150123456,573150012345”
» messagebodystringfalseMensaje para reproducir al iniciar la llamar. Este parámetro es requerido si no se usa el parámetro audio-code
» voicebodystringfalseVoz a usar en la llamada, puede escoger entre Marian, Penelope, Conchita, Mia, Lucia, Enrique, Miguel. Este parámetro es requerido si no se usa el parámetro audio-code
» retriesbodystringfalseNumero de intentos de la llamada, maximo 3
» leave-voicemailbodybooleanfalseUse true para dejar mensaje en buzón de voz en caso de que la llamada no sea atendida
» country-codebodystringfalseCodigo ISO 3166, para Colombia enviar “CO”
» audio-codebodystringfalseId único que hace referencia a un audio cargado a través de la plataforma de Onurix, si envía este parámetro se usara el correspondiente audio en las llamadas generadas. No se permite el uso de este parámetro junto con el parámetro voice y message

Example responses

200 Response

{
"status":"string",
"id":"string",
"data":[
{
"id":"string",
"state":"string",
"credits":0,
"message":"string",
"phone":"string",
"voice":"string"
}
]
}

Responses

StatusMeaningDescriptionSchema
200OKOperación exitosaResponseCall
520UnknownParametros invalidosErrorResponseCall

MessageState

Consulta el estado de envio de los mensajes SMS y CALL.

URL

Verifica el estado de un grupo de mensajes SMS y CALL

Code samples

# También puede usar wget
curl -X GET https://www.onurix.com/api/v1/messages-state?client=AQUI_SU_CLIENT&key=AQUI_SU_KEY&id=AQUI_ID"
# Ejecutar: composer require guzzlehttp/guzzle:*
<?php

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());
}

// ...
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', headers = headers)

print(r.json())
usingSystem;
usingSystem.Collections.Generic;
usingSystem.Net.Http;
usingSystem.Net.Http.Headers;
usingSystem.Text;
usingSystem.Threading.Tasks;
usingNewtonsoft.Json;

/// <<summary>>
/// Ejemplo de Http Client
/// <</summary>>
publicclassHttpExample
{
privateHttpClient Client {get;set;}

/// <<summary>>
/// Configurar http client
/// <</summary>>
publicHttpExample()
{
Client = new HttpClient();
}

/// Hacer una solicitud
public async Task MakeGetRequest()
{
string url ="https://www.onurix.com/api/v1/messages-state?client=AQUI_SU_CLIENT&key=AQUI_SU_KEY&id=AQUI_ID";
var result = await GetAsync(url);
}

/// Realiza una solicitud GET
public async Task GetAsync(string url)
{
//Iniciar la solicitud
HttpResponseMessage response =await Client.GetAsync(url);

//Validar resultado
response.EnsureSuccessStatusCode();

//Contenido de la petición
response.Content.ReadAsStringAsync();

}

}
package main

import(
"fmt"
"strings"
"net/http"
"io/ioutil"
)

funcmain(){

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_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))

}
// Ejecutar: npm install request --save
var requests = require("request");

var options = {
method: 'GET',
url: 'https://www.onurix.com/api/v1/messages-state?client=AQUI_SU_CLIENT&key=AQUI_SU_KEY&id=AQUI_ID',
headers:{ 'content-type': 'application/x-www-form-urlencoded' },
};
var test = requests(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});


URL obj =newURL("https://www.onurix.com/api/v1/messages-state?client=AQUI_SU_CLIENT&key=AQUI_SU_KEY&id=AQUI_ID");
HttpURLConnection con =(HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setDoOutput(true);
con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
con.setRequestProperty("charset","utf-8");

int responseCode = con.getResponseCode();
BufferedReader in =newBufferedReader(
newInputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response =newStringBuffer();
while((inputLine = in.readLine())!=null){
response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /messages-state

Body parameter

client:0
key: stringstri
id: stringstri

Parameters

NameInTypeRequiredDescription
bodybodyobjecttruenone
» clientbodyinteger(int64)trueEl Id del cliente
» keybodystringtrueKey de la cuenta Onurix
» idbodystringtrueKey de la cuenta Onurix

Example responses

200 Response

{
"state":"string",
"credits":0,
"phone":0,
"created":"string",
"sms":"string",
"dispatch_id":"string",
"id":"string"
}

Responses

StatusMeaningDescriptionSchema
200OKOperación exitosaResponseStatusSMS
520UnknownParametros invalidosErrorResponseBalance

APP2faSendSMS

Envia un mensaje de texto con un codigo de verificacion

URL

Envia un mensaje de texto con un codigo

Code samples

# También puede usar wget
curl -X POST https://www.onurix.com/api/v1/2fa/send-sms
-d key="AQUI_SU_KEY" -d client="AQUI_SU_CLIENT"
-d phone="AQUI_EL_NUMERO_DE_CELULAR" -d app-name="AQUI_NOMBRE_APP"
-d country-code="CO"\
-H 'Content-Type: application/x-www-form-urlencoded'\
-H 'Accept: application/json'
# Ejecutar: composer require guzzlehttp/guzzle:*
<?php

require'vendor/autoload.php';

$headers=array(
'Content-Type'=>'application/x-www-form-urlencoded',
'Accept'=>'application/json',
);

$client=new\GuzzleHttp\Client();

// Define la matriz del cuerpo de la solicitud.
$request_body = array(
"client"=>"AQUI_SU_CLIENT",
"key"=>"AQUI_SU_KEY",
"phone"=>"AQUI_EL_NUMERO_DE_CELULAR",
"app-name"=>"AQUI_NOMBRE_APP",
"country-code"=>"CO");

try{
$response=$client->request('POST','https://www.onurix.com/api/v1/2fa/send-sms',array(
'headers'=>$headers,
'form_params'=>$request_body,
)
);
print_r($response->getBody()->getContents());
}
catch(\GuzzleHttp\Exception\BadResponseException$e){
// Manejar excepciones o errores de API
print_r($e->getMessage());
}

// ...
import requests
headers ={
'Content-Type':'application/x-www-form-urlencoded',
'Accept':'application/json'
}

data = {
'client':'AQUI_SU_CLIENT',
'key':'AQUI_SU_KEY',
'phone':'AQUI_EL_NUMERO_DE_CELULAR',
'app-name':'AQUI_NOMBRE_APP',
'country-code':'CO'
}

r = requests.post('https://www.onurix.com/api/v1/2fa/send-sms', headers = headers, data = data)

print(r.json())
usingSystem;
usingSystem.Collections.Generic;
usingSystem.Net.Http;
usingSystem.Net.Http.Headers;
usingSystem.Text;
usingSystem.Threading.Tasks;
usingNewtonsoft.Json;

/// <<summary>>
/// Ejemplo de Http Client
/// <</summary>>
publicclassHttpExample
{
privateHttpClient Client {get;set;}

/// <<summary>>
/// Configurar http client
/// <</summary>>
publicHttpExample()
{
Client = new HttpClient();
}


/// Hacer una solicitud
public async Task MakePostRequest()
{
string url ="https://www.onurix.com/api/v1/2fa/send-sms";

var dict = new Dictionary<string, string>();
dict.Add("client", "AQUI_SU_CLIENT");
dict.Add("key", "AQUI_SU_KEY");
dict.Add("phone", "AQUI_EL_NUMERO_DE_CELULAR");
dict.Add("app-name", "AQUI_NOMBRE_APP");
dict.Add("country-code", "CO");


await PostAsync( url,dict);

}

/// Realiza una solicitud POST
public async Task PostAsync( string url , Dictionary<string, string> dict )
{
// Ejecutar método post
HttpResponseMessage response =await Client.PostAsync(url, new FormUrlEncodedContent(dict));
// contenido de la petición
var contents = await response.Content.ReadAsStringAsync();
}

package main

import(
"fmt"
"strings"
"net/http"
"io/ioutil"
)

funcmain(){

headers :=map[string][]string{
"Content-Type":[]string{"application/x-www-form-urlencoded"},
"Accept":[]string{"application/json"},
}

data := strings.NewReader("client=AQUI_SU_CLIENT&key=AQUI_SU_KEY&phone=AQUI_EL_NUMERO_DE_CELULAR&app-name=AQUI_NOMBRE_APP&country-code=CO")
req, err := http.NewRequest("POST","https://www.onurix.com/api/v1/2fa/send-sms", data)
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))

}
// Ejecutar: npm install request --save
var requests = require("request");

var options = {
method: 'POST',
url: 'https://www.onurix.com/api/v1/2fa/send-sms',
headers: { 'content-type': 'application/x-www-form-urlencoded'},
formData: {
key:'AQUI_SU_KEY',
client:'AQUI_SU_CLIENT',
phone:'AQUI_EL_NUMERO_DE_CELULAR',
app-name:'AQUI_NOMBRE_APP',
country-code:'CO'
}
};

var test = requests(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});


String urlParameters = "key=AQUI_SU_KEY&client=AQUI_SU_CLIENT&phone=AQUI_EL_NUMERO_DE_CELULAR&app-name=AQUI_NOMBRE_CONTACTO&country-code=CO";
URL obj =newURL("https://www.onurix.com/api/v1/2fa/send-sms");
HttpURLConnection con =(HttpURLConnection) obj.openConnection();
con.setDoOutput(true);
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
con.setRequestProperty("charset", "utf-8");

OutputStream outputStream = con.getOutputStream();
outputStream.write(urlParameters.getBytes());
outputStream.flush();
outputStream.close();
int responseCode = con.getResponseCode();
BufferedReader in =newBufferedReader(
newInputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response =newStringBuffer();
while((inputLine = in.readLine())!=null){
response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /2fa/send-sms

Body parameter

client:0
key: stringstri
phone: stringstri
app-name: string
country-code: CO

Parameters

NameInTypeRequiredDescription
bodybodyobjecttruenone
» clientbodyinteger(int64)trueEl Id del cliente
» keybodystringtrueKey de la cuenta Onurix
» phonebodystringtrueNumero de telefono, ejemplo “57573150123456”
» app-namebodystringtrueNombre de la app que va a ser usada para generar el codigo
» country-codebodystringfalseCodigo ISO 3166, para Colombia enviar “CO”

Example responses

200 Response

{
"id":"string",
"status":"string",
"minutes_to_expire":0,
"data":[
{
"id":"string",
"status":"string",
"credits":0,
"sms":"string",
"phone":"string"
}
]
}

Responses

StatusMeaningDescriptionSchema
200OKRespuesta exitosa de la operacionResponseSMS2fa
520UnknownParametros invalidosErrorResponse

APP2faSendCALL

Entrega un codigo a través de llamada

URL

Entrega un codigo en llamada

Code samples

# También puede usar wget
curl -X POST https://www.onurix.com/api/v1/call/2fa/send-call
-d key="AQUI_SU_KEY" -d client="AQUI_SU_CLIENT"
-d phone="AQUI_EL_NUMERO_DE_CELULAR" -d app-name="AQUI_NOMBRE_APP"
-d voice="AQUI_TIPO_DE_VOZ" -d retries="AQUI_NUMERO_DE_INTENTOS"
-d country-code="CO"\
-H 'Content-Type: application/x-www-form-urlencoded'\
-H 'Accept: application/json'
# Ejecutar: composer require guzzlehttp/guzzle:*
<?php

require'vendor/autoload.php';

$headers=array(
'Content-Type'=>'application/x-www-form-urlencoded',
'Accept'=>'application/json',
);

$client=new\GuzzleHttp\Client();

// Define la matriz del cuerpo de la solicitud.
$request_body = array(
"client"=>"AQUI_SU_CLIENT",
"key"=>"AQUI_SU_KEY",
"phone"=>"AQUI_EL_NUMERO_DE_CELULAR",
"app-name"=>"AQUI_NOMBRE_APP",
"voice"=>"AQUI_TIPO_DE_VOZ",
"retries"=>"AQUI_NUMERO_DE_INTENTOS",
"country-code"=>"CO");

try{
$response=$client->request('POST','https://www.onurix.com/api/v1/call/2fa/send-call',array(
'headers'=>$headers,
'form_params'=>$request_body,
)
);
print_r($response->getBody()->getContents());
}
catch(\GuzzleHttp\Exception\BadResponseException$e){
// Manejar excepciones o errores de API
print_r($e->getMessage());
}

// ...
import requests
headers ={
'Content-Type':'application/x-www-form-urlencoded',
'Accept':'application/json'
}

data = {
'client':'AQUI_SU_CLIENT',
'key':'AQUI_SU_KEY',
'app-name':'AQUI_NOMBRE_APP',
'voice':'AQUI_TIPO_DE_VOZ',
'retries':'AQUI_NUMERO_DE_INTENTOS',
'country-code':'CO',
'phone':'AQUI_EL_NUMERO_DE_CELULAR'
}

r = requests.post('https://www.onurix.com/api/v1/call/2fa/send-call', headers = headers, data = data)

print(r.json())
usingSystem;
usingSystem.Collections.Generic;
usingSystem.Net.Http;
usingSystem.Net.Http.Headers;
usingSystem.Text;
usingSystem.Threading.Tasks;
usingNewtonsoft.Json;

/// <<summary>>
/// Ejemplo de Http Client
/// <</summary>>
publicclassHttpExample
{
privateHttpClient Client {get;set;}

/// <<summary>>
/// Configurar http client
/// <</summary>>
publicHttpExample()
{
Client = new HttpClient();
}


/// Hacer una solicitud
public async Task MakePostRequest()
{
string url ="https://www.onurix.com/api/v1/call/2fa/send-call";

var dict = new Dictionary<string, string>();
dict.Add("client", "AQUI_SU_CLIENT");
dict.Add("key", "AQUI_SU_KEY");
dict.Add("phone", "AQUI_EL_NUMERO_DE_CELULAR");
dict.Add("app-name", "AQUI_NOMBRE_APP");
dict.Add("voice", "AQUI_TIPO_DE_VOZ");
dict.Add("retries", "AQUI_NUMERO_DE_INTENTOS");
dict.Add("country-co", "CO");


await PostAsync( url,dict);

}

/// Realiza una solicitud POST
public async Task PostAsync( string url , Dictionary<string, string> dict )
{
// Ejecutar método post
HttpResponseMessage response =await Client.PostAsync(url, new FormUrlEncodedContent(dict));
// contenido de la petición
var contents = await response.Content.ReadAsStringAsync();
}

package main

import(
"fmt"
"strings"
"net/http"
"io/ioutil"
)

funcmain(){

headers :=map[string][]string{
"Content-Type":[]string{"application/x-www-form-urlencoded"},
"Accept":[]string{"application/json"},
}

data := strings.NewReader("client=AQUI_SU_CLIENT&key=AQUI_SU_KEY&phone=AQUI_EL_NUMERO_DE_CELULAR&app-name=AQUI_NOMBRE_APP&voice=AQUI_TIPO_DE_VOZ&retries=AQUI_NUMERO_DE_INTENTOS&country-code=CO")
req, err := http.NewRequest("POST","https://www.onurix.com/api/v1/call/2fa/send-call", data)
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))

}
// Ejecutar: npm install request --save
var requests = require("request");

var options = {
method: 'POST',
url: 'https://www.onurix.com/api/v1/call/2fa/send-call',
headers: { 'content-type': 'application/x-www-form-urlencoded'},
formData: {
key:'AQUI_SU_KEY',
client:'AQUI_SU_CLIENT',
phone:'AQUI_EL_NUMERO_DE_CELULAR',
app-name:'AQUI_NOMBRE_APP',
voice:'AQUI_TIPO_DE_VOZ',
retries:'AQUI_NUMERO_DE_INTENTOS',
country-code:'CO'
}
};

var test = requests(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});


String urlParameters = "key=AQUI_SU_KEY&client=AQUI_SU_CLIENT&phone=AQUI_EL_NUMERO_DE_CELULAR&app-name=AQUI_NOMBRE_APP&voice=AQUI_TIPO_DE_VOZ&retries=AQUI_NUMERO_DE_INTENTOS&country-code=CO";
URL obj =newURL("https://www.onurix.com/api/v1/call/2fa/send-call");
HttpURLConnection con =(HttpURLConnection) obj.openConnection();
con.setDoOutput(true);
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
con.setRequestProperty("charset", "utf-8");

OutputStream outputStream = con.getOutputStream();
outputStream.write(urlParameters.getBytes());
outputStream.flush();
outputStream.close();
int responseCode = con.getResponseCode();
BufferedReader in =newBufferedReader(
newInputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response =newStringBuffer();
while((inputLine = in.readLine())!=null){
response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /call/2fa/send-call

Body parameter

client:0
key: stringstri
voice: string
app-name: string
retries: stringstri
phone: stringstri
country-code: CO

Parameters

NameInTypeRequiredDescription
bodybodyobjecttruenone
» clientbodyinteger(int64)trueEl Id del cliente
» keybodystringtrueKey de la cuenta Onurix
» voicebodystringtrueVoz a usar en la llamada, puede escoger entre Mariana, Penelope, Conchita, Mia, Lucia, Enrique, Miguel
» app-namebodystringtrueNombre de la app que va a ser usada para generar el codigo
» retriesbodystringtrueNumero de telefono, ejemplo “573150123456”
» phonebodystringtrueNumero de telefono, ejemplo “573150123456”
» country-codebodystringfalseCodigo ISO 3166, para Colombia enviar “CO”

Example responses

200 Response

{
"status":"string",
"id":"string",
"minutes_to_expire":0,
"data":[
{
"id":"string",
"state":"string",
"credits":0,
"phone":0,
"voice":"string"
}
]
}

Responses

StatusMeaningDescriptionSchema
200OKRespuesta exitosa de la operacionResponseCALL2fa
520UnknownParametros invalidosErrorResponseCall

APP2fa

Realiza la verificación del codigo

URL

Verifica el codigo 2FA

Code samples

# También puede usar wget
curl -X POST https://www.onurix.com/api/v1/2fa/verification-code
-d key="AQUI_SU_KEY" -d client="AQUI_SU_CLIENT"
-d phone="AQUI_EL_NUMERO_DE_CELULAR" -d app-name="AQUI_NOMBRE_APP"
-d code="AQUI_CODIGO" -d country-code="CO"\
-H 'Content-Type: application/x-www-form-urlencoded'\
-H 'Accept: application/json'
# Ejecutar: composer require guzzlehttp/guzzle:*
<?php

require'vendor/autoload.php';

$headers=array(
'Content-Type'=>'application/x-www-form-urlencoded',
'Accept'=>'application/json',
);

$client=new\GuzzleHttp\Client();

// Define la matriz del cuerpo de la solicitud.
$request_body = array(
"client"=>"AQUI_SU_CLIENT",
"key"=>"AQUI_SU_KEY",
"phone"=>"AQUI_EL_NUMERO_DE_CELULAR",
"app-name"=>"AQUI_NOMBRE_APP",
"code"=>"AQUI_CODIGO",
"country-code"=>"CO");

try{
$response=$client->request('POST','https://www.onurix.com/api/v1/2fa/verification-code',array(
'headers'=>$headers,
'form_params'=>$request_body,
)
);
print_r($response->getBody()->getContents());
}
catch(\GuzzleHttp\Exception\BadResponseException$e){
// Manejar excepciones o errores de API
print_r($e->getMessage());
}

// ...
import requests
headers ={
'Content-Type':'application/x-www-form-urlencoded',
'Accept':'application/json'
}

data = {
'client':'AQUI_SU_CLIENT',
'key':'AQUI_SU_KEY',
'phone':'AQUI_EL_NUMERO_DE_CELULAR',
'code':'AQUI_CODIGO',
'app-name':'AQUI_NOMBRE_APP',
'country-code':'CO'
}

r = requests.post('https://www.onurix.com/api/v1/2fa/verification-code', headers = headers, data = data)

print(r.json())
usingSystem;
usingSystem.Collections.Generic;
usingSystem.Net.Http;
usingSystem.Net.Http.Headers;
usingSystem.Text;
usingSystem.Threading.Tasks;
usingNewtonsoft.Json;

/// <<summary>>
/// Ejemplo de Http Client
/// <</summary>>
publicclassHttpExample
{
privateHttpClient Client {get;set;}

/// <<summary>>
/// Configurar http client
/// <</summary>>
publicHttpExample()
{
Client = new HttpClient();
}


/// Hacer una solicitud
public async Task MakePostRequest()
{
string url ="https://www.onurix.com/api/v1/2fa/verification-code";

var dict = new Dictionary<string, string>();
dict.Add("client", "AQUI_SU_CLIENT");
dict.Add("key", "AQUI_SU_KEY");
dict.Add("phone", "AQUI_EL_NUMERO_DE_CELULAR");
dict.Add("app-name", "AQUI_NOMBRE_APP");
dict.Add("code", "AQUI_CODIGO");
dict.Add("country-code", "CO");


await PostAsync( url,dict);

}

/// Realiza una solicitud POST
public async Task PostAsync( string url , Dictionary<string, string> dict )
{
// Ejecutar método post
HttpResponseMessage response =await Client.PostAsync(url, new FormUrlEncodedContent(dict));
// contenido de la petición
var contents = await response.Content.ReadAsStringAsync();
}

package main

import(
"fmt"
"strings"
"net/http"
"io/ioutil"
)

funcmain(){

headers :=map[string][]string{
"Content-Type":[]string{"application/x-www-form-urlencoded"},
"Accept":[]string{"application/json"},
}

data := strings.NewReader("client=AQUI_SU_CLIENT&key=AQUI_SU_KEY&phone=AQUI_EL_NUMERO_DE_CELULAR&app-name=AQUI_NOMBRE_APP&code=AQUI_CODIGO&country-code=CO")
req, err := http.NewRequest("POST","https://www.onurix.com/api/v1/2fa/verification-code", data)
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))

}
// Ejecutar: npm install request --save
var requests = require("request");

var options = {
method: 'POST',
url: 'https://www.onurix.com/api/v1/2fa/verification-code',
headers: { 'content-type': 'application/x-www-form-urlencoded'},
formData: {
key:'AQUI_SU_KEY',
client:'AQUI_SU_CLIENT',
phone:'AQUI_EL_NUMERO_DE_CELULAR',
app-name:'AQUI_NOMBRE_APP',
code:'AQUI_CODIGO',
country-code:'CO'
}
};

var test = requests(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});


String urlParameters = "key=AQUI_SU_KEY&client=AQUI_SU_CLIENT&phone=AQUI_EL_NUMERO_DE_CELULAR&app-name=AQUI_NOMBRE_APP&code=AQUI_CODIGO&country-code=CO";
URL obj =newURL("https://www.onurix.com/api/v1/2fa/verification-code");
HttpURLConnection con =(HttpURLConnection) obj.openConnection();
con.setDoOutput(true);
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
con.setRequestProperty("charset", "utf-8");

OutputStream outputStream = con.getOutputStream();
outputStream.write(urlParameters.getBytes());
outputStream.flush();
outputStream.close();
int responseCode = con.getResponseCode();
BufferedReader in =newBufferedReader(
newInputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response =newStringBuffer();
while((inputLine = in.readLine())!=null){
response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /2fa/verification-code

Body parameter

client:0
key: stringstri
phone: stringstri
app-name: stringstri
code: stringstri
country-code: CO

Parameters

NameInTypeRequiredDescription
bodybodyobjecttruenone
» clientbodyinteger(int64)trueEl Id del cliente
» keybodystringtrueKey de la cuenta Onurix
» phonebodystringtrueNumero de telefono, ejemplo “573150123456”
» app-namebodystringtrueNombre de la app que fue usada para generar el codigo en sendSMS2FA
» codebodystringtruecodigo enviado en el SMS
» country-codebodystringfalseCodigo ISO 3166, para Colombia enviar “CO”

Example responses

200 Response

{
"status":"string"
}

Responses

StatusMeaningDescriptionSchema
200OKResultado de la operacionResponseSucces
520UnknownerrorErrorResponse

URLShort

Crea una URL corta a partir de una URL Larga

URL

Crea una URL corta a partir de una URL larga

Code samples

# También puede usar wget
curl -X POST https://www.onurix.com/api/v1/url/short
-d key="AQUI_SU_KEY" -d client="AQUI_SU_CLIENT"
-d name="AQUI_NOMBE_DE_URL" -d url-long="AQUI_URL_LARGA"\
-H 'Content-Type: application/x-www-form-urlencoded'\
-H 'Accept: application/json'
# Ejecutar: composer require guzzlehttp/guzzle:*
<?php

require'vendor/autoload.php';

$headers=array(
'Content-Type'=>'application/x-www-form-urlencoded',
'Accept'=>'application/json',
);

$client=new\GuzzleHttp\Client();

// Define la matriz del cuerpo de la solicitud.
$request_body = array(
"client"=>"AQUI_SU_CLIENT",
"key"=>"AQUI_SU_KEY",
"name"=>"AQUI_NOMBE_DE_URL",
"url-long"=>"AQUI_URL_LARGA",
);

try{
$response=$client->request('POST','https://www.onurix.com/api/v1/url/short',array(
'headers'=>$headers,
'form_params'=>$request_body,
)
);
print_r($response->getBody()->getContents());
}
catch(\GuzzleHttp\Exception\BadResponseException$e){
// Manejar excepciones o errores de API
print_r($e->getMessage());
}

// ...
import requests
headers ={
'Content-Type':'application/x-www-form-urlencoded',
'Accept':'application/json'
}

data = {
'client':'AQUI_SU_CLIENT',
'key':'AQUI_SU_KEY',
'name':'AQUI_NOMBE_DE_URL',
'url-long':'AQUI_URL_LARGA'
}

r = requests.post('https://www.onurix.com/api/v1/url/short', headers = headers, data = data)

print(r.json())
usingSystem;
usingSystem.Collections.Generic;
usingSystem.Net.Http;
usingSystem.Net.Http.Headers;
usingSystem.Text;
usingSystem.Threading.Tasks;
usingNewtonsoft.Json;

/// <<summary>>
/// Ejemplo de Http Client
/// <</summary>>
publicclassHttpExample
{
privateHttpClient Client {get;set;}

/// <<summary>>
/// Configurar http client
/// <</summary>>
publicHttpExample()
{
Client = new HttpClient();
}


/// Hacer una solicitud
public async Task MakePostRequest()
{
string url ="https://www.onurix.com/api/v1/url/short";

var dict = new Dictionary<string, string>();
dict.Add("client", "AQUI_SU_CLIENT");
dict.Add("key", "AQUI_SU_KEY");
dict.Add("name", "AQUI_NOMBE_DE_URL");
dict.Add("url-long", "AQUI_URL_LARGA");


await PostAsync( url,dict);

}

/// Realiza una solicitud POST
public async Task PostAsync( string url , Dictionary<string, string> dict )
{
// Ejecutar método post
HttpResponseMessage response =await Client.PostAsync(url, new FormUrlEncodedContent(dict));
// contenido de la petición
var contents = await response.Content.ReadAsStringAsync();
}

package main

import(
"fmt"
"strings"
"net/http"
"io/ioutil"
)

funcmain(){

headers :=map[string][]string{
"Content-Type":[]string{"application/x-www-form-urlencoded"},
"Accept":[]string{"application/json"},
}

data := strings.NewReader("client=AQUI_SU_CLIENT&key=AQUI_SU_KEY&name=AQUI_NOMBE_DE_URL&name=AQUI_NOMBE_DE_URL&url-longAQUI_URL_LARGA")
req, err := http.NewRequest("POST","https://www.onurix.com/api/v1/url/short", data)
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))

}
// Ejecutar: npm install request --save
var requests = require("request");

var options = {
method: 'POST',
url: 'https://www.onurix.com/api/v1/url/short',
headers: { 'content-type': 'application/x-www-form-urlencoded'},
formData: {
key:'AQUI_SU_KEY',
client:'AQUI_SU_CLIENT',
name:'AQUI_NOMBE_DE_URL',
url-long:'AQUI_URL_LARGA'
}
};

var test = requests(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});


String urlParameters = "key=AQUI_SU_KEY&client=AQUI_SU_CLIENT&name=AQUI_NOMBE_DE_URL&url-long=AQUI_URL_LARGA";
URL obj =newURL("https://www.onurix.com/api/v1/url/short");
HttpURLConnection con =(HttpURLConnection) obj.openConnection();
con.setDoOutput(true);
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
con.setRequestProperty("charset", "utf-8");

OutputStream outputStream = con.getOutputStream();
outputStream.write(urlParameters.getBytes());
outputStream.flush();
outputStream.close();
int responseCode = con.getResponseCode();
BufferedReader in =newBufferedReader(
newInputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response =newStringBuffer();
while((inputLine = in.readLine())!=null){
response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /url/short

Body parameter

client:0
key: string
name: string
url-long: string
alias: string
is-premium:true
group-name: string
domain-name: string
expiration-time-statistics: string

Parameters

NameInTypeRequiredDescription
bodybodyobjecttruenone
» clientbodyinteger(int64)trueEl Id del cliente
» keybodystringtrueKey de la cuenta Onurix
» namebodystringtrueNombre de la URL
» url-longbodystringtrueURL Larga
» aliasbodystringfalseAlias para la URL corta
» is-premiumbodybooleanfalseEs premium por defecto falso
» group-namebodystringfalseGrupo al que se desea asociar
» domain-namebodystringfalseDominio al que se desea asociar
» expiration-time-statisticsbodystringfalseExpiración de la URL en meses valores por defecto enviar 0

Example responses

200 Response

{
"urlShort":"string",
"urlLong":"string",
"msg":"string"
}

Responses

StatusMeaningDescriptionSchema
200OKRespuesta exitosa de la operacionResponseURLShort
520UnknownParametros invalidosErrorResponse

URLStatistics

Devuelve estadísticas de la URL a partir de su nombre

URL

Obtiene los clicks de una URL corta

Code samples

# También puede usar wget
curl -X POST https://www.onurix.com/api/v1/url/short-statistic
-d key="AQUI_SU_KEY" -d client="AQUI_SU_CLIENT"
-d name-url="AQUI_NOMBE_DE_URL" -d since="Fecha inicial YYYY-MM-DD"
-d until="Fecha final YYYY-MM-DD"\
-H 'Content-Type: application/x-www-form-urlencoded'\
-H 'Accept: application/json'
# Ejecutar: composer require guzzlehttp/guzzle:*
<?php

require'vendor/autoload.php';

$headers=array(
'Content-Type'=>'application/x-www-form-urlencoded',
'Accept'=>'application/json',
);

$client=new\GuzzleHttp\Client();

// Define la matriz del cuerpo de la solicitud.
$request_body = array(
"client"=>"AQUI_SU_CLIENT",
"key"=>"AQUI_SU_KEY",
"name-url"=>"AQUI_NOMBE_DE_URL",
"since"=>"Fecha inicial YYYY-MM-DD",
"until"=>"Fecha final YYYY-MM-DD");

try{
$response=$client->request('POST','https://www.onurix.com/api/v1/url/short-statistic',array(
'headers'=>$headers,
'form_params'=>$request_body,
)
);
print_r($response->getBody()->getContents());
}
catch(\GuzzleHttp\Exception\BadResponseException$e){
// Manejar excepciones o errores de API
print_r($e->getMessage());
}

// ...
import requests
headers ={
'Content-Type':'application/x-www-form-urlencoded',
'Accept':'application/json'
}

data = {
'client':'AQUI_SU_CLIENT',
'key':'AQUI_SU_KEY',
'name-url':'AQUI_NOMBE_DE_URL',
'since':'Fecha inicial YYYY-MM-DD',
'until':'Fecha final YYYY-MM-DD'
}

r = requests.post('https://www.onurix.com/api/v1/url/short-statistic', headers = headers, data = data)

print(r.json())
usingSystem;
usingSystem.Collections.Generic;
usingSystem.Net.Http;
usingSystem.Net.Http.Headers;
usingSystem.Text;
usingSystem.Threading.Tasks;
usingNewtonsoft.Json;

/// <<summary>>
/// Ejemplo de Http Client
/// <</summary>>
publicclassHttpExample
{
privateHttpClient Client {get;set;}

/// <<summary>>
/// Configurar http client
/// <</summary>>
publicHttpExample()
{
Client = new HttpClient();
}


/// Hacer una solicitud
public async Task MakePostRequest()
{
string url ="https://www.onurix.com/api/v1/url/short-statistic";

var dict = new Dictionary<string, string>();
dict.Add("client", "AQUI_SU_CLIENT");
dict.Add("key", "AQUI_SU_KEY");
dict.Add("name-url", "AQUI_NOMBE_DE_URL");
dict.Add("since", "Fecha inicial YYYY-MM-DD");
dict.Add("until", "Fecha final YYYY-MM-DD");


await PostAsync( url,dict);

}

/// Realiza una solicitud POST
public async Task PostAsync( string url , Dictionary<string, string> dict )
{
// Ejecutar método post
HttpResponseMessage response =await Client.PostAsync(url, new FormUrlEncodedContent(dict));
// contenido de la petición
var contents = await response.Content.ReadAsStringAsync();
}

package main

import(
"fmt"
"strings"
"net/http"
"io/ioutil"
)

funcmain(){

headers :=map[string][]string{
"Content-Type":[]string{"application/x-www-form-urlencoded"},
"Accept":[]string{"application/json"},
}

data := strings.NewReader("client=AQUI_SU_CLIENT&key=AQUI_SU_KEY&phone=AQUI_EL_NUMERO_DE_CELULAR&name-url=AQUI_NOMBE_DE_URL&since=Fecha inicial YYYY-MM-DD&until=Fecha final YYYY-MM-DD")
req, err := http.NewRequest("POST","https://www.onurix.com/api/v1/url/short-statistic", data)
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))

}
// Ejecutar: npm install request --save
var requests = require("request");

var options = {
method: 'POST',
url: 'https://www.onurix.com/api/v1/url/short-statistic',
headers: { 'content-type': 'application/x-www-form-urlencoded'},
formData: {
key:'AQUI_SU_KEY',
client:'AQUI_SU_CLIENT',
name-url:'AQUI_NOMBE_DE_URL',
since:'Fecha inicial YYYY-MM-DD',
until:'Fecha final YYYY-MM-DD'
}
};

var test = requests(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});


String urlParameters = "key=AQUI_SU_KEY&client=AQUI_SU_CLIENT&name-url=AQUI_NOMBE_DE_URL&since=Fecha inicial YYYY-MM-DD&until=Fecha final YYYY-MM-DD";
URL obj =newURL("https://www.onurix.com/api/v1/url/short-statistic");
HttpURLConnection con =(HttpURLConnection) obj.openConnection();
con.setDoOutput(true);
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
con.setRequestProperty("charset", "utf-8");

OutputStream outputStream = con.getOutputStream();
outputStream.write(urlParameters.getBytes());
outputStream.flush();
outputStream.close();
int responseCode = con.getResponseCode();
BufferedReader in =newBufferedReader(
newInputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response =newStringBuffer();
while((inputLine = in.readLine())!=null){
response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /url/short-statistic

Body parameter

client:0
key: string
name-url: string
since: string
until: string
category: string

Parameters

NameInTypeRequiredDescription
bodybodyobjecttruenone
» clientbodyinteger(int64)trueEl Id del cliente
» keybodystringtrueKey de la cuenta Onurix
» name-urlbodystringtrueNombre de la URL corta
» sincebodystringtrueFecha inicial año-mes-dia
» untilbodystringtrueFecha hasta año-mes-dia
» categorybodystringfalseCategoría que desea información detallada {date,hour,country,device,operatingSystem} URLs Premium adicional {region,city,brand,model,browser,lang}

Example responses

200 Response

{
"urlShort":"string",
"urlLong":"string",
"clicksNumber":0,
"metrics":[
{
"date":{
"property":"string",
"clicks":0
},
"hour":{
"property":"string",
"clicks":0,
"date":"string"
},
"country":{
"property":"string",
"clicks":0
},
"region":{
"property":"string",
"clicks":0
},
"city":{
"property":"string",
"clicks":0,
"countryIsoCode":"string",
"region":"string",
"percent":0
},
"device":{
"property":"string",
"clicks":0
},
"brand":{
"property":"string",
"clicks":0,
"percent":0
},
"model":{
"property":"string",
"clicks":0,
"percent":0
},
"operatingSystem":{
"property":"string",
"clicks":0
},
"browser":{
"property":"string",
"clicks":0
},
"lang":{
"property":"string",
"clicks":0
}
}
]
}

Responses

StatusMeaningDescriptionSchema
200OKRespuesta exitosa de la operacionResponseStatistic
520UnknownParametros invalidosErrorResponse

Schemas

ResponseBalance

{
"status":0
}

Properties

NameTypeRequiredRestrictionsDescription
statusinteger(int64)falsenonenone

ErrorResponseBalance

{
"error":"string",
"msg":"string"
}

Properties

NameTypeRequiredRestrictionsDescription
errorstringfalsenonenone
msgstringfalsenonenone

ResponseSucces

{
"status":"string"
}

Properties

NameTypeRequiredRestrictionsDescription
statusstringfalsenonenone

ResponseSMS

{
"id":"string",
"status":0,
"data":[
{
"id":"string",
"status":"string",
"credits":0,
"sms":"string",
"phone":"string"
}
]
}

Properties

NameTypeRequiredRestrictionsDescription
idstringfalsenonenone
statusinteger(int64)falsenonenone
data[object]falsenoneDetalle por numero telefonico
» idstringfalsenonenone
» statusstringfalsenonenone
» creditsintegerfalsenonenone
» smsstringfalsenonenone
» phonestringfalsenonenone

ResponseCall

{
"status":"string",
"id":"string",
"data":[
{
"id":"string",
"state":"string",
"credits":0,
"message":"string",
"phone":"string",
"voice":"string"
}
]
}

Properties

NameTypeRequiredRestrictionsDescription
statusstringfalsenonenone
idstringfalsenonenone
data[object]falsenoneDetalle por numero telefonico
» idstringfalsenonenone
» statestringfalsenonenone
» creditsintegerfalsenonenone
» messagestringfalsenonenone
» phonestringfalsenonenone
» voicestringfalsenonenone

ResponseStatusSMS

{
"state":"string",
"credits":0,
"phone":0,
"created":"string",
"sms":"string",
"dispatch_id":"string",
"id":"string"
}

Properties

NameTypeRequiredRestrictionsDescription
statestringfalsenonenone
creditsinteger(int64)falsenonenone
phoneinteger(int64)falsenonenone
createdstringfalsenonenone
smsstringfalsenonenone
dispatch_idstringfalsenonenone
idstringfalsenonenone

ResponseSMS2fa

{
"id":"string",
"status":"string",
"minutes_to_expire":0,
"data":[
{
"id":"string",
"status":"string",
"credits":0,
"sms":"string",
"phone":"string"
}
]
}

Properties

NameTypeRequiredRestrictionsDescription
idstringfalsenonenone
statusstringfalsenonenone
minutes_to_expireinteger(int64)falsenonenone
data[object]falsenoneDetalle por numero telefonico
» idstringfalsenonenone
» statusstringfalsenonenone
» creditsintegerfalsenonenone
» smsstringfalsenonenone
» phonestringfalsenonenone

ResponseURLShort

{
"urlShort":"string",
"urlLong":"string",
"msg":"string"
}

Properties

NameTypeRequiredRestrictionsDescription
urlShortstringfalsenonenone
urlLongstringfalsenonenone
msgstringfalsenonenone

ResponseStatistic

{
"urlShort":"string",
"urlLong":"string",
"clicksNumber":0,
"metrics":[
{
"date":{
"property":"string",
"clicks":0
},
"hour":{
"property":"string",
"clicks":0,
"date":"string"
},
"country":{
"property":"string",
"clicks":0
},
"region":{
"property":"string",
"clicks":0
},
"city":{
"property":"string",
"clicks":0,
"countryIsoCode":"string",
"region":"string",
"percent":0
},
"device":{
"property":"string",
"clicks":0
},
"brand":{
"property":"string",
"clicks":0,
"percent":0
},
"model":{
"property":"string",
"clicks":0,
"percent":0
},
"operatingSystem":{
"property":"string",
"clicks":0
},
"browser":{
"property":"string",
"clicks":0
},
"lang":{
"property":"string",
"clicks":0
}
}
]
}

Properties

NameTypeRequiredRestrictionsDescription
urlShortstringfalsenonenone
urlLongstringfalsenonenone
clicksNumberintegerfalsenonenone
metrics[object]falsenoneEstadísticas completas de una URL Premium
» dateobjectfalsenonenone
»» propertystringfalsenonenone
»» clicksintegerfalsenonenone
» hourobjectfalsenonenone
»» propertystringfalsenonenone
»» clicksintegerfalsenonenone
»» datestringfalsenonenone
» countryobjectfalsenonenone
»» propertystringfalsenonenone
»» clicksintegerfalsenonenone
» regionobjectfalsenonenone
»» propertystringfalsenonenone
»» clicksintegerfalsenonenone
» cityobjectfalsenonenone
»» propertystringfalsenonenone
»» clicksintegerfalsenonenone
»» countryIsoCodestringfalsenonenone
»» regionstringfalsenonenone
»» percentinteger(double)falsenonenone
» deviceobjectfalsenonenone
»» propertystringfalsenonenone
»» clicksintegerfalsenonenone
» brandobjectfalsenonenone
»» propertystringfalsenonenone
»» clicksintegerfalsenonenone
»» percentinteger(double)falsenonenone
» modelobjectfalsenonenone
»» propertystringfalsenonenone
»» clicksintegerfalsenonenone
»» percentinteger(double)falsenonenone
» operatingSystemobjectfalsenonenone
»» propertystringfalsenonenone
»» clicksintegerfalsenonenone
» browserobjectfalsenonenone
»» propertystringfalsenonenone
»» clicksintegerfalsenonenone
» langobjectfalsenonenone
»» propertystringfalsenonenone
»» clicksintegerfalsenonenone

ErrorResponse

{
"error":"string",
"msg":"string"
}

Properties

NameTypeRequiredRestrictionsDescription
errorstringfalsenonenone
msgstringfalsenonenone

ErrorResponseCall

{
"error":"string",
"msg":"string"
}

Properties

NameTypeRequiredRestrictionsDescription
errorstringfalsenonenone
msgstringfalsenonenone

ResponseSecurity

{
"id":"string",
"status":"string",
"phone":"string",
"name":"string"
}

Properties

NameTypeRequiredRestrictionsDescription
idstringfalsenonenone
statusstringfalsenonenone
phonestringfalsenonenone
namestringfalsenonenone

ErrorResponseSecurity

{
"error":"string",
"msg":"string"
}

Properties

NameTypeRequiredRestrictionsDescription
errorstringfalsenonenone
msgstringfalsenonenone