HTTP Delivery Reports Polling 2

By
The return object looks like:

<sms_deliveryreport>

    <data>

        <messageid></messageid>

        <deliverystatus></deliverystatus> 

    </data>

    <call_result>

        <result>True</result>

        <error /> 

    </call_result> 

</sms_deliveryreport>

Your delivery status will be displayed between the "deliverystatus" tag. 

Read more

HTTP CREDITS

By
The return object looks like:

<api_result>

    <data>

        <credits>xxxxx</credits> 

    </data>

    <call_result>

        <result>True</result>

        <error /> 

    </call_result> 

</api_result>

Your current credit value will be displayed between the "credits" tag. 

Read more

HTTP SEND RESPONSE

By

The output of the following will be defined by the input of the above parameters:

<httppost_result>

    <call_result>

        <result>True</result>

        <error></error> 

    </call_result> 

</httppost_result> 

Read more

HTTP SEND JAVA

By
JAVA Code Example - Sending SMS

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;

public class SMSClient {
    public static String sendSMS(String username, String password, String senderId, String recipient, String message) {
        try {
            String urlStr = String.format(
                "https://api.sendmode.com/httppost.aspx?username=%s&password=%s&senderid=%s&numto=%s&data1=%s",
                URLEncoder.encode(username, "UTF-8"),
                URLEncoder.encode(password, "UTF-8"),
                URLEncoder.encode(senderId, "UTF-8"),
                URLEncoder.encode(recipient, "UTF-8"),
                URLEncoder.encode(message, "UTF-8")
            );

            URL url = new URL(urlStr);
            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
            conn.setRequestMethod("GET");

            BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
            StringBuilder response = new StringBuilder();
            String inputLine;

            while ((inputLine = in.readLine()) != null) {
                response.append(inputLine);
            }

            in.close();
            conn.disconnect();

            return response.toString();
        } catch (Exception e) {
            e.printStackTrace();
            return "Error sending SMS: " + e.getMessage();
        }
    }

    public static void main(String[] args) {
        String response = sendSMS("your_username", "your_password", "your_senderid", "recipient_number", "your_message_content");
        System.out.println(response);
    }
}

Read more

HTTP SEND PHP

By
PHP Code Example - Sending SMS

<?php
function SendSMS($username, $password, $senderId, $recipient, $message) {
    $url = 'https://api.sendmode.com/httppost.aspx?' . http_build_query([
        'username' => $username,
        'password' => $password,
        'senderid' => $senderId,
        'numto' => $recipient,
        'data1' => $message
    ]);

    $response = file_get_contents($url);
    return $response;
}

// Example usage
$response = SendSMS('your_username', 'your_password', 'your_senderid', 'recipient_number', 'your_message_content');
echo $response;
?>

Read more

HTTP SEND C#

By
 C# Code Example - Sending SMS

using System;
using System.Net.Http;
using System.Threading.Tasks;

public class SMSClient
{
    private static readonly HttpClient client = new HttpClient();

    public static async Task<string> SendSMS(string username, string password, string senderId, string recipient, string message)
    {
        string url = $"https://api.sendmode.com/httppost.aspx?username={username}&password={password}&senderid={senderId}&numto={recipient}&data1={Uri.EscapeDataString(message)}";

        HttpResponseMessage response = await client.GetAsync(url);
        return await response.Content.ReadAsStringAsync();
    }

    public static async Task Main(string[] args)
    {
        string response = await SendSMS("your_username", "your_password", "your_senderid", "recipient_number", "your_message_content");
        Console.WriteLine(response);
    }
}

Read more

JAVA-HLR

By
HttpClient httpclient = HttpClients.createDefault();
HttpPost httppost = new HttpPost("https://rest.sendmode.com/v2/hlr");
httppost.setHeader(HttpHeaders.AUTHORIZATION, YOUR_ACCESS_KEY);

List<NameValuePair> params = new ArrayList<NameValuePair>(1);
params.add(new BasicNameValuePair("mobilenumber", "0870000000"));
httppost.setEntity(new UrlEncodedFormEntity(params, "UTF-8"));

HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();

Read more