C#
ARCHIVED
Overview
Use Clickatell’s C# script library with our HTTP or REST messaging APIs to interact with the Clickatell SMS Gateway. The C# script below allows you to send one- or two-way SMS messages using Clickatell’s SMS Platform.
Requirements
This script is built with .NETFramework 4.5.2
Newtonsoft.JSON 9.0.1
Installation
Add Rest.cs and API.cs into your project from the Scripts folder
Add the Newtonsoft.JSON package to your project or the newtonsoft.json.dll file to your project
Using the class
You call the class by using:
private string response;private string api;Dictionary<string, string> Params = new Dictionary<string, string>();response = Api.SendSMS(api, Params);
Where:
api is your API key given to you on the platform
Params is a dictionary of the parameters to send with the SMS
Required parameters
to: the telephone number you are sending the SMS to including the country code (must start with ‘+’)
content: the SMS message that must be sent
A full list of parameters can be found here.
You can add the parameters to the dictionary by using the following code:
Params.Add("content", "this is a message");Params.Add("to", "+27745555555");
To add more than one number to send the message to multiple recipients, comma delimit the numbers:
Params.Add("to", "+27745555555,+27748888888,+27835555555");
Once the SMS is sent, it will return a response in the form of a JSON array. The JSON array will include an array of messages that each in turn contains:
An API Message ID
Whether the message was accepted or not (true/false)
The number it was sent to
An error message if applicable (see link below to error messages)
Read more:
Found a bug or missing a feature? Log it here and we will take a look.
Register a new account to send SMSs
Log in to the platform for API Id, etc.
Send message info
Last updated