Onurix API

Balance

getBalance

Obtiene el balance de una cuenta.


/balance

Uso y codigo de ejemplo

curl -X GET "https://www.onurix.com/api/v1/balance?key=AQUI_SU_KEY&client=AQUI_SU_CLIENT"
/*Instale request ejecutando el comando "npm install --save request" */    
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/json' },
  json: true };
  
requests(options, function (error, response, body) {
  if (error) throw new Error(error);
  console.log(body);
});                                                                                                                                                   
package main

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

func main() {
	 
	key:= "AQUI_SU_KEY"
	client:= "AQUI_SU_CLIENT"
	url := fmt.Sprintf("https://www.onurix.com/api/v1/balance?key=%s&client=%s", key, client)
	
	req, _ := http.NewRequest("GET", url,nil)
        res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()

	body, _ := ioutil.ReadAll(res.Body)
	fmt.Println(res)
	fmt.Println(string(body))
}                                                                                                                                                          
import requests
resp = requests.get('https://www.onurix.com/api/v1/balance?', params={'client':'AQUI_SU_CLIENT','key':'AQUI_SU_KEY'})
print(resp.text)                                                                                                                          
/*utilizando Unirest http://unirest.io/java.html*/                                                                                                              
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.JsonNode;
import com.mashape.unirest.http.Unirest;

HttpResponse response = Unirest.get("https://www.onurix.com/api/v1/balance").
                header("accept", "application/json").
                queryString("client", "AQUI_SU_CLIENT").
                queryString("key", "AQUI_SU_KEY").
                asJson();
System.out.println(response.getBody().getObject().toString(2));
/*Instale RestSharp via Nuget*/
using RestSharp;

var client = new RestClient("https://www.onurix.com/api/v1/balance");
var request = new RestRequest(Method.GET);
request.AddHeader("content-type", "application/json");
request.AddParameter("key", "AQUI_SU_KEY");
request.AddParameter("client", "AQUI_SU_CLIENT");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
Console.ReadKey();
<?php
$curl = curl_init();

$query = http_build_query([
 'key' => 'AQUI_SU_KEY',
 'client' => AQUI_SU_CLIENT
]);

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://www.onurix.com/api/v1/balance?$query",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  /*CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,*/
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "content-type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
?>

Parameters

Form parameters
NameDescription
client*
Integer (int32)
El Id del cliente
Required
key*
String
Key de la cuenta Onurix
Required

Responses

Status: 200 - Operación exitosa

Status: 520 - Parametros invalidos


SMS

sendSMS

Envia un mensaje de texto


/send-sms

Usage and SDK Samples

>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"
<?php
$curl = curl_init();

$query = http_build_query(array(
 'key' => 'AQUI_SU_KEY',
 'client' => 'AQUI_SU_CLIENT',
 'phone' => 'AQUI_EL_NUMERO_DE_CELULAR',
 'sms' => 'AQUI_EL_SMS_A_ENVIAR',
 'country-code' => 'CO'
));

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://www.onurix.com/api/v1/send-sms",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  /*CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,*/
  CURLOPT_POST  => 1,
  CURLOPT_POSTFIELDS => $query,
  CURLOPT_HTTPHEADER => array(
    "content-type: application/x-www-form-urlencoded"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
} 
?>
import requests
payload = {'client':'AQUI_SU_CLIENT','key':'AQUI_SU_KEY','phone':'AQUI_EL_NUMERO_DE_CELULAR', 'sms':'AQUI_EL_SMS_A_ENVIAR', 'country-code':'CO'}
resp= requests.post("https://www.onurix.com/api/v1/send-sms", data=payload)
print(resp.text)
/*Instale RestSharp via Nuget*/
using RestSharp;

var client = new RestClient("https://www.onurix.com/api/v1/send-sms");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/x-www-form-urlencoded");
request.AddParameter("key", "AQUI_SU_KEY");
request.AddParameter("client", "AQUI_SU_CLIENT");
request.AddParameter("phone", "AQUI_EL_NUMERO_DE_CELULAR");
request.AddParameter("sms", "AQUI_EL_SMS_A_ENVIAR");
request.AddParameter("country-code", "CO");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
Console.ReadKey();
package main

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

func main() {
	 
	key:= "AQUI_SU_KEY"
	client:= "AQUI_SU_CLIENT"
	phone:= "AQUI_EL_NUMERO_DE_CELULAR"
	sms:= "AQUI_EL_SMS_A_ENVIAR"
	country-code:= "CO"
	url := fmt.Sprintf("https://www.onurix.com/api/v1/send-sms?key=%s&client=%s&phone=%s&sms=%s&country-code=%s", key, client,phone,sms,country_code)
	
	req, _ := http.NewRequest("POST", url,nil)
    res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()

	body, _ := ioutil.ReadAll(res.Body)
	fmt.Println(res)
	fmt.Println(string(body))
}                                                                                                                                                               
/*Instale request ejecutando el comando "npm install --save request" */    
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'
	    }
  };

requests(options, function (error, response, body) {
  if (error) throw new Error(error);
  console.log(body);
});                                                                                                                                                  
/*utilizando Unirest http://unirest.io/java.html*/                                                                                                              
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.JsonNode;
import com.mashape.unirest.http.Unirest;

HttpResponse response = Unirest.post("https://www.onurix.com/api/v1/send-sms").
        header("accept", "application/x-www-form-urlencoded").
        queryString("client", "AQUI_SU_CLIENT").
        queryString("key", "AQUI_SU_KEY").
        queryString("phone", "AQUI_EL_NUMERO_DE_CELULAR").
        queryString("sms", "AQUI_EL_SMS_A_ENVIAR").
        queryString("country-code", "CO").
        asJson();
System.out.println(response.getBody().getObject().toString(2));

Parameters

Form parameters
NameDescription
client*
Integer (int32)
El Id del cliente
Required
key*
String
Key de la cuenta Onurix
Required
phone*
String
Numero o numeros de telefono separados por coma ejemplo "3150123456" ó "3150123456,3150012345"
Required
sms*
String
Mensaje de texto a enviar a los numeros de telefono
Required
country-code
String
Codigo ISO 3166, para Colombia enviar "CO"

Responses

Status: 200 - Operación exitosa

Status: 520 - Parametros invalidos


SMS 2FA

sendSMS2FA

Envia un mensaje de texto con un codigo de verificación


/2fa/send-sms

Usage and SDK Samples

>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"
<?php
$curl = curl_init();

$query = http_build_query(array(
 'key' => 'AQUI_SU_KEY',
 'client' => 'AQUI_SU_CLIENT',
 'phone' => 'AQUI_EL_NUMERO_DE_CELULAR',
 'app-name' => 'AQUI_NOMBRE_APP',
 'country-code' => 'CO'
));

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://www.onurix.com/api/v1/2fa/send-sms",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  /*CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,*/
  CURLOPT_POST  => 1,
  CURLOPT_POSTFIELDS => $query,
  CURLOPT_HTTPHEADER => array(
    "content-type: application/x-www-form-urlencoded"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
} 
?>
import requests
payload = {'client':'AQUI_SU_CLIENT','key':'AQUI_SU_KEY','phone':'AQUI_EL_NUMERO_DE_CELULAR', 'app-name':'AQUI_NOMBRE_APP', 'country-code':'CO'}
resp= requests.post("https://www.onurix.com/api/v1/2fa/send-sms", data=payload)
print(resp.text)
/*Instale RestSharp via Nuget*/
using RestSharp;

var client = new RestClient("https://www.onurix.com/api/v1/2fa/send-sms");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/x-www-form-urlencoded");
request.AddParameter("key", "AQUI_SU_KEY");
request.AddParameter("client", "AQUI_SU_CLIENT");
request.AddParameter("phone", "AQUI_EL_NUMERO_DE_CELULAR");
request.AddParameter("app-name", "AQUI_NOMBRE_APP");
request.AddParameter("country-code", "CO");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
Console.ReadKey();
package main

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

func main() {
	 
	key:= "AQUI_SU_KEY"
	client:= "AQUI_SU_CLIENT"
	phone:= "AQUI_EL_NUMERO_DE_CELULAR"
	app-name:= "AQUI_NOMBRE_APP"
	country-code:= "CO"
	url := fmt.Sprintf("https://www.onurix.com/api/v1/2fa/send-sms?key=%s&client=%s&phone=%s&app-name=%s&country-code=%s", key, client,phone,app-name,country_code)
	
	req, _ := http.NewRequest("POST", url,nil)
    res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()

	body, _ := ioutil.ReadAll(res.Body)
	fmt.Println(res)
	fmt.Println(string(body))
}                                                                                                                                                               
/*Instale request ejecutando el comando "npm install --save request" */    
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'
	    }
  };

requests(options, function (error, response, body) {
  if (error) throw new Error(error);
  console.log(body);
});                                                                                                                                                  
/*utilizando Unirest http://unirest.io/java.html*/                                                                                                              
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.JsonNode;
import com.mashape.unirest.http.Unirest;

HttpResponse response = Unirest.post("https://www.onurix.com/api/v1/2fa/send-sms").
        header("accept", "application/x-www-form-urlencoded").
        queryString("client", "AQUI_SU_CLIENT").
        queryString("key", "AQUI_SU_KEY").
        queryString("phone", "AQUI_EL_NUMERO_DE_CELULAR").
        queryString("app-name", "AQUI_NOMBRE_APP").
        queryString("country-code", "CO").
        asJson();
System.out.println(response.getBody().getObject().toString(2));

Parameters

Form parameters
NameDescription
client*
Integer (int32)
El Id del cliente
Required
key*
String
Key de la cuenta Onurix
Required
phone*
String
Numero de telefono, ejemplo "3150123456"
Required
app-name*
String
Nombre de la app que va a ser usada para generar el codigo
Required
country-code
String
Codigo ISO 3166, para Colombia enviar "CO"

Responses

Status: 200 - Operación exitosa

Status: 520 - Parametros invalidos


SMS Verification Code 2FA

verificationCode2FA

Realiza la verificación del codigo


2fa/verification-code

Usage and SDK Samples

>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
<?php
$curl = curl_init();

$query = http_build_query(array(
 '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'
));

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://www.onurix.com/api/v1/2fa/verification-code",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  /*CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,*/
  CURLOPT_POST  => 1,
  CURLOPT_POSTFIELDS => $query,
  CURLOPT_HTTPHEADER => array(
    "content-type: application/x-www-form-urlencoded"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
} 
?>
import requests
payload = {'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'}
resp= requests.post("https://www.onurix.com/api/v1/2fa/verification-code", data=payload)
print(resp.text)
/*Instale RestSharp via Nuget*/
using RestSharp;

var client = new RestClient("https://www.onurix.com/api/v1/2fa/verification-code");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/x-www-form-urlencoded");
request.AddParameter("key", "AQUI_SU_KEY");
request.AddParameter("client", "AQUI_SU_CLIENT");
request.AddParameter("phone", "AQUI_EL_NUMERO_DE_CELULAR");
request.AddParameter("app-name", "AQUI_NOMBRE_APP");
request.AddParameter("code", "AQUI_CODIGO");
request.AddParameter("country-code", "CO");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
Console.ReadKey();
package main

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

func main() {
	 
	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 := fmt.Sprintf("https://www.onurix.com/api/v1/2fa/verification-code?key=%s&client=%s&phone=%s&app-name=%s&code=%s&country-code=%s", key, client,phone,app-name,code,country_code)
	
	req, _ := http.NewRequest("POST", url,nil)
    res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()

	body, _ := ioutil.ReadAll(res.Body)
	fmt.Println(res)
	fmt.Println(string(body))
}                                                                                                                                                               
/*Instale request ejecutando el comando "npm install --save request" */    
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'
	    }
  };

requests(options, function (error, response, body) {
  if (error) throw new Error(error);
  console.log(body);
});                                                                                                                                                  
/*utilizando Unirest http://unirest.io/java.html*/                                                                                                              
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.JsonNode;
import com.mashape.unirest.http.Unirest;

HttpResponse response = Unirest.post("https://www.onurix.com/api/v1/2fa/verification-code").
        header("accept", "application/x-www-form-urlencoded").
        queryString("client", "AQUI_SU_CLIENT").
        queryString("key", "AQUI_SU_KEY").
        queryString("phone", "AQUI_EL_NUMERO_DE_CELULAR").
        queryString("app-name", "AQUI_NOMBRE_APP").
        queryString("code", "AQUI_CODIGO").
        queryString("country-code", "CO").
        asJson();
System.out.println(response.getBody().getObject().toString(2));

Parameters

Form parameters
NameDescription
client*
Integer (int32)
El Id del cliente
Required
key*
String
Key de la cuenta Onurix
Required
phone*
String
Numero de telefono "3150123456"
Required
app-name*
String
Nombre de la app que fue usada para generar el codigo en sendSMS2FA
Required
code*
String
codigo enviado en el SMS
Required
country-code
String
Codigo ISO 3166, para Colombia enviar "CO"

Responses

Status: 200 - Operación exitosa

Status: 520 - Parametros invalidos


Security

blockPhone

Bloquea un numero de telefono para evitar enviar mensajes.


/block-phone

Usage and SDK Samples


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"
<?php
$curl = curl_init();

$query = http_build_query(array(
 'key' => 'AQUI_SU_KEY',
 'client' => 'AQUI_SU_CLIENT',
 'phone' => 'AQUI_EL_NUMERO_DE_CELULAR',
 'name' => 'AQUI_NOMBRE_CONTACTO'
));

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://www.onurix.com/api/v1/block-phone",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  /*CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,*/
  CURLOPT_POST  => 1,
  CURLOPT_POSTFIELDS => $query,
  CURLOPT_HTTPHEADER => array(
    "content-type: application/x-www-form-urlencoded"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
} 
?>
import requests
payload = {'client':'AQUI_SU_CLIENT','key':'AQUI_SU_KEY','phone':'AQUI_EL_NUMERO_DE_CELULAR', 'name':'AQUI_NOMBRE_CONTACTO'}
resp= requests.post("https://www.onurix.com/api/v1/block-phone", data=payload)
print(resp.text)
/*Instale RestSharp via Nuget*/
using RestSharp;

var client = new RestClient("https://www.onurix.com/api/v1/block-phone");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/x-www-form-urlencoded");
request.AddParameter("key", "AQUI_SU_KEY");
request.AddParameter("client", "AQUI_SU_CLIENT");
request.AddParameter("phone", "AQUI_EL_NUMERO_DE_CELULAR");
request.AddParameter("name", "AQUI_NOMBRE_CONTACTO");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
Console.ReadKey();
package main

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

func main() {
	 
	key:= "AQUI_SU_KEY"
	client:= "AQUI_SU_CLIENT"
	phone:= "AQUI_EL_NUMERO_DE_CELULAR"
	name:= "AQUI_NOMBRE_CONTACTO"
	url := fmt.Sprintf("https://www.onurix.com/api/v1/block-phone?key=%s&client=%s&phone=%s&name=%s", key, client,phone,name)
	
	req, _ := http.NewRequest("POST", url,nil)
    res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()

	body, _ := ioutil.ReadAll(res.Body)
	fmt.Println(res)
	fmt.Println(string(body))
}                                                                                                                                                               
/*Instale request ejecutando el comando "npm install --save request" */    
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'
	    }
  };

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

                                                          /*utilizando Unirest http://unirest.io/java.html*/                                                                                                              
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.JsonNode;
import com.mashape.unirest.http.Unirest;

HttpResponse response = Unirest.post("https://www.onurix.com/api/v1/block-phone").
        header("accept", "application/x-www-form-urlencoded").
        queryString("client", "AQUI_SU_CLIENT").
        queryString("key", "AQUI_SU_KEY").
        queryString("phone", "AQUI_EL_NUMERO_DE_CELULAR").
        queryString("name", "AQUI_NOMBRE_CONTACTO").
        asJson();
System.out.println(response.getBody().getObject().toString(2));

Parameters

Form parameters
NameDescription
client*
Long (int64)
El Id del cliente
Required
key*
String
Key de la cuenta Onurix
Required
phone*
String
Numero de telefono a bloquear
Required
name
String
Nombre del contacto a bloquear

Responses

Status: 200 - Operación exitosa

Status: 520 - Parametros invalidos


Generated 2018-07-16T15:42:08.829Z