Credits

getCreditBalance

Get your current WinSMS credit balance

Get the current remaining credit balance for the account. ***Note*** - The credit balance is expressed as a value with a single decimal place.


/credits/balance

Usage and SDK Samples

curl -X GET -H "AUTHORIZATION: [[apiKey]]" "https://www.winsms.co.za/api/rest/v1/credits/balance"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.CreditsApi;

import java.io.File;
import java.util.*;

public class CreditsApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: APIKeyHeader
        ApiKeyAuth APIKeyHeader = (ApiKeyAuth) defaultClient.getAuthentication("APIKeyHeader");
        APIKeyHeader.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //APIKeyHeader.setApiKeyPrefix("Token");

        CreditsApi apiInstance = new CreditsApi();
        try {
            creditBalanceResponse result = apiInstance.getCreditBalance();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CreditsApi#getCreditBalance");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.CreditsApi;

public class CreditsApiExample {

    public static void main(String[] args) {
        CreditsApi apiInstance = new CreditsApi();
        try {
            creditBalanceResponse result = apiInstance.getCreditBalance();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CreditsApi#getCreditBalance");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: APIKeyHeader)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"AUTHORIZATION"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"AUTHORIZATION"];


CreditsApi *apiInstance = [[CreditsApi alloc] init];

// Get your current WinSMS credit balance
[apiInstance getCreditBalanceWithCompletionHandler: 
              ^(creditBalanceResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var Winsms = require('winsms');
var defaultClient = Winsms.ApiClient.instance;

// Configure API key authorization: APIKeyHeader
var APIKeyHeader = defaultClient.authentications['APIKeyHeader'];
APIKeyHeader.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//APIKeyHeader.apiKeyPrefix['AUTHORIZATION'] = "Token"

var api = new Winsms.CreditsApi()

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getCreditBalance(callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getCreditBalanceExample
    {
        public void main()
        {
            
            // Configure API key authorization: APIKeyHeader
            Configuration.Default.ApiKey.Add("AUTHORIZATION", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("AUTHORIZATION", "Bearer");

            var apiInstance = new CreditsApi();

            try
            {
                // Get your current WinSMS credit balance
                creditBalanceResponse result = apiInstance.getCreditBalance();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling CreditsApi.getCreditBalance: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: APIKeyHeader
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('AUTHORIZATION', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('AUTHORIZATION', 'Bearer');

$api_instance = new Swagger\Client\Api\CreditsApi();

try {
    $result = $api_instance->getCreditBalance();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CreditsApi->getCreditBalance: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::CreditsApi;

# Configure API key authorization: APIKeyHeader
$WWW::SwaggerClient::Configuration::api_key->{'AUTHORIZATION'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'AUTHORIZATION'} = "Bearer";

my $api_instance = WWW::SwaggerClient::CreditsApi->new();

eval { 
    my $result = $api_instance->getCreditBalance();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CreditsApi->getCreditBalance: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: APIKeyHeader
swagger_client.configuration.api_key['AUTHORIZATION'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['AUTHORIZATION'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.CreditsApi()

try: 
    # Get your current WinSMS credit balance
    api_response = api_instance.get_credit_balance()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CreditsApi->getCreditBalance: %s\n" % e)

Parameters

Responses

Status: 200 - OK

{timeStamp=20170120152253514, version=1.0, statusCode=200, creditBalance=3645}

Status: 401 - Unauthorized

{timeStamp=20170120152253514, version=1.0, statusCode=401, errorMessage=The 'AUTHORIZATION' header was not found. Set the 'AUTHORIZATION' request header to your WinSMS API Key}

Status: 404 - Not found

{timeStamp=20170120152253514, version=1.0, statusCode=404, errorMessage=The resource requested does not exist. Please verify the path, spelling, and capitalisation}

Status: 405 - Method Not Allowed

{timeStamp=20170120152253514, version=1.0, statusCode=405, errorMessage=Request method should be set to 'GET', not 'PUT'.}

Status: 500 - Internal Server Error

{timeStamp=20170120152253514, version=1.0, statusCode=500, errorMessage=An unknown error has occurred - authorising API Key}

transferCredits

Transfer credits between main and sub accounts.

Transfer credits between accounts. - From Main account to Sub account. - From Sub account to Main account. - From Sub account to another Sub account. Your WinSMS account number and sub account number/s can be obtained by logging in to the WinSMS Client Zone (www.winsms.co.za/cz) with the main account's credentials. The main account number is on the home tab and the sub account numbers are under the sub accounts tab. Account numbers should be submitted as integers. Do not add the 'W' prefix.


/credits/transfer

Usage and SDK Samples

curl -X POST -H "AUTHORIZATION: [[apiKey]]" "https://www.winsms.co.za/api/rest/v1/credits/transfer"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.CreditsApi;

import java.io.File;
import java.util.*;

public class CreditsApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: APIKeyHeader
        ApiKeyAuth APIKeyHeader = (ApiKeyAuth) defaultClient.getAuthentication("APIKeyHeader");
        APIKeyHeader.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //APIKeyHeader.setApiKeyPrefix("Token");

        CreditsApi apiInstance = new CreditsApi();
        CreditTransferDetails creditTransferDetails = ; // CreditTransferDetails | The details of the credit transfer. Sender account number, recipient account number, and number of credits to transfer.
        try {
            creditTransferResponse result = apiInstance.transferCredits(creditTransferDetails);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CreditsApi#transferCredits");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.CreditsApi;

public class CreditsApiExample {

    public static void main(String[] args) {
        CreditsApi apiInstance = new CreditsApi();
        CreditTransferDetails creditTransferDetails = ; // CreditTransferDetails | The details of the credit transfer. Sender account number, recipient account number, and number of credits to transfer.
        try {
            creditTransferResponse result = apiInstance.transferCredits(creditTransferDetails);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CreditsApi#transferCredits");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: APIKeyHeader)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"AUTHORIZATION"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"AUTHORIZATION"];

CreditTransferDetails *creditTransferDetails = ; // The details of the credit transfer. Sender account number, recipient account number, and number of credits to transfer.

CreditsApi *apiInstance = [[CreditsApi alloc] init];

// Transfer credits between main and sub accounts.
[apiInstance transferCreditsWith:creditTransferDetails
              completionHandler: ^(creditTransferResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var Winsms = require('winsms');
var defaultClient = Winsms.ApiClient.instance;

// Configure API key authorization: APIKeyHeader
var APIKeyHeader = defaultClient.authentications['APIKeyHeader'];
APIKeyHeader.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//APIKeyHeader.apiKeyPrefix['AUTHORIZATION'] = "Token"

var api = new Winsms.CreditsApi()

var creditTransferDetails = ; // {CreditTransferDetails} The details of the credit transfer. Sender account number, recipient account number, and number of credits to transfer.


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.transferCredits(creditTransferDetails, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class transferCreditsExample
    {
        public void main()
        {
            
            // Configure API key authorization: APIKeyHeader
            Configuration.Default.ApiKey.Add("AUTHORIZATION", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("AUTHORIZATION", "Bearer");

            var apiInstance = new CreditsApi();
            var creditTransferDetails = new CreditTransferDetails(); // CreditTransferDetails | The details of the credit transfer. Sender account number, recipient account number, and number of credits to transfer.

            try
            {
                // Transfer credits between main and sub accounts.
                creditTransferResponse result = apiInstance.transferCredits(creditTransferDetails);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling CreditsApi.transferCredits: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: APIKeyHeader
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('AUTHORIZATION', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('AUTHORIZATION', 'Bearer');

$api_instance = new Swagger\Client\Api\CreditsApi();
$creditTransferDetails = ; // CreditTransferDetails | The details of the credit transfer. Sender account number, recipient account number, and number of credits to transfer.

try {
    $result = $api_instance->transferCredits($creditTransferDetails);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CreditsApi->transferCredits: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::CreditsApi;

# Configure API key authorization: APIKeyHeader
$WWW::SwaggerClient::Configuration::api_key->{'AUTHORIZATION'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'AUTHORIZATION'} = "Bearer";

my $api_instance = WWW::SwaggerClient::CreditsApi->new();
my $creditTransferDetails = WWW::SwaggerClient::Object::CreditTransferDetails->new(); # CreditTransferDetails | The details of the credit transfer. Sender account number, recipient account number, and number of credits to transfer.

eval { 
    my $result = $api_instance->transferCredits(creditTransferDetails => $creditTransferDetails);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CreditsApi->transferCredits: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: APIKeyHeader
swagger_client.configuration.api_key['AUTHORIZATION'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['AUTHORIZATION'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.CreditsApi()
creditTransferDetails =  # CreditTransferDetails | The details of the credit transfer. Sender account number, recipient account number, and number of credits to transfer.

try: 
    # Transfer credits between main and sub accounts.
    api_response = api_instance.transfer_credits(creditTransferDetails)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CreditsApi->transferCredits: %s\n" % e)

Parameters

Body parameters
Name Description
creditTransferDetails *

Responses

Status: 200 - OK

Status: 400 - Bad Request

{timeStamp=20170120152253514, version=1.0, statusCode=400, errorMessage=Invalid JSON payload received}

Status: 401 - Unauthorized

{timeStamp=20170120152253514, version=1.0, statusCode=401, errorMessage=The 'AUTHORIZATION' header was not found. Set the 'AUTHORIZATION' request header to your WinSMS API Key}

Status: 404 - Not found

{timeStamp=20170120152253514, version=1.0, statusCode=404, errorMessage=The resource requested does not exist. Please verify the path, spelling, and capitalisation}

Status: 405 - Method Not Allowed

{timeStamp=20170120152253514, version=1.0, statusCode=405, errorMessage=Request method should be set to 'POST', not 'GET'.}

Status: 413 - Payload Too Large

{timeStamp=20170120152253514, version=1.0, statusCode=413, errorMessage=Request POST data is: 205kb. The maximum POST size allowed is 200kb.}

Status: 415 - Unsupported Media Type

{timeStamp=20170120152253514, version=1.0, statusCode=415, errorMessage=Request content-type should be set to 'application/json', not 'text/plain'.}

Status: 422 - Unprocessable Entity

{timeStamp=20170120152253514, version=1.0, statusCode=422, errorMessage=There is an error in the 'recipients' array.}

Status: 500 - Internal Server Error

{timeStamp=20170120152253514, version=1.0, statusCode=500, errorMessage=An unknown error has occurred - authorising API Key}

Shortcode

getShortCodeMessages

Get a list of incoming short/long code messages

***Only available to users with a [WinSMS Short/Long Code](https://support.winsms.co.za/winsms-long-short-code-system/).*** Get a list of all incoming short/long code messages received by the account. Only the first 100 incoming short/long code messages will be returned if no ***offset*** and ***limit*** parameters are specified.


/shortcode/incoming

Usage and SDK Samples

curl -X GET -H "AUTHORIZATION: [[apiKey]]" "https://www.winsms.co.za/api/rest/v1/shortcode/incoming?offset=&limit="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ShortcodeApi;

import java.io.File;
import java.util.*;

public class ShortcodeApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: APIKeyHeader
        ApiKeyAuth APIKeyHeader = (ApiKeyAuth) defaultClient.getAuthentication("APIKeyHeader");
        APIKeyHeader.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //APIKeyHeader.setApiKeyPrefix("Token");

        ShortcodeApi apiInstance = new ShortcodeApi();
        Integer offset = 56; // Integer | ***Optional*** - The number of items to skip before starting to return results. Default 0. Minimum 0.

        Integer limit = 56; // Integer | ***Optional*** - The number of items to return. Default 100. Minimum 1. Maximum 1000.

        try {
            shortcodeMessageResponse result = apiInstance.getShortCodeMessages(offset, limit);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ShortcodeApi#getShortCodeMessages");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ShortcodeApi;

public class ShortcodeApiExample {

    public static void main(String[] args) {
        ShortcodeApi apiInstance = new ShortcodeApi();
        Integer offset = 56; // Integer | ***Optional*** - The number of items to skip before starting to return results. Default 0. Minimum 0.

        Integer limit = 56; // Integer | ***Optional*** - The number of items to return. Default 100. Minimum 1. Maximum 1000.

        try {
            shortcodeMessageResponse result = apiInstance.getShortCodeMessages(offset, limit);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ShortcodeApi#getShortCodeMessages");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: APIKeyHeader)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"AUTHORIZATION"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"AUTHORIZATION"];

Integer *offset = 56; // ***Optional*** - The number of items to skip before starting to return results. Default 0. Minimum 0.
 (optional) (default to 0)
Integer *limit = 56; // ***Optional*** - The number of items to return. Default 100. Minimum 1. Maximum 1000.
 (optional) (default to 100)

ShortcodeApi *apiInstance = [[ShortcodeApi alloc] init];

// Get a list of incoming short/long code messages

[apiInstance getShortCodeMessagesWith:offset
    limit:limit
              completionHandler: ^(shortcodeMessageResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var Winsms = require('winsms');
var defaultClient = Winsms.ApiClient.instance;

// Configure API key authorization: APIKeyHeader
var APIKeyHeader = defaultClient.authentications['APIKeyHeader'];
APIKeyHeader.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//APIKeyHeader.apiKeyPrefix['AUTHORIZATION'] = "Token"

var api = new Winsms.ShortcodeApi()

var opts = { 
  'offset': 56, // {Integer} ***Optional*** - The number of items to skip before starting to return results. Default 0. Minimum 0.

  'limit': 56 // {Integer} ***Optional*** - The number of items to return. Default 100. Minimum 1. Maximum 1000.

};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getShortCodeMessages(opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getShortCodeMessagesExample
    {
        public void main()
        {
            
            // Configure API key authorization: APIKeyHeader
            Configuration.Default.ApiKey.Add("AUTHORIZATION", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("AUTHORIZATION", "Bearer");

            var apiInstance = new ShortcodeApi();
            var offset = 56;  // Integer | ***Optional*** - The number of items to skip before starting to return results. Default 0. Minimum 0.
 (optional)  (default to 0)
            var limit = 56;  // Integer | ***Optional*** - The number of items to return. Default 100. Minimum 1. Maximum 1000.
 (optional)  (default to 100)

            try
            {
                // Get a list of incoming short/long code messages

                shortcodeMessageResponse result = apiInstance.getShortCodeMessages(offset, limit);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ShortcodeApi.getShortCodeMessages: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: APIKeyHeader
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('AUTHORIZATION', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('AUTHORIZATION', 'Bearer');

$api_instance = new Swagger\Client\Api\ShortcodeApi();
$offset = 56; // Integer | ***Optional*** - The number of items to skip before starting to return results. Default 0. Minimum 0.

$limit = 56; // Integer | ***Optional*** - The number of items to return. Default 100. Minimum 1. Maximum 1000.


try {
    $result = $api_instance->getShortCodeMessages($offset, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ShortcodeApi->getShortCodeMessages: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ShortcodeApi;

# Configure API key authorization: APIKeyHeader
$WWW::SwaggerClient::Configuration::api_key->{'AUTHORIZATION'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'AUTHORIZATION'} = "Bearer";

my $api_instance = WWW::SwaggerClient::ShortcodeApi->new();
my $offset = 56; # Integer | ***Optional*** - The number of items to skip before starting to return results. Default 0. Minimum 0.

my $limit = 56; # Integer | ***Optional*** - The number of items to return. Default 100. Minimum 1. Maximum 1000.


eval { 
    my $result = $api_instance->getShortCodeMessages(offset => $offset, limit => $limit);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ShortcodeApi->getShortCodeMessages: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: APIKeyHeader
swagger_client.configuration.api_key['AUTHORIZATION'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['AUTHORIZATION'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.ShortcodeApi()
offset = 56 # Integer | ***Optional*** - The number of items to skip before starting to return results. Default 0. Minimum 0.
 (optional) (default to 0)
limit = 56 # Integer | ***Optional*** - The number of items to return. Default 100. Minimum 1. Maximum 1000.
 (optional) (default to 100)

try: 
    # Get a list of incoming short/long code messages

    api_response = api_instance.get_short_code_messages(offset=offset, limit=limit)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ShortcodeApi->getShortCodeMessages: %s\n" % e)

Parameters

Query parameters
Name Description
offset
Integer
***Optional*** - The number of items to skip before starting to return results. Default 0. Minimum 0.
limit
Integer
***Optional*** - The number of items to return. Default 100. Minimum 1. Maximum 1000.

Responses

Status: 200 - OK

Status: 401 - Unauthorized

{timeStamp=20170120152253514, version=1.0, statusCode=401, errorMessage=The 'AUTHORIZATION' header was not found. Set the 'AUTHORIZATION' request header to your WinSMS API Key}

Status: 404 - Not found

{timeStamp=20170120152253514, version=1.0, statusCode=404, errorMessage=The resource requested does not exist. Please verify the path, spelling, and capitalisation}

Status: 405 - Method Not Allowed

{timeStamp=20170120152253514, version=1.0, statusCode=405, errorMessage=Request method should be set to 'GET', not 'PUT'.}

Status: 422 - Unprocessable Entity

{timeStamp=20170120152253514, version=1.0, statusCode=422, errorMessage=The offset parameter must be a number greater than or equal to 0.}

Status: 500 - Internal Server Error

{timeStamp=20170120152253514, version=1.0, statusCode=500, errorMessage=An unknown error has occurred - authorising API Key}

Sms

deleteScheduledMessages

Delete scheduled SMS messages and refund credits

Delete a list of previously scheduled SMS messages that have not yet been sent. Credits originally deducted for each SMS message will be refunded to your account upon successful deletion.


/sms/scheduled/delete

Usage and SDK Samples

curl -X POST -H "AUTHORIZATION: [[apiKey]]" "https://www.winsms.co.za/api/rest/v1/sms/scheduled/delete"
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();
        
        // Configure API key authorization: APIKeyHeader
        ApiKeyAuth APIKeyHeader = (ApiKeyAuth) defaultClient.getAuthentication("APIKeyHeader");
        APIKeyHeader.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //APIKeyHeader.setApiKeyPrefix("Token");

        SmsApi apiInstance = new SmsApi();
        array[Integer] messageDeleteRequest = ; // array[Integer] | An array of WinSMS API Ids received after submitting scheduled messages to the ***/sms/outgoing/send*** endpoint.
A maximum of 1000 API Ids can be supplied in a single request. try { deleteScheduledResponse result = apiInstance.deleteScheduledMessages(messageDeleteRequest); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling SmsApi#deleteScheduledMessages"); e.printStackTrace(); } } }
import io.swagger.client.api.SmsApi;

public class SmsApiExample {

    public static void main(String[] args) {
        SmsApi apiInstance = new SmsApi();
        array[Integer] messageDeleteRequest = ; // array[Integer] | An array of WinSMS API Ids received after submitting scheduled messages to the ***/sms/outgoing/send*** endpoint.
A maximum of 1000 API Ids can be supplied in a single request. try { deleteScheduledResponse result = apiInstance.deleteScheduledMessages(messageDeleteRequest); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling SmsApi#deleteScheduledMessages"); e.printStackTrace(); } } }
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: APIKeyHeader)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"AUTHORIZATION"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"AUTHORIZATION"];

array[Integer] *messageDeleteRequest = ; // An array of WinSMS API Ids received after submitting scheduled messages to the ***/sms/outgoing/send*** endpoint.
A maximum of 1000 API Ids can be supplied in a single request. SmsApi *apiInstance = [[SmsApi alloc] init]; // Delete scheduled SMS messages and refund credits [apiInstance deleteScheduledMessagesWith:messageDeleteRequest completionHandler: ^(deleteScheduledResponse output, NSError* error) { if (output) { NSLog(@"%@", output); } if (error) { NSLog(@"Error: %@", error); } }];
var Winsms = require('winsms');
var defaultClient = Winsms.ApiClient.instance;

// Configure API key authorization: APIKeyHeader
var APIKeyHeader = defaultClient.authentications['APIKeyHeader'];
APIKeyHeader.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//APIKeyHeader.apiKeyPrefix['AUTHORIZATION'] = "Token"

var api = new Winsms.SmsApi()

var messageDeleteRequest = ; // {array[Integer]} An array of WinSMS API Ids received after submitting scheduled messages to the ***/sms/outgoing/send*** endpoint.
A maximum of 1000 API Ids can be supplied in a single request. var callback = function(error, data, response) { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }; api.deleteScheduledMessages(messageDeleteRequest, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class deleteScheduledMessagesExample
    {
        public void main()
        {
            
            // Configure API key authorization: APIKeyHeader
            Configuration.Default.ApiKey.Add("AUTHORIZATION", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("AUTHORIZATION", "Bearer");

            var apiInstance = new SmsApi();
            var messageDeleteRequest = new array[Integer](); // array[Integer] | An array of WinSMS API Ids received after submitting scheduled messages to the ***/sms/outgoing/send*** endpoint.
A maximum of 1000 API Ids can be supplied in a single request. try { // Delete scheduled SMS messages and refund credits deleteScheduledResponse result = apiInstance.deleteScheduledMessages(messageDeleteRequest); Debug.WriteLine(result); } catch (Exception e) { Debug.Print("Exception when calling SmsApi.deleteScheduledMessages: " + e.Message ); } } } }
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: APIKeyHeader
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('AUTHORIZATION', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('AUTHORIZATION', 'Bearer');

$api_instance = new Swagger\Client\Api\SmsApi();
$messageDeleteRequest = ; // array[Integer] | An array of WinSMS API Ids received after submitting scheduled messages to the ***/sms/outgoing/send*** endpoint.
A maximum of 1000 API Ids can be supplied in a single request. try { $result = $api_instance->deleteScheduledMessages($messageDeleteRequest); print_r($result); } catch (Exception $e) { echo 'Exception when calling SmsApi->deleteScheduledMessages: ', $e->getMessage(), PHP_EOL; } ?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::SmsApi;

# Configure API key authorization: APIKeyHeader
$WWW::SwaggerClient::Configuration::api_key->{'AUTHORIZATION'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'AUTHORIZATION'} = "Bearer";

my $api_instance = WWW::SwaggerClient::SmsApi->new();
my $messageDeleteRequest = [WWW::SwaggerClient::Object::array[Integer]->new()]; # array[Integer] | An array of WinSMS API Ids received after submitting scheduled messages to the ***/sms/outgoing/send*** endpoint.
A maximum of 1000 API Ids can be supplied in a single request. eval { my $result = $api_instance->deleteScheduledMessages(messageDeleteRequest => $messageDeleteRequest); print Dumper($result); }; if ($@) { warn "Exception when calling SmsApi->deleteScheduledMessages: $@\n"; }
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: APIKeyHeader
swagger_client.configuration.api_key['AUTHORIZATION'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['AUTHORIZATION'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.SmsApi()
messageDeleteRequest =  # array[Integer] | An array of WinSMS API Ids received after submitting scheduled messages to the ***/sms/outgoing/send*** endpoint.
A maximum of 1000 API Ids can be supplied in a single request. try: # Delete scheduled SMS messages and refund credits api_response = api_instance.delete_scheduled_messages(messageDeleteRequest) pprint(api_response) except ApiException as e: print("Exception when calling SmsApi->deleteScheduledMessages: %s\n" % e)

Parameters

Body parameters
Name Description
messageDeleteRequest *

Responses

Status: 200 - OK

Status: 400 - Bad Request

{timeStamp=20170120152253514, version=1.0, statusCode=400, errorMessage=Invalid JSON payload received}

Status: 401 - Unauthorized

{timeStamp=20170120152253514, version=1.0, statusCode=401, errorMessage=The 'AUTHORIZATION' header was not found. Set the 'AUTHORIZATION' request header to your WinSMS API Key}

Status: 404 - Not found

{timeStamp=20170120152253514, version=1.0, statusCode=404, errorMessage=The resource requested does not exist. Please verify the path, spelling, and capitalisation}

Status: 405 - Method Not Allowed

{timeStamp=20170120152253514, version=1.0, statusCode=405, errorMessage=Request method should be set to 'POST', not 'GET'.}

Status: 413 - Payload Too Large

{timeStamp=20170120152253514, version=1.0, statusCode=413, errorMessage=Request POST data is: 205kb. The maximum POST size allowed is 200kb.}

Status: 415 - Unsupported Media Type

{timeStamp=20170120152253514, version=1.0, statusCode=415, errorMessage=Request content-type should be set to 'application/json', not 'text/plain'.}

Status: 422 - Unprocessable Entity

{timeStamp=20170120152253514, version=1.0, statusCode=422, errorMessage=At least one non-numeric api Id was supplied in the apiIds array.}

Status: 500 - Internal Server Error

{timeStamp=20170120152253514, version=1.0, statusCode=500, errorMessage=An unknown error has occurred - authorising API Key}

getIncomingMessages

Get a list of incoming SMS messages

Get a list of all incoming SMS messages received by the account. Only the first 100 incoming messages will be returned if no ***offset*** and ***limit*** parameters are specified.


/sms/incoming

Usage and SDK Samples

curl -X GET -H "AUTHORIZATION: [[apiKey]]" "https://www.winsms.co.za/api/rest/v1/sms/incoming?offset=&limit="
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();
        
        // Configure API key authorization: APIKeyHeader
        ApiKeyAuth APIKeyHeader = (ApiKeyAuth) defaultClient.getAuthentication("APIKeyHeader");
        APIKeyHeader.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //APIKeyHeader.setApiKeyPrefix("Token");

        SmsApi apiInstance = new SmsApi();
        Integer offset = 56; // Integer | ***Optional*** - The number of items to skip before starting to return results. Default 0. Minimum 0.

        Integer limit = 56; // Integer | ***Optional*** - The number of items to return. Default 100. Minimum 1. Maximum 1000.

        try {
            incomingMessageResponse result = apiInstance.getIncomingMessages(offset, limit);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling SmsApi#getIncomingMessages");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.SmsApi;

public class SmsApiExample {

    public static void main(String[] args) {
        SmsApi apiInstance = new SmsApi();
        Integer offset = 56; // Integer | ***Optional*** - The number of items to skip before starting to return results. Default 0. Minimum 0.

        Integer limit = 56; // Integer | ***Optional*** - The number of items to return. Default 100. Minimum 1. Maximum 1000.

        try {
            incomingMessageResponse result = apiInstance.getIncomingMessages(offset, limit);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling SmsApi#getIncomingMessages");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: APIKeyHeader)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"AUTHORIZATION"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"AUTHORIZATION"];

Integer *offset = 56; // ***Optional*** - The number of items to skip before starting to return results. Default 0. Minimum 0.
 (optional) (default to 0)
Integer *limit = 56; // ***Optional*** - The number of items to return. Default 100. Minimum 1. Maximum 1000.
 (optional) (default to 100)

SmsApi *apiInstance = [[SmsApi alloc] init];

// Get a list of incoming SMS messages
[apiInstance getIncomingMessagesWith:offset
    limit:limit
              completionHandler: ^(incomingMessageResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var Winsms = require('winsms');
var defaultClient = Winsms.ApiClient.instance;

// Configure API key authorization: APIKeyHeader
var APIKeyHeader = defaultClient.authentications['APIKeyHeader'];
APIKeyHeader.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//APIKeyHeader.apiKeyPrefix['AUTHORIZATION'] = "Token"

var api = new Winsms.SmsApi()

var opts = { 
  'offset': 56, // {Integer} ***Optional*** - The number of items to skip before starting to return results. Default 0. Minimum 0.

  'limit': 56 // {Integer} ***Optional*** - The number of items to return. Default 100. Minimum 1. Maximum 1000.

};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getIncomingMessages(opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getIncomingMessagesExample
    {
        public void main()
        {
            
            // Configure API key authorization: APIKeyHeader
            Configuration.Default.ApiKey.Add("AUTHORIZATION", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("AUTHORIZATION", "Bearer");

            var apiInstance = new SmsApi();
            var offset = 56;  // Integer | ***Optional*** - The number of items to skip before starting to return results. Default 0. Minimum 0.
 (optional)  (default to 0)
            var limit = 56;  // Integer | ***Optional*** - The number of items to return. Default 100. Minimum 1. Maximum 1000.
 (optional)  (default to 100)

            try
            {
                // Get a list of incoming SMS messages
                incomingMessageResponse result = apiInstance.getIncomingMessages(offset, limit);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling SmsApi.getIncomingMessages: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: APIKeyHeader
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('AUTHORIZATION', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('AUTHORIZATION', 'Bearer');

$api_instance = new Swagger\Client\Api\SmsApi();
$offset = 56; // Integer | ***Optional*** - The number of items to skip before starting to return results. Default 0. Minimum 0.

$limit = 56; // Integer | ***Optional*** - The number of items to return. Default 100. Minimum 1. Maximum 1000.


try {
    $result = $api_instance->getIncomingMessages($offset, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SmsApi->getIncomingMessages: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::SmsApi;

# Configure API key authorization: APIKeyHeader
$WWW::SwaggerClient::Configuration::api_key->{'AUTHORIZATION'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'AUTHORIZATION'} = "Bearer";

my $api_instance = WWW::SwaggerClient::SmsApi->new();
my $offset = 56; # Integer | ***Optional*** - The number of items to skip before starting to return results. Default 0. Minimum 0.

my $limit = 56; # Integer | ***Optional*** - The number of items to return. Default 100. Minimum 1. Maximum 1000.


eval { 
    my $result = $api_instance->getIncomingMessages(offset => $offset, limit => $limit);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling SmsApi->getIncomingMessages: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: APIKeyHeader
swagger_client.configuration.api_key['AUTHORIZATION'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['AUTHORIZATION'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.SmsApi()
offset = 56 # Integer | ***Optional*** - The number of items to skip before starting to return results. Default 0. Minimum 0.
 (optional) (default to 0)
limit = 56 # Integer | ***Optional*** - The number of items to return. Default 100. Minimum 1. Maximum 1000.
 (optional) (default to 100)

try: 
    # Get a list of incoming SMS messages
    api_response = api_instance.get_incoming_messages(offset=offset, limit=limit)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling SmsApi->getIncomingMessages: %s\n" % e)

Parameters

Query parameters
Name Description
offset
Integer
***Optional*** - The number of items to skip before starting to return results. Default 0. Minimum 0.
limit
Integer
***Optional*** - The number of items to return. Default 100. Minimum 1. Maximum 1000.

Responses

Status: 200 - OK

Status: 401 - Unauthorized

{timeStamp=20170120152253514, version=1.0, statusCode=401, errorMessage=The 'AUTHORIZATION' header was not found. Set the 'AUTHORIZATION' request header to your WinSMS API Key}

Status: 404 - Not found

{timeStamp=20170120152253514, version=1.0, statusCode=404, errorMessage=The resource requested does not exist. Please verify the path, spelling, and capitalisation}

Status: 405 - Method Not Allowed

{timeStamp=20170120152253514, version=1.0, statusCode=405, errorMessage=Request method should be set to 'GET', not 'PUT'.}

Status: 422 - Unprocessable Entity

{timeStamp=20170120152253514, version=1.0, statusCode=422, errorMessage=The offset parameter must be a number greater than or equal to 0.}

Status: 500 - Internal Server Error

{timeStamp=20170120152253514, version=1.0, statusCode=500, errorMessage=An unknown error has occurred - authorising API Key}

getOptoutMessages

Get a list of incoming opt-out SMS messages

Get a list of all opt-out SMS messages received by the account, as well as all manually added opt-out numbers.<br>


/sms/incoming/optout

Usage and SDK Samples

curl -X GET -H "AUTHORIZATION: [[apiKey]]" "https://www.winsms.co.za/api/rest/v1/sms/incoming/optout"
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();
        
        // Configure API key authorization: APIKeyHeader
        ApiKeyAuth APIKeyHeader = (ApiKeyAuth) defaultClient.getAuthentication("APIKeyHeader");
        APIKeyHeader.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //APIKeyHeader.setApiKeyPrefix("Token");

        SmsApi apiInstance = new SmsApi();
        try {
            optoutMessageResponse result = apiInstance.getOptoutMessages();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling SmsApi#getOptoutMessages");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.SmsApi;

public class SmsApiExample {

    public static void main(String[] args) {
        SmsApi apiInstance = new SmsApi();
        try {
            optoutMessageResponse result = apiInstance.getOptoutMessages();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling SmsApi#getOptoutMessages");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: APIKeyHeader)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"AUTHORIZATION"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"AUTHORIZATION"];


SmsApi *apiInstance = [[SmsApi alloc] init];

// Get a list of incoming opt-out SMS messages
[apiInstance getOptoutMessagesWithCompletionHandler: 
              ^(optoutMessageResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var Winsms = require('winsms');
var defaultClient = Winsms.ApiClient.instance;

// Configure API key authorization: APIKeyHeader
var APIKeyHeader = defaultClient.authentications['APIKeyHeader'];
APIKeyHeader.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//APIKeyHeader.apiKeyPrefix['AUTHORIZATION'] = "Token"

var api = new Winsms.SmsApi()

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getOptoutMessages(callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getOptoutMessagesExample
    {
        public void main()
        {
            
            // Configure API key authorization: APIKeyHeader
            Configuration.Default.ApiKey.Add("AUTHORIZATION", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("AUTHORIZATION", "Bearer");

            var apiInstance = new SmsApi();

            try
            {
                // Get a list of incoming opt-out SMS messages
                optoutMessageResponse result = apiInstance.getOptoutMessages();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling SmsApi.getOptoutMessages: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: APIKeyHeader
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('AUTHORIZATION', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('AUTHORIZATION', 'Bearer');

$api_instance = new Swagger\Client\Api\SmsApi();

try {
    $result = $api_instance->getOptoutMessages();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SmsApi->getOptoutMessages: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::SmsApi;

# Configure API key authorization: APIKeyHeader
$WWW::SwaggerClient::Configuration::api_key->{'AUTHORIZATION'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'AUTHORIZATION'} = "Bearer";

my $api_instance = WWW::SwaggerClient::SmsApi->new();

eval { 
    my $result = $api_instance->getOptoutMessages();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling SmsApi->getOptoutMessages: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: APIKeyHeader
swagger_client.configuration.api_key['AUTHORIZATION'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['AUTHORIZATION'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.SmsApi()

try: 
    # Get a list of incoming opt-out SMS messages
    api_response = api_instance.get_optout_messages()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling SmsApi->getOptoutMessages: %s\n" % e)

Parameters

Responses

Status: 200 - OK

Status: 401 - Unauthorized

{timeStamp=20170120152253514, version=1.0, statusCode=401, errorMessage=The 'AUTHORIZATION' header was not found. Set the 'AUTHORIZATION' request header to your WinSMS API Key}

Status: 404 - Not found

{timeStamp=20170120152253514, version=1.0, statusCode=404, errorMessage=The resource requested does not exist. Please verify the path, spelling, and capitalisation}

Status: 405 - Method Not Allowed

{timeStamp=20170120152253514, version=1.0, statusCode=405, errorMessage=Request method should be set to 'GET', not 'PUT'.}

Status: 500 - Internal Server Error

{timeStamp=20170120152253514, version=1.0, statusCode=500, errorMessage=An unknown error has occurred - authorising API Key}

getScheduledMessages

Get a list of scheduled SMS messages

Get a list of all scheduled SMS messages that have not yet been sent. Only the first 100 scheduled messages will be returned if no ***offset*** and ***limit*** parameters are specified.


/sms/scheduled

Usage and SDK Samples

curl -X GET -H "AUTHORIZATION: [[apiKey]]" "https://www.winsms.co.za/api/rest/v1/sms/scheduled?offset=&limit="
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();
        
        // Configure API key authorization: APIKeyHeader
        ApiKeyAuth APIKeyHeader = (ApiKeyAuth) defaultClient.getAuthentication("APIKeyHeader");
        APIKeyHeader.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //APIKeyHeader.setApiKeyPrefix("Token");

        SmsApi apiInstance = new SmsApi();
        Integer offset = 56; // Integer | ***Optional*** - The number of items to skip before starting to return results. Default 0. Minimum 0.

        Integer limit = 56; // Integer | ***Optional*** - The number of items to return. Default 100. Minimum 1. Maximum 1000.

        try {
            scheduledMessageResponse result = apiInstance.getScheduledMessages(offset, limit);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling SmsApi#getScheduledMessages");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.SmsApi;

public class SmsApiExample {

    public static void main(String[] args) {
        SmsApi apiInstance = new SmsApi();
        Integer offset = 56; // Integer | ***Optional*** - The number of items to skip before starting to return results. Default 0. Minimum 0.

        Integer limit = 56; // Integer | ***Optional*** - The number of items to return. Default 100. Minimum 1. Maximum 1000.

        try {
            scheduledMessageResponse result = apiInstance.getScheduledMessages(offset, limit);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling SmsApi#getScheduledMessages");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: APIKeyHeader)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"AUTHORIZATION"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"AUTHORIZATION"];

Integer *offset = 56; // ***Optional*** - The number of items to skip before starting to return results. Default 0. Minimum 0.
 (optional) (default to 0)
Integer *limit = 56; // ***Optional*** - The number of items to return. Default 100. Minimum 1. Maximum 1000.
 (optional) (default to 100)

SmsApi *apiInstance = [[SmsApi alloc] init];

// Get a list of scheduled SMS messages
[apiInstance getScheduledMessagesWith:offset
    limit:limit
              completionHandler: ^(scheduledMessageResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var Winsms = require('winsms');
var defaultClient = Winsms.ApiClient.instance;

// Configure API key authorization: APIKeyHeader
var APIKeyHeader = defaultClient.authentications['APIKeyHeader'];
APIKeyHeader.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//APIKeyHeader.apiKeyPrefix['AUTHORIZATION'] = "Token"

var api = new Winsms.SmsApi()

var opts = { 
  'offset': 56, // {Integer} ***Optional*** - The number of items to skip before starting to return results. Default 0. Minimum 0.

  'limit': 56 // {Integer} ***Optional*** - The number of items to return. Default 100. Minimum 1. Maximum 1000.

};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getScheduledMessages(opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getScheduledMessagesExample
    {
        public void main()
        {
            
            // Configure API key authorization: APIKeyHeader
            Configuration.Default.ApiKey.Add("AUTHORIZATION", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("AUTHORIZATION", "Bearer");

            var apiInstance = new SmsApi();
            var offset = 56;  // Integer | ***Optional*** - The number of items to skip before starting to return results. Default 0. Minimum 0.
 (optional)  (default to 0)
            var limit = 56;  // Integer | ***Optional*** - The number of items to return. Default 100. Minimum 1. Maximum 1000.
 (optional)  (default to 100)

            try
            {
                // Get a list of scheduled SMS messages
                scheduledMessageResponse result = apiInstance.getScheduledMessages(offset, limit);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling SmsApi.getScheduledMessages: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: APIKeyHeader
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('AUTHORIZATION', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('AUTHORIZATION', 'Bearer');

$api_instance = new Swagger\Client\Api\SmsApi();
$offset = 56; // Integer | ***Optional*** - The number of items to skip before starting to return results. Default 0. Minimum 0.

$limit = 56; // Integer | ***Optional*** - The number of items to return. Default 100. Minimum 1. Maximum 1000.


try {
    $result = $api_instance->getScheduledMessages($offset, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SmsApi->getScheduledMessages: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::SmsApi;

# Configure API key authorization: APIKeyHeader
$WWW::SwaggerClient::Configuration::api_key->{'AUTHORIZATION'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'AUTHORIZATION'} = "Bearer";

my $api_instance = WWW::SwaggerClient::SmsApi->new();
my $offset = 56; # Integer | ***Optional*** - The number of items to skip before starting to return results. Default 0. Minimum 0.

my $limit = 56; # Integer | ***Optional*** - The number of items to return. Default 100. Minimum 1. Maximum 1000.


eval { 
    my $result = $api_instance->getScheduledMessages(offset => $offset, limit => $limit);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling SmsApi->getScheduledMessages: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: APIKeyHeader
swagger_client.configuration.api_key['AUTHORIZATION'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['AUTHORIZATION'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.SmsApi()
offset = 56 # Integer | ***Optional*** - The number of items to skip before starting to return results. Default 0. Minimum 0.
 (optional) (default to 0)
limit = 56 # Integer | ***Optional*** - The number of items to return. Default 100. Minimum 1. Maximum 1000.
 (optional) (default to 100)

try: 
    # Get a list of scheduled SMS messages
    api_response = api_instance.get_scheduled_messages(offset=offset, limit=limit)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling SmsApi->getScheduledMessages: %s\n" % e)

Parameters

Query parameters
Name Description
offset
Integer
***Optional*** - The number of items to skip before starting to return results. Default 0. Minimum 0.
limit
Integer
***Optional*** - The number of items to return. Default 100. Minimum 1. Maximum 1000.

Responses

Status: 200 - OK

Status: 401 - Unauthorized

{timeStamp=20170120152253514, version=1.0, statusCode=401, errorMessage=The 'AUTHORIZATION' header was not found. Set the 'AUTHORIZATION' request header to your WinSMS API Key}

Status: 404 - Not found

{timeStamp=20170120152253514, version=1.0, statusCode=404, errorMessage=The resource requested does not exist. Please verify the path, spelling, and capitalisation}

Status: 405 - Method Not Allowed

{timeStamp=20170120152253514, version=1.0, statusCode=405, errorMessage=Request method should be set to 'GET', not 'PUT'.}

Status: 422 - Unprocessable Entity

{timeStamp=20170120152253514, version=1.0, statusCode=422, errorMessage=The offset parameter must be a number greater than or equal to 0.}

Status: 500 - Internal Server Error

{timeStamp=20170120152253514, version=1.0, statusCode=500, errorMessage=An unknown error has occurred - authorising API Key}

smsSend

Send SMS messages

Submit 1 or more SMS messages to be sent by WinSMS. Maximum 1000 recipients per request. The SMS message text can be a maximum of 918 characters long. If you are submitting a message longer than 160 characters, you should change the value of ***maxSegments***.


/sms/outgoing/send

Usage and SDK Samples

curl -X POST -H "AUTHORIZATION: [[apiKey]]" "https://www.winsms.co.za/api/rest/v1/sms/outgoing/send"
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();
        
        // Configure API key authorization: APIKeyHeader
        ApiKeyAuth APIKeyHeader = (ApiKeyAuth) defaultClient.getAuthentication("APIKeyHeader");
        APIKeyHeader.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //APIKeyHeader.setApiKeyPrefix("Token");

        SmsApi apiInstance = new SmsApi();
        NewMessageDetails newMessageDetails = ; // NewMessageDetails | The message, recipients and delivery options of an SMS message to be sent.

        try {
            newMessageResponse result = apiInstance.smsSend(newMessageDetails);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling SmsApi#smsSend");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.SmsApi;

public class SmsApiExample {

    public static void main(String[] args) {
        SmsApi apiInstance = new SmsApi();
        NewMessageDetails newMessageDetails = ; // NewMessageDetails | The message, recipients and delivery options of an SMS message to be sent.

        try {
            newMessageResponse result = apiInstance.smsSend(newMessageDetails);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling SmsApi#smsSend");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: APIKeyHeader)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"AUTHORIZATION"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"AUTHORIZATION"];

NewMessageDetails *newMessageDetails = ; // The message, recipients and delivery options of an SMS message to be sent.


SmsApi *apiInstance = [[SmsApi alloc] init];

// Send SMS messages
[apiInstance smsSendWith:newMessageDetails
              completionHandler: ^(newMessageResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var Winsms = require('winsms');
var defaultClient = Winsms.ApiClient.instance;

// Configure API key authorization: APIKeyHeader
var APIKeyHeader = defaultClient.authentications['APIKeyHeader'];
APIKeyHeader.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//APIKeyHeader.apiKeyPrefix['AUTHORIZATION'] = "Token"

var api = new Winsms.SmsApi()

var newMessageDetails = ; // {NewMessageDetails} The message, recipients and delivery options of an SMS message to be sent.



var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.smsSend(newMessageDetails, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class smsSendExample
    {
        public void main()
        {
            
            // Configure API key authorization: APIKeyHeader
            Configuration.Default.ApiKey.Add("AUTHORIZATION", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("AUTHORIZATION", "Bearer");

            var apiInstance = new SmsApi();
            var newMessageDetails = new NewMessageDetails(); // NewMessageDetails | The message, recipients and delivery options of an SMS message to be sent.


            try
            {
                // Send SMS messages
                newMessageResponse result = apiInstance.smsSend(newMessageDetails);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling SmsApi.smsSend: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: APIKeyHeader
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('AUTHORIZATION', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('AUTHORIZATION', 'Bearer');

$api_instance = new Swagger\Client\Api\SmsApi();
$newMessageDetails = ; // NewMessageDetails | The message, recipients and delivery options of an SMS message to be sent.


try {
    $result = $api_instance->smsSend($newMessageDetails);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SmsApi->smsSend: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::SmsApi;

# Configure API key authorization: APIKeyHeader
$WWW::SwaggerClient::Configuration::api_key->{'AUTHORIZATION'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'AUTHORIZATION'} = "Bearer";

my $api_instance = WWW::SwaggerClient::SmsApi->new();
my $newMessageDetails = WWW::SwaggerClient::Object::NewMessageDetails->new(); # NewMessageDetails | The message, recipients and delivery options of an SMS message to be sent.


eval { 
    my $result = $api_instance->smsSend(newMessageDetails => $newMessageDetails);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling SmsApi->smsSend: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: APIKeyHeader
swagger_client.configuration.api_key['AUTHORIZATION'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['AUTHORIZATION'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.SmsApi()
newMessageDetails =  # NewMessageDetails | The message, recipients and delivery options of an SMS message to be sent.


try: 
    # Send SMS messages
    api_response = api_instance.sms_send(newMessageDetails)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling SmsApi->smsSend: %s\n" % e)

Parameters

Body parameters
Name Description
newMessageDetails *

Responses

Status: 200 - OK

Status: 400 - Bad Request

{timeStamp=20170120152253514, version=1.0, statusCode=400, errorMessage=Invalid JSON payload received}

Status: 401 - Unauthorized

{timeStamp=20170120152253514, version=1.0, statusCode=401, errorMessage=The 'AUTHORIZATION' header was not found. Set the 'AUTHORIZATION' request header to your WinSMS API Key}

Status: 404 - Not found

{timeStamp=20170120152253514, version=1.0, statusCode=404, errorMessage=The resource requested does not exist. Please verify the path, spelling, and capitalisation}

Status: 405 - Method Not Allowed

{timeStamp=20170120152253514, version=1.0, statusCode=405, errorMessage=Request method should be set to 'POST', not 'GET'.}

Status: 413 - Payload Too Large

{timeStamp=20170120152253514, version=1.0, statusCode=413, errorMessage=Request POST data is: 205kb. The maximum POST size allowed is 200kb.}

Status: 415 - Unsupported Media Type

{timeStamp=20170120152253514, version=1.0, statusCode=415, errorMessage=Request content-type should be set to 'application/json', not 'text/plain'.}

Status: 422 - Unprocessable Entity

{timeStamp=20170120152253514, version=1.0, statusCode=422, errorMessage=There is an error in the 'recipients' array.}

Status: 500 - Internal Server Error

{timeStamp=20170120152253514, version=1.0, statusCode=500, errorMessage=An unknown error has occurred - authorising API Key}

smsStatus

Get SMS delivery statuses

Get a list of previously submitted SMS message delivery statuses. Post an array of API Message Ids received from the ***/sms/outgoing/send*** endpoint.


/sms/outgoing/status

Usage and SDK Samples

curl -X POST -H "AUTHORIZATION: [[apiKey]]" "https://www.winsms.co.za/api/rest/v1/sms/outgoing/status"
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();
        
        // Configure API key authorization: APIKeyHeader
        ApiKeyAuth APIKeyHeader = (ApiKeyAuth) defaultClient.getAuthentication("APIKeyHeader");
        APIKeyHeader.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //APIKeyHeader.setApiKeyPrefix("Token");

        SmsApi apiInstance = new SmsApi();
        array[Integer] messageStatusRequest = ; // array[Integer] | An array of WinSMS API Ids received after submitting messages to the ***/sms/outgoing/send*** endpoint.

A maximum of 1000 API Ids can be supplied in a single request.

        try {
            messageStatusResponse result = apiInstance.smsStatus(messageStatusRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling SmsApi#smsStatus");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.SmsApi;

public class SmsApiExample {

    public static void main(String[] args) {
        SmsApi apiInstance = new SmsApi();
        array[Integer] messageStatusRequest = ; // array[Integer] | An array of WinSMS API Ids received after submitting messages to the ***/sms/outgoing/send*** endpoint.

A maximum of 1000 API Ids can be supplied in a single request.

        try {
            messageStatusResponse result = apiInstance.smsStatus(messageStatusRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling SmsApi#smsStatus");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: APIKeyHeader)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"AUTHORIZATION"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"AUTHORIZATION"];

array[Integer] *messageStatusRequest = ; // An array of WinSMS API Ids received after submitting messages to the ***/sms/outgoing/send*** endpoint.

A maximum of 1000 API Ids can be supplied in a single request.


SmsApi *apiInstance = [[SmsApi alloc] init];

// Get SMS delivery statuses
[apiInstance smsStatusWith:messageStatusRequest
              completionHandler: ^(messageStatusResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var Winsms = require('winsms');
var defaultClient = Winsms.ApiClient.instance;

// Configure API key authorization: APIKeyHeader
var APIKeyHeader = defaultClient.authentications['APIKeyHeader'];
APIKeyHeader.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//APIKeyHeader.apiKeyPrefix['AUTHORIZATION'] = "Token"

var api = new Winsms.SmsApi()

var messageStatusRequest = ; // {array[Integer]} An array of WinSMS API Ids received after submitting messages to the ***/sms/outgoing/send*** endpoint.

A maximum of 1000 API Ids can be supplied in a single request.



var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.smsStatus(messageStatusRequest, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class smsStatusExample
    {
        public void main()
        {
            
            // Configure API key authorization: APIKeyHeader
            Configuration.Default.ApiKey.Add("AUTHORIZATION", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("AUTHORIZATION", "Bearer");

            var apiInstance = new SmsApi();
            var messageStatusRequest = new array[Integer](); // array[Integer] | An array of WinSMS API Ids received after submitting messages to the ***/sms/outgoing/send*** endpoint.

A maximum of 1000 API Ids can be supplied in a single request.


            try
            {
                // Get SMS delivery statuses
                messageStatusResponse result = apiInstance.smsStatus(messageStatusRequest);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling SmsApi.smsStatus: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: APIKeyHeader
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('AUTHORIZATION', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('AUTHORIZATION', 'Bearer');

$api_instance = new Swagger\Client\Api\SmsApi();
$messageStatusRequest = ; // array[Integer] | An array of WinSMS API Ids received after submitting messages to the ***/sms/outgoing/send*** endpoint.

A maximum of 1000 API Ids can be supplied in a single request.


try {
    $result = $api_instance->smsStatus($messageStatusRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SmsApi->smsStatus: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::SmsApi;

# Configure API key authorization: APIKeyHeader
$WWW::SwaggerClient::Configuration::api_key->{'AUTHORIZATION'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'AUTHORIZATION'} = "Bearer";

my $api_instance = WWW::SwaggerClient::SmsApi->new();
my $messageStatusRequest = [WWW::SwaggerClient::Object::array[Integer]->new()]; # array[Integer] | An array of WinSMS API Ids received after submitting messages to the ***/sms/outgoing/send*** endpoint.

A maximum of 1000 API Ids can be supplied in a single request.


eval { 
    my $result = $api_instance->smsStatus(messageStatusRequest => $messageStatusRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling SmsApi->smsStatus: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: APIKeyHeader
swagger_client.configuration.api_key['AUTHORIZATION'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['AUTHORIZATION'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.SmsApi()
messageStatusRequest =  # array[Integer] | An array of WinSMS API Ids received after submitting messages to the ***/sms/outgoing/send*** endpoint.

A maximum of 1000 API Ids can be supplied in a single request.


try: 
    # Get SMS delivery statuses
    api_response = api_instance.sms_status(messageStatusRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling SmsApi->smsStatus: %s\n" % e)

Parameters

Body parameters
Name Description
messageStatusRequest *

Responses

Status: 200 - OK

Status: 400 - Bad Request

{timeStamp=20170120152253514, version=1.0, statusCode=400, errorMessage=Invalid JSON payload received}

Status: 401 - Unauthorized

{timeStamp=20170120152253514, version=1.0, statusCode=401, errorMessage=The 'AUTHORIZATION' header was not found. Set the 'AUTHORIZATION' request header to your WinSMS API Key}

Status: 404 - Not found

{timeStamp=20170120152253514, version=1.0, statusCode=404, errorMessage=The resource requested does not exist. Please verify the path, spelling, and capitalisation}

Status: 405 - Method Not Allowed

{timeStamp=20170120152253514, version=1.0, statusCode=405, errorMessage=Request method should be set to 'POST', not 'GET'.}

Status: 413 - Payload Too Large

{timeStamp=20170120152253514, version=1.0, statusCode=413, errorMessage=Request POST data is: 205kb. The maximum POST size allowed is 200kb.}

Status: 415 - Unsupported Media Type

{timeStamp=20170120152253514, version=1.0, statusCode=415, errorMessage=Request content-type should be set to 'application/json', not 'text/plain'.}

Status: 422 - Unprocessable Entity

{timeStamp=20170120152253514, version=1.0, statusCode=422, errorMessage=At least one non-numeric api Id was supplied in the apiIds array.}

Status: 500 - Internal Server Error

{timeStamp=20170120152253514, version=1.0, statusCode=500, errorMessage=An unknown error has occurred - authorising API Key}

Subaccounts

getSubAccounts

Get a list of all Sub Accounts.

Get a list of all the Sub Accounts owned by the Main Account.


/subaccounts

Usage and SDK Samples

curl -X GET -H "AUTHORIZATION: [[apiKey]]" "https://www.winsms.co.za/api/rest/v1/subaccounts"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.SubaccountsApi;

import java.io.File;
import java.util.*;

public class SubaccountsApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: APIKeyHeader
        ApiKeyAuth APIKeyHeader = (ApiKeyAuth) defaultClient.getAuthentication("APIKeyHeader");
        APIKeyHeader.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //APIKeyHeader.setApiKeyPrefix("Token");

        SubaccountsApi apiInstance = new SubaccountsApi();
        try {
            subAccountsResponse result = apiInstance.getSubAccounts();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling SubaccountsApi#getSubAccounts");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.SubaccountsApi;

public class SubaccountsApiExample {

    public static void main(String[] args) {
        SubaccountsApi apiInstance = new SubaccountsApi();
        try {
            subAccountsResponse result = apiInstance.getSubAccounts();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling SubaccountsApi#getSubAccounts");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: APIKeyHeader)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"AUTHORIZATION"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"AUTHORIZATION"];


SubaccountsApi *apiInstance = [[SubaccountsApi alloc] init];

// Get a list of all Sub Accounts.
[apiInstance getSubAccountsWithCompletionHandler: 
              ^(subAccountsResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var Winsms = require('winsms');
var defaultClient = Winsms.ApiClient.instance;

// Configure API key authorization: APIKeyHeader
var APIKeyHeader = defaultClient.authentications['APIKeyHeader'];
APIKeyHeader.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//APIKeyHeader.apiKeyPrefix['AUTHORIZATION'] = "Token"

var api = new Winsms.SubaccountsApi()

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getSubAccounts(callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getSubAccountsExample
    {
        public void main()
        {
            
            // Configure API key authorization: APIKeyHeader
            Configuration.Default.ApiKey.Add("AUTHORIZATION", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("AUTHORIZATION", "Bearer");

            var apiInstance = new SubaccountsApi();

            try
            {
                // Get a list of all Sub Accounts.
                subAccountsResponse result = apiInstance.getSubAccounts();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling SubaccountsApi.getSubAccounts: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: APIKeyHeader
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('AUTHORIZATION', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('AUTHORIZATION', 'Bearer');

$api_instance = new Swagger\Client\Api\SubaccountsApi();

try {
    $result = $api_instance->getSubAccounts();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SubaccountsApi->getSubAccounts: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::SubaccountsApi;

# Configure API key authorization: APIKeyHeader
$WWW::SwaggerClient::Configuration::api_key->{'AUTHORIZATION'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'AUTHORIZATION'} = "Bearer";

my $api_instance = WWW::SwaggerClient::SubaccountsApi->new();

eval { 
    my $result = $api_instance->getSubAccounts();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling SubaccountsApi->getSubAccounts: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: APIKeyHeader
swagger_client.configuration.api_key['AUTHORIZATION'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['AUTHORIZATION'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.SubaccountsApi()

try: 
    # Get a list of all Sub Accounts.
    api_response = api_instance.get_sub_accounts()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling SubaccountsApi->getSubAccounts: %s\n" % e)

Parameters

Responses

Status: 200 - OK

Status: 401 - Unauthorized

{timeStamp=20170120152253514, version=1.0, statusCode=401, errorMessage=The 'AUTHORIZATION' header was not found. Set the 'AUTHORIZATION' request header to your WinSMS API Key}

Status: 404 - Not found

{timeStamp=20170120152253514, version=1.0, statusCode=404, errorMessage=The resource requested does not exist. Please verify the path, spelling, and capitalisation}

Status: 405 - Method Not Allowed

{timeStamp=20170120152253514, version=1.0, statusCode=405, errorMessage=Request method should be set to 'GET', not 'PUT'.}

Status: 500 - Internal Server Error

{timeStamp=20170120152253514, version=1.0, statusCode=500, errorMessage=An unknown error has occurred - authorising API Key}