Message-ID: <534302385.15721.1614957821857.JavaMail.confluence@wiki> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_15720_641443290.1614957821857" ------=_Part_15720_641443290.1614957821857 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
Our API wrappers offer you simplicity with the greatest flexibility. Thi= s document describes the C# wrapper library, which makes it really easy to = use our most feature-rich API in your C# code through simple function calls= .
To send an SMS with our C# wrapper, download and unzip the wrapper from&= nbsp;here= , then copy the RestClient.cs or the DLL RestClien= t.dll into your project folder. You must use the RestClient assemb= ly in your C# code e.g:
using RestAPI;=20
Now put the following code somewhere in a C# file and execute it to send= an SMS =E2=80=93 don't forget to substitute your own API username and pass= word and a real mobile number to send to!
using System; using RestAPI; using System.Collections; namespace ExampleRestAPI { =09class Example { =09=09static void Main(string[] args) { =09=09=09RestClient tmClient; =09=09=09tmClient =3D new RestClient("myAPIusername", "myAPI= password",RestClient.ENV_PRODUCTION); =09=09=09try { =09=09=09=09Hashtable result =3D tmClient.sendSMS("My message", &= quot;447000000000", "Sender", 72, "", ""= , null); =09=09=09=09Console.WriteLine("Used {0} Credits, ID:{1}, Status: {2}&q= uot;,result["credits_used"], =09=09=09=09result["message_id"], result["status"]); =09=09=09} =09=09=09catch (RestClientException e) { =09=09=09=09Console.WriteLine(e.Message); =09=09=09=09foreach (DictionaryEntry de in tmClient.getLastErrors()) =09=09=09=09=09Console.WriteLine("Error {0}: {1}", de.Key, de.Val= ue); =09=09=09} =09=09=09Console.WriteLine(); =09=09=09Console.Write("Press ENTER to continue"); =09=09=09Console.ReadLine(); =09=09} =09} }=20
You can find your API username and password (which may be different to y= our web interface username/password) via your account: https://messagebox.textmarketer.co.uk/#!accountsettings/=
If you don't have an account, you can set one up for free at www.textmarketer.co.uk.
You must know!
=20 =20Our example code is an illustra= tion of how you might integrate with our systems and is not certified for p= roduction environments. You are responsible for testing and QA.