sendSms
Send bulk sms
/api/v2/sendsms
Usage and SDK Samples
curl -X POST "https://api.adtel.co.ke/api/v2/sendsms"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.SmsApi;
import java.io.File;
import java.util.*;
public class SmsApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
SmsApi apiInstance = new SmsApi();
SendSMSRequest body = ; // SendSMSRequest |
try {
SendSMSRequest result = apiInstance.sendSms(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling SmsApi#sendSms");
e.printStackTrace();
}
}
}
import io.swagger.client.api.SmsApi;
public class SmsApiExample {
public static void main(String[] args) {
SmsApi apiInstance = new SmsApi();
SendSMSRequest body = ; // SendSMSRequest |
try {
SendSMSRequest result = apiInstance.sendSms(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling SmsApi#sendSms");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
SendSMSRequest *body = ; // (optional)
SmsApi *apiInstance = [[SmsApi alloc] init];
// Send bulk sms
[apiInstance sendSmsWith:body
completionHandler: ^(SendSMSRequest output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var AppApi = require('app_api');
var defaultClient = AppApi.ApiClient.instance;
var api = new AppApi.SmsApi()
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.sendSms(, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class sendSmsExample
{
public void main()
{
var apiInstance = new SmsApi();
var body = new SendSMSRequest(); // SendSMSRequest | (optional)
try
{
// Send bulk sms
SendSMSRequest result = apiInstance.sendSms(body);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling SmsApi.sendSms: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\ApiSmsApi();
$body = ; // SendSMSRequest |
try {
$result = $api_instance->sendSms($body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling SmsApi->sendSms: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::SmsApi;
my $api_instance = WWW::SwaggerClient::SmsApi->new();
my $body = WWW::SwaggerClient::Object::SendSMSRequest->new(); # SendSMSRequest |
eval {
my $result = $api_instance->sendSms(body => $body);
print Dumper($result);
};
if ($@) {
warn "Exception when calling SmsApi->sendSms: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = swagger_client.SmsApi()
body = # SendSMSRequest | (optional)
try:
# Send bulk sms
api_response = api_instance.send_sms(body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling SmsApi->sendSms: %s\n" % e)
Parameters
Body parameters
| Name | Description |
|---|---|
| body |