Code request
curl --location --globoff 'https://www.onurix.com/api/v1/whatsapp/send/no-template?key=AQUI_SU_SECRET_KEY&client=AQUI_SU_CLIENT_ID' --header 'Content-Type: application/json' --data '{"from_phone_meta_id":"AQUI_EL_META_ID_DEL_TELEFONO","phone":"AQUI_EL_TELEFONO_DESTINO","message":{"type":"text","value":"AQUI_EL_MENSAJE"}}'
Code request
<?php
// Ejecutar: composer require guzzlehttp/guzzle:*
require 'vendor/autoload.php';
$clientId = "AQUI_SU_CLIENT_ID";
$key = "AQUI_SU_SECRET_KEY";
$from_phone_meta_id = "AQUI_EL_META_ID_DEL_TELEFONO";
$phone = "AQUI_EL_TELEFONO_DESTINO";
$message = "AQUI_EL_MENSAJE";
$client = new \GuzzleHttp\Client();
$body = [
"from_phone_meta_id" => $from_phone_meta_id,
"phone" => $phone,
"message" => [
"type" => "text",
"value" => $message
]
];
$response = $client->post("https://www.onurix.com/api/v1/whatsapp/send/no-template?key=$key&client=$clientId", [
'headers' => ['Content-Type' => 'application/json'],
'body' => json_encode($body)
]);
echo $response->getBody()->getContents();
Code request
import requests
import json
url = "https://www.onurix.com/api/v1/whatsapp/send/no-template?key=AQUI_SU_KEY&client=AQUI_SU_CLIENT_ID"
payload = {
"from_phone_meta_id": "AQUI_ID_META_PHONE",
"phone": "AQUI_EL_NUMERO_DE_CELULAR",
"message": {
"type" : "text",
"value": "AQUI_EL_MENSAJE"
}
}
headers = {
'Content-Type': 'application/json'
}
response = requests.post(url, headers=headers, data=json.dumps(payload))
print(response.json())
Code request
//Este codigo fue hecho en .net 6
using System.Text;
using System.Net.Http;
namespace PruebaOnurix
{
public class Program
{
public static void Main(string[] args)
{
WhatsAppSendWithoutTemplate();
}
public static void WhatsAppSendWithoutTemplate()
{
string key = "AQUI_SU_SECRET_KEY";
string client = "AQUI_SU_CLIENT_ID";
string jsonBody = @"{
""from_phone_meta_id"": ""AQUI_EL_META_ID_DEL_TELEFONO"",
""phone"": ""AQUI_EL_TELEFONO_DESTINO"",
""message"": {
""type"" : ""text"",
""value"": ""AQUI_EL_MENSAJE""
}
}";
using var httpClient = new HttpClient()
{
BaseAddress = new Uri("https://www.onurix.com/"),
};
HttpResponseMessage request = httpClient.PostAsync($"api/v1/whatsapp/send/no-template?client={client}&key={key}", new StringContent(jsonBody, Encoding.UTF8, "application/json")).Result;
string responseString = request.Content.ReadAsStringAsync().Result;
Console.WriteLine(responseString);
}
}
}
Code request
package main
import (
"fmt"
"io/ioutil"
"net/http"
"strings"
)
func main() {
url := "https://www.onurix.com/api/v1/whatsapp/send/no-template?key=AQUI_SU_SECRET_KEY&client=AQUI_SU_CLIENT_ID"
method := "POST"
payload := strings.NewReader(`{
"from_phone_meta_id": "AQUI_EL_META_ID_DEL_TELEFONO",
"phone": "AQUI_EL_TELEFONO_DESTINO",
"message": {
"type" : "text",
"value": "AQUI_EL_MENSAJE"
}
}`)
client := &http.Client{}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
Code request
// Run: npm install axios --save
const axios = require('axios').default;
const url = 'https://www.onurix.com/api/v1/whatsapp/send_without_template?key=AQUI_SU_SECRET_KEY&client=AQUI_SU_CLIENT_ID';
const data = {
"from_phone_meta_id": "AQUI_EL_META_ID_DEL_TELEFONO",
"phone": "AQUI_EL_TELEFONO_DESTINO",
"message": {
"type" : "text",
"value": "AQUI_EL_MENSAJE"
}
};
const headers = {
'Content-Type': 'application/json'
};
axios.post(url, data, { headers })
.then(resp => {
console.log(resp.data);
})
.catch(error => {
console.log(error);
});
Code request
//Para este codigo se uso jdk 11
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
public class SendWhatsAppWithoutTemplate {
public static void main(String[] args) {
String apiUrl = "https://www.onurix.com/api/v1/whatsapp/send/no-template";
String apiKey = "AQUI_SU_SECRET_KEY"; // Replace with your actual API key
String client = "AQUI_SU_CLIENT_ID"; // Replace with your actual client ID
try {
// Construct the URL with query parameters
String fullUrl = apiUrl + "?key=" + apiKey + "&client=" + client;
URL url = new URL(fullUrl);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
// Set the request method to POST
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/json");
conn.setDoOutput(true);
// ✅ JSON payload usando text block (Java 15+)
String jsonInputString = """
{
"from_phone_meta_id": "AQUI_EL_META_ID_DEL_TELEFONO",
"phone": "AQUI_EL_TELEFONO_DESTINO",
"message": {
"type": "text",
"value": "AQUI_EL_MENSAJE"
}
}
""";
// Write the JSON data to the request body
try (OutputStream os = conn.getOutputStream()) {
byte[] input = jsonInputString.getBytes(StandardCharsets.UTF_8);
os.write(input, 0, input.length);
}
// Get the response code
int responseCode = conn.getResponseCode();
System.out.println("Response Code: " + responseCode);
// Read the response
try (BufferedReader br = new BufferedReader(
new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8))) {
StringBuilder response = new StringBuilder();
String line;
while ((line = br.readLine()) != null) {
response.append(line.trim());
}
System.out.println("Response Body: " + response);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
Url parameters
client : 0,
key : "string"
Body parameters example
{
"from_phone_meta_id": "string",
"phone": "string",
"message": {
"type": "text",
"value": "string"
}
}
Respuesta de ejemplo
Response 200
{
"id": "string",
"status": "string",
"data": {
"meta_message_id": "string",
"state": "string"
}
}