User Tools

Site Tools


red_api:c_sharp

C# API

The best way to use the Red Oxygen API from C# is to use the HTTP interface.

Example

public int SendSMS(String AccountID, String Email, String Password, String Recipient, String Message)
{
	WebClient Client = new WebClient();
	String RequestURL, RequestData;
 
	RequestURL = "http://www.redoxygen.net/sms.dll?Action=SendSMS";
 
	RequestData = "AccountId=" + AccountID
		+ "&Email=" + System.Web.HttpUtility.UrlEncode(Email)
		+ "&Password=" + System.Web.HttpUtility.UrlEncode(Password)
		+ "&Recipient=" + System.Web.HttpUtility.UrlEncode(Recipient)
		+ "&Message=" + System.Web.HttpUtility.UrlEncode(Message);
 
	byte[] PostData = Encoding.ASCII.GetBytes(RequestData);
	byte[] Response = Client.UploadData(RequestURL, PostData);
 
	String Result = Encoding.ASCII.GetString(Response);
	int ResultCode = System.Convert.ToInt32(Result.Substring(0, 4));
 
	return ResultCode;
}

Properties

Name Type Description Example
AccountId String This is your Red Oxygen Account ID, which uniquely identifies your account. CI00000001
Email String This is the email address of your Red Oxygen user account. It is also the address that will receive replies to the sent SMS. username@company.com
Password String This is the password of your Red Oxygen user account. secret
Recipient String The destination mobile numbers. Multiple recipients can be specified comma separated. 61409000000,61419718927,61419718972
Message String A single SMS has a maximum length of 160 characters. If the message is greater than 160 characters then multiple SMS will be sent as a concatenated SMS which will result in an additional charge for the additional messages. The maximum length of a message is 765 characters. If you exceed this limit only the first 765 characters of your message will be sent. Server 23 is offline.

For more details see the Red Oxygen API HTTP User Guide.

red_api/c_sharp.txt · Last modified: 2021/08/26 12:52 by wiki_admin