JAVA VERIFY CODE

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

List<NameValuePair> params = new ArrayList<NameValuePair>(2);
params.add(new BasicNameValuePair("code", "2FA_CODE"));
params.add(new BasicNameValuePair("recipient", "0870000000"));
httppost.setEntity(new UrlEncodedFormEntity(params, "UTF-8"));

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

Read more

PHP VERIFY CODE

By
$url = 'https://rest.sendmode.com/v2/verify';
$data = array('code' => '2FA_CODE', 'recipient' => '0870000000');

// 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

JSON VERIFY SEND RESPONSE

By
{
    "status":"OK",
    "statusCode":0,
    "acceptedDateTime":"2017-08-29T09:23:47.4120695+01:00",
    "message":
    {
        "senderid":"Sendmode",
        "messagetext":"This is your code",
        "recipient":"0852455041",
        "tokenLength":0,
        "timeout":0
    }
}

Read more

JAVA VERIFY SEND

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

String json = "{\"messagetext\" : \"Hello World\", \"recipient\" : \"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 VERIFY SEND

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

$url = 'https://rest.sendmode.com/v2/verify';
$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

C# VERIFY CODE

By
using (WebClient client = new WebClient())
{
    client.Headers.Add("Authorization", "YOUR_ACCESS_KEY");
    byte[] response =
    client.UploadValues("http://rest.sendmode.com/v2/verify", new NameValueCollection()
    {
        { "code", "YOUR_VERIFY_CODE" },
        { "recipient", "0870000000"}
    });

    string result = System.Text.Encoding.UTF8.GetString(response);
}

Read more

C# VERIFY SEND

By
using (WebClient client = new WebClient())
{
    client.Headers.Add("Authorization", "YOUR_ACCESS_KEY");
    var postJson = new JavaScriptSerializer().Serialize(new 
        { 
            messagetext = "This is your code.",
            senderid = "Sendmode",
            recipient = "0870000000" 
        }
    );
    byte[] response =
    client.UploadValues("https://rest.sendmode.com/v2/verify", new NameValueCollection()
    {
        { "message", postJson }
    });
    
    string result = System.Text.Encoding.UTF8.GetString(response);
}

Read more

IMPORT JSON

By
{
    "status":"OK",
    "statusCode":0,
    "acceptedDateTime":"2017-08-28T13:42:02.1757174+01:00",
    "group":"HELLO WORLD",
    "importdata":{
        "mobilenumber":"0870000000",
        "firstname":"Hello World",
        "surname":null,
        "address":null,
        "town":null,
        "county":null,
        "email":null,
        "custom1":null,
        "custom2":null,
        "businessname":null,
        "dateofbirth":null
    }
}

Read more

JAVA IMPORT

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

String json = "{\"firstname\" : \"Hello\", \"mobilenumber\" : \"0870000000\"}";
List<NameValuePair> params = new ArrayList<NameValuePair>(1);
params.add(new BasicNameValuePair("importdata", json));
httppost.setEntity(new UrlEncodedFormEntity(params, "UTF-8"));

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

Read more