Code Examples
JavaScript/Node.js (SMS)
const axios = require("axios");
const API_KEY = "your_api_key_here";
const BASE_URL = "https://prosendi.com/api";
async function sendSMS(recipient, message) {
const res = await axios.post(`${BASE_URL}/sms/send`, { recipient, message }, {
headers: { "X-API-Key": API_KEY, "Content-Type": "application/json" },
});
return res.data;
}
Python (WhatsApp)
import requests
headers = {"X-API-Key": "your_api_key_here", "Content-Type": "application/json"}
requests.post("https://prosendi.com/api/whatsapp/send", json={"recipient":"+22370123456","message":"Hello"}, headers=headers)
PHP (SMS)
<?php
$apiKey = 'your_api_key_here';
$baseUrl = 'https://prosendi.com/api';
$ch = curl_init($baseUrl . '/sms/send');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['X-API-Key: ' . $apiKey,'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['recipient' => '+22370123456','message' => 'Hello!']));
$response = curl_exec($ch);
curl_close($ch);
echo $response;