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.
- This script is built with .NETFramework 4.5.2
- Newtonsoft.JSON 9.0.1
- 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:
- api is your API key given to you on the platform
- Params is a dictionary of the parameters to send with the SMS
- 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:
To add more than one number to send the message to multiple recipients, comma delimit the numbers:
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)
- 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.
- Request parameters
- Send message info
- Error messages
Submit a Comment
Ask the Community
Visit Stack Overflow to join our community of developers and find the answer you need
Contact our support team and one of our agents will be in touch with you to answer any questions you have