JSON ERROR

By
{
    "status":"EXPECTED_PARAMETER_MISSING",
    "statusCode":195,
    "error":"You do not have all the required variables in your [message] data"
}

Read more

JSON Send

By
{
    "status":"OK",
    "statusCode":0,
    "acceptedDateTime":"2017-08-25T12:51:01.1808223+01:00",
    "message":{
        "senderid":"Sendmode",
        "messagetext":"Hello World",
        "customerid":null,
        "scheduledate":null,
        "recipients":["0870000000"]
    }
    
}

Read more

JAVA CREDITS

By
URL url = new URL("http://rest.sendmode.com/v2/credits?access_key=YOUR_ACCESS_KEY");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("GET");

BufferedReader in = new BufferedReader(
  new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer content = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    content.append(inputLine);
}
in.close();
con.disconnect();

Read more

PHP CREDITS

By
$response = file_get_contents("http://rest.sendmode.com/v2/credits?access_key=YOUR_ACCESS_KEY");

Read more

C# CREDITS

By
string url = string.Format("http://rest.sendmode.com/v2/credits?access_key={0}", "YOUR_ACCESS_KEY");
using (var client = new WebClient())
{
    var responseString = client.DownloadString(url);
}

Read more

Java SEND

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

String json = "{\"messagetext\" : \"Hello World\", \"recipients\" : [\"0870000000\"]}";
List<NameValuePair> params = new ArrayList<NameValuePair>(1);
params.add(new BasicNameValuePair("message", json));
httppost.setEntity(new UrlEncodedFormEntity(params, "UTF-8"));

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

Read more

PHP SEND

By
$arr =  array('messagetext' => 'This is a test', 'senderid' => 'SendMode', 'recipients' => array('0870000000'));

$url = 'https://rest.sendmode.com/v2/send';
$data = array('message' => json_encode($arr));

// use key 'http' even if you send the request to https://...
$options = array(
    'http' => array(
        'header'  => "Content-type: application/x-www-form-urlencoded\r\n" .
            "Authorization: YOUR_ACCESS_KEY\r\n",
        'method'  => 'POST',
        'content' => http_build_query($data)
    )
);
$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);

Read more