Вы находитесь на странице: 1из 3

.

NET APPLICATION PROGRAMMING INTERFACE


I INTRODUCTION This document describes the .NET api for communicating with the SMSROAMING server to send SMS. The core of this API is a .NET Assembly called SmsRoaming.dll. The API is pretty simple to use.You just need to add the assembly to your project and use.This API has been compiled with the .NET framework 2.0 ,to provide backwards compatibility.This Assembly can be used indifferently from C#,VB.NET or C++/CLI. Any IDE supporting .NET applications design for the .NET platform 2.0 upwards can be used(Visual Studio 2005 upwards,Sharpdevelop,etc...)

II USAGE II -1 ADDING THE .NET ASSEMBLY TO YOUR PROJECT Supposing you've created (or already have an existing) .NET project created in an IDE of your choice in the IDE of your choice,right click on the project and select Add reference ... then select the SmsRoaming.dll from the location where you stored it on your computer. II 2 USING THE LIBRARY

The class library exports one single public class called SmsRoamingAPI The class contains three public functions : public string CheckBalance(string username,string password); This function will check the balance in an account ,given the username and the password. Parameters: username (string). Account username password(string) .Account password return value: A string containing an error message if the call failed or the account balance details if it succeeds. public SmsResult SendSms(string username,string password,string cntrycode, string phoneno,string message); This function sends a message (without specifying the SenderID). Parameters: username(string) .Account username password(string) .Account password cntrycode(string). Country code of the recipient(eg. 001 for USA) phoneno(string) . Phone number of the recipient(e.g 8574333455) message(string) . Message to be delivered to the recipient return value: The function returns an Enum describing the result of the operation called SmsResult. SmsResult is declared in the SMSRoaMing public namespace inside the SmsRoaming Assembly and has the following declaration: public enum SmsResult { ConnError,//Connection Error MsgSent, // Message Successfully sent InvalidUserOrPass, //Invalid username or password InsuffBalance //Insufficient balance };

public string SendSms(string username,string password,string cntrycode, string phoneno,string message,string sender); This function is exactly as the one above ,except you can specify the sender id( the sender(string) parameter). III- Sample For developers wanting to find out how to use the API ,please check out the C# sample application called SmsRoamingAPITest bundled with the API. The sample can directly be ported to VB.net or C++/CLI.

Вам также может понравиться