C# Asynchronous
Add the API
In C# you should add the following to any .cs files that need to use the API.
using
ToucanText.Api.SenderApi;
Run the Code
To use the API create a new instance of the MessageSender();
object. Replace the user name and password with your Toucan API user name and password.
MessageSender messageSender =new
MessageSender("userName"
,"password"
);
Parameters
The ToucanText user name as provided
Your password as generated during sign up
Either an alphanumeric sender or an inbound number to use as the sender. Numbers should be specified in the format 441234567890 (note: + is not required)
The mobile number of the destination for the message. Numbers should be specified in the format 441234567890 (note: + is not required)
The message content
Get the Code
To send a message use the SendMessage();
method. The sender address can be an alphanumeric or numeric (depending on the country).
async public void
SubmitPage(String
c,String
message) { MessageSender messageSender =new
MessageSender("userName"
,"password"
);var
result =await
messageSender.SendMessageAsync("sourceAddress"
,"destinationAddress"
,"message"
); }async private void
button1_Click(object
sender, EventArgs e) { MessageSender messageSender =new
MessageSender("userName"
,"password"
);var
result =await
messageSender.SendMessageAsync("sourceAddress"
,"destinationAddress"
,"message"
); }
ToucanText API Requirements
Download the DLL wrapper file and add The DLL reference to your project.
Download ToucanText .Net API v2.3Target Application
The ToucanText .NET API requires a minimum of .NET Framework 4.5 or .NET Core 2.0 to operate.
If your application targets .NET Framework 4.6.1 or later, we recommend using the .NET Standard 2.0 assembly.
If your application targets .NET Core 2.0 or later, we recommend using the .NET Standard 2.0 assembly.
If your application requires portability to different operating systems such as Linux, then we recommend targeting .NET Core 2.0 or later and using the .NET Standard 2.0 assembly.