Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs
src
IO.Swagger.sln
README.md
build.bat
build.sh
git_push.sh
mono_nunit_test.sh
winsms.sln

README.md

WinSMS - C# Library

  • API version: 1.0.0
  • SDK version: 1.0.0

For more information, please visit http://support.winsms.co.za/

DISCLAIMER:

The SDK is provided as a guideline to accessing the WinSMS API. The code is provided "as is" without any guarantees. Depending on your environment, the SDK may not work "out-of-the-box", therefore it is expected that you have sufficient technical knowledge and development skills to address any coding issues that may arise from using this SDK.

Frameworks supported

  • .NET 4.0 or later
  • Windows Phone 7.1 (Mango)

Dependencies

The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:

Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes

NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742

Installation

Run the following command to generate the DLL

  • [Mac/Linux] /bin/sh build.sh
  • [Windows] build.bat

Then include the DLL (under the bin folder) in the C# project, and use the namespaces:

using winsms.Api;
using winsms.Client;
using winsms.Model;

Packaging

A .nuspec is included with the project. You can follow the Nuget quickstart to create and publish packages.

This .nuspec uses placeholders from the .csproj, so build the .csproj directly:

nuget pack -Build -OutputDirectory out winsms.csproj

Then, publish to a local feed or other host and consume the new package via Nuget as usual.

Getting Started

using System;
using System.Diagnostics;
using winsms.Api;
using winsms.Client;
using winsms.Model;

namespace Example
{
    public class Example
    {
        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 );
            }

        }
    }
}

Documentation for API Endpoints

All URIs are relative to https://www.winsms.co.za/api/rest/v1

Class Method HTTP request Description
CreditsApi GetCreditBalance GET /credits/balance Get your current WinSMS credit balance
CreditsApi TransferCredits POST /credits/transfer Transfer credits between main and sub accounts.
ShortcodeApi GetShortCodeMessages GET /shortcode/incoming Get a list of incoming short/long code messages
SmsApi DeleteScheduledMessages POST /sms/scheduled/delete Delete scheduled SMS messages and refund credits
SmsApi GetIncomingMessages GET /sms/incoming Get a list of incoming SMS messages
SmsApi GetOptoutMessages GET /sms/incoming/optout Get a list of incoming opt-out SMS messages
SmsApi GetScheduledMessages GET /sms/scheduled Get a list of scheduled SMS messages
SmsApi SmsSend POST /sms/outgoing/send Send SMS messages
SmsApi SmsStatus POST /sms/outgoing/status Get SMS delivery statuses
SubaccountsApi GetSubAccounts GET /subaccounts Get a list of all Sub Accounts.

Documentation for Models

Documentation for Authorization

APIKeyHeader

  • Type: API key
  • API key parameter name: AUTHORIZATION
  • Location: HTTP header
You can’t perform that action at this time.