Service: SSMSService

Help

 

Description

This web service provides the following operations:

  • Sending bulkSMS messages
  • Sending MultiSMS messages
  • Retrieving Reports
  • Observing the current quota
  • Monitoring the Connection status

 

HowTo

To use this web service you have to login to the system and get the SessionKey which is required by every function. Also you should logoff when the session is no longer needed.

Example:

if (Login('un','123',Sk,FN,UID)) then

begin

GetUserBalanceQuota(SK);

Logoff(SK);

end;

Operations

Name

Parameters

Returns

Functionality

Login

Type

Name

Direction

Description

WideString

UserName

IN

The UserName of the user trying to login

WideString

UserPassword

IN

The Password of the user trying to login

WideString

SessionKey

OUT

The SessionKey is required by other functions and is returned by the system after authenticating the user.

WideString

FullName

OUT

The Full name of the current authenticated user; it is returned by the system

LongInt

UserID

OUT

The UserID of current authenticated user; it is returned by the system

Boolean:

true: when authentication succeeds

false: when authentication fails

This function is required before executing any other function to retrieve the SessionKey. If the username and password were correct and the system authenticate them successfully, the function will return true and will return the SessionKey, FullName and UserID of the user, otherwise, it returns false.

 

Logoff

Type

Name

Direction

Description

WideString

SessionKey

IN

This SessionKey is generated by the system and returned when login is performed

Boolean

True: logoff succeeds

False: logoff fails

It's recommended that this function is called after the session is no longer needed.

 

SendSMSToPhones

Type

Name

Direction

Description

WideString

PhoneList

IN

Phone numbers to which the sms message will be sent. Phone numbers are separated by semi colon, e.g. "0555555555;05555555555;056666666"

WideString

MsgText

IN

The text of the message to be sent.

WideString

NickName

IN

The nick name of sender of the messages to be sent

WideString

Param2

IN

This parameter is customizable and is set for all messages sent by each call to this function so it can represent the department number and will be displayed in the report.

WideString

Param3

IN

This parameter is customizable and is set for all messages sent by each call to this function. For example, it can represent the employee number and will be displayed in the report.

Integer

EngAr

IN

If the message text has only Latin characters then this parameter should be 0 if it contains Arabic characters then this parameter should be 1.

WideString

SessionKey

IN

This SessionKey is generated by the system and returned when login is performed

Boolean

True: Sending is in progress.

False: Sending fail

This function sends bulk messages to the provided phone numbers with the MsgText as the messages text and NickName as the Nick name of the sender

This function assigns the values of param2 and param3 to all messages sent by each call. So the user can differentiate between messages sent by different calls.

 

SendMultiSMS

Type

Name

Direction

Description

TSMSMessageList

SMSMessages

IN

list of TsmsMessage objects

WideString

SessionKey

IN

This SessionKey is generated by the system and returned when login is performed

Boolean

True: Sending is in progress.

False: Sending fail

This function sends multi sms messages passed to it. Each message is encapsulate into an object of type TSMSMessage and grouped in a list.

 

STCLinkStatus

Type

Name

Direction

Description

WideString

SessionKey

IN

This SessionKey is generated by the system and returned when login is performed

Boolean

True: The Link is OK

False: The Link is disconnected

This function returns the status of the STC Link. if it is connected it returns true, otherwise, returns false

 

GetUserBalanceQuota

Type

Name

Direction

Description

WideString

SessionKey

IN

This SessionKey is generated by the system and returned when login is performed

Integer

This function returns the Current Quota of the user, otherwise it returns -1

 

ViewReporting

Type

Name

Direction

Description

Integer

SearchType

IN

If SearchType is 0 then it will ignore the time limits otherwise, the reports will be limited to the periodic specified between FromDT and TODT

TDateTimeR

FromDT

IN

the lower limit of the period to which the report will be limited

TDateTimeR

ToDT

IN

the upper limit of the period to which the report will be limited

Integer

LimFrom

IN

the lower limit of the records which the report will contain

Integer

LimTo

IN

the Upper limit of the records which the report will contain

WideString

SessionKey

IN

This SessionKey is generated by the system and returned when login is performed

TReportR

For more information about TReportR click on the link.

This function return report information about the user with this session key

This information could be periodic or at any time and can be defragmented to be returned as segments as from 1 to 10 then from 11 to 20 and so.

the return value is of type TReportR

Otherwise, nil or null is returned.

 

ViewDetails

Type

Name

Direction

Description

Integer

ClientID

IN

This Id recognizes the messages sent by the same sending process or in other words, sent by one call either by SendSMSToPhones or by SendMultiSMS

Integer

Direction

IN

If direction=1 then sent messages only else if direction=2 then received messages only.

Integer

MsgRef

IN

Not applicable for the current version (Ignorable)

Integer

LimFrom

IN

the lower limit of the records which the report will contain

Integer

LimTo

IN

the Upper limit of the records which the report will contain

WideString

SessionKey

IN

This SessionKey is generated by the system and returned when login is performed

Integer

RecCount

Out

Number of records is passed through this parameter

TReportDetailsR

it returns a list of TReportRecordDetR Objects indexed by Message ID

For more information about TReportRecordDetR click on the link.

This function gives more details about

sending transaction which has the specified client id

Returned records can be defragmented to be returned as segments as from 1 to 10 then from 11 to 20 and so.

 

 

TSMSMessage

class


Attributes

Name

Type

Description

MsgText

WideString

The text of the message to be sent.

NickName

WideString

The nick name of sender of the messages to be sent

Param2

WideString

This parameter is customizable. For example, it can represent the department number and will be displayed in the report.

Param3

WideString

This parameter is customizable. For Example, it can represent the employee number and will be displayed in the report.

EngAr

Integer

If the message text has only Latin characters then this parameter should be 0 if it contains Arabic characters then this parameter should be 1.

Phone

WideString

phone number to which the sms message will be sent

 

TDateTimeR

class


Attributes

Name

Type

Description

Year

Integer

Format  [YYYY],2005,2004

Month

Integer

Format: [nn],[1-12]

Day

Integer

Format: [dd] [1-31]

Hour

Integer

Format: [hh] [0-23]

Minute

Integer

Format [mm] [0-60]

 

TReportR

class


Attributes

Name

Type

Description

ReportHeaderR

TReportHeaderR

General Information about the user trying to Generate the report

ReportTableR

TReportTableR

List of TReportRecordR objects indexed by message id

RecordsCount

Integer

Number of Records returned in the Table.

 

TReportHeaderR

class


Attributes

Name

Type

Description

UserID

Integer

User ID of the user trying to generate report

UserName

WideString

User Name of the user trying to generate report

UserPhone

WideString

The phone number of the user trying to generate report

MemberSince

TDateTimeR

Not Activated

RegisteredCredit

Integer

The original quota when the user registered

CreditLeft

Integer

The current balance the user has

LastAcctUpd

TDateTimeR

Not Activated

Email

WideString

email of the user if applied

AutoReport

Integer

Not Activated

TReportRecordR

class


Attributes

Name

Type

Description

Phone

WideString

Sender or user's phone number

MsgID

Integer

Message id of the current sms message

MsgText

WideString

the message text  of the sms message

Receiver

WideString

List of receivers according to the Parma2 and param3 values

MsgDateTime

TDateTimeR

Sending Date time

DividedInto

Integer

No of messages this sms message have

Total

Integer

No of messages should be sent

ActualSent

Integer

No of messages sent successfully

UserID

Integer

User id of the sender

ClientID

Integer

Client ID that identifies the send transaction

Direction

Integer

Is it Sent[1] or Received[2]

MsgRef

Integer

Reference of the message that identifies the message among other messages in the same transaction

RecordsCount

Integer

Number of Records

ProviderID

Integer

not applicable

 

TReportRecordDetR

class


Attributes

Name

Type

Description

MsgID

Integer

Message ID of the SMS message

Group

WideString

Name of the group or Department  related to param2

Member

WideString

Name of the Member of the Group or employee of the department related to param3

Phone

WideString

If the message was sent to numbers then they will be in this parameter

Status

WideString

P="Pending" , E="Fail with error" , S="Success" , O="OK",  F="Message Centre Queue Full"

Example:

Delphi:

procedure Test(Sender: TObject);                                                                                                                                                                                                                                                       

 var

   SMSService:ISSMSService;                                                                                                                                                                                                                                                            

   SK,FN:WideString;                                                                                                                                                                                                                                                                                                          

   UID:Integer;

begin

      SMSService:=GetISSMSService();

      if SMSService.Login('UserName','PWD',SK,FN,UID) then begin

          SMSService.SendSMSToPhones('05xxxxxxxx;05xxxxxxxx,'TestDelphi','TestSms','','',0,SK);

          SMSService.Logoff(SK);

     end;

end;

C# :

private void Test(object sender, System.EventArgs e)

{

  ISSMSServiceservice SMSService=new ISSMSServiceservice();

 string SK="",FN="";

 int UID=0;

 if (SMSService.Login("UserName","PWD",ref SK,ref FN,ref UID))

  {

    SMSService.SendSMSToPhones("05xxxxxxxx;05xxxxxxxx","TestC#","TestSMS","","",0,SK);

    SMSService.Logoff(SK);

  }  

}