# C\#

**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.

[View on Github](https://github.com/clickatell/Clickatell-Csharp)

\
**Requirements**

* This script is built with .NETFramework 4.5.2
* Newtonsoft.JSON 9.0.1

&#x20;

**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](https://docs.clickatell.com/channels/sms-rest-api-platform-archived/sms-rest-api-request-parameters/).

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 ](https://github.com/ninjakitteh69/Clickatell-Csharp/issues)and we will take a look.
* Register a new account to send SMSs
* Log in to the platform for API Id, etc.
* [Request parameters](https://docs.clickatell.com/channels/sms-rest-api-platform-archived/sms-rest-api-request-parameters/)&#x20;
* [Send message ](https://docs.clickatell.com/channels/sms-rest-api-platform-archived/sms-rest-api-send-message-2/)info&#x20;
* [Error messages](https://docs.clickatell.com/channels/sms-rest-api-platform-archived/rest-api-error-message-descriptions/)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.clickatell.com/developers-api-reference/developers-archive/sdks/c.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
