|
Interacting with our systems via the SMS web service :-
The first thing you need to do,
is REGISTER an Account on SMSGUYS ( This is
another product of Mobile Internet Gateway "MIG"
.. That contains all our API references)
TO Register .. Click
here :
http://www.smsguys.co.za/newuser.aspx
Under referal, please state that
you are using the WEBSERVICE and we will automatically
give you 10 FREE SMS credits to try out the system.
Wait for your confirmation SMS that you are
authorised to use the system before you can continue.
Please remember your Login Details.
Account Information
The
new API implementation is more holistic and boasts new
features to the user’s convenience. The user’s account
details can be interrogated from the following web
service:
http://www.smsguys.co.za/api/account.asmx
Account
Info: user_id
In
order to access the rest of the commands across the
entire system, the user will need their user_id,
it can be fetched from the following command if the user
does not know or have it already:
http://www.smsguys.co.za/api/account.asmx?op=UserId
The
above command will require your SMSGUYS username and
password. Please note that this command is compatible
with other platforms.
Account
Info: credits
To
QueryCredits
http://www.smsguys.co.za/api/account.asmx?op=AvailableCredits
Transmission
of Messages
In the
RemoteSMS implementation, the user had to pass textual
fields into the command section of the web service
method, now, we have catered for a more structured and
cleaner way to send messages through custom types; see
the command below:
http://www.smsguys.co.za/api/compose.asmx?op=StandardLengthText
The
above command accepts SOAP calls old and new. Below is a
C# sample code of how one would put a message together
before sending it:
//web
service object references
MobileCannonCompose.compose
Composer = new
MobileCannonCompose.compose();
//message
to send
MobileCannonCompose.Message
TextMessage = new
MobileCannonCompose.Message();
//if
this message is to be scheduled, determine what date
field is used
TextMessage.cutoffDatetime =
DateTime.Now.AddHours(6);
TextMessage.recipient = mobile;
TextMessage.user_message_id =
DateTime.Now.Ticks.ToString("X");
TextMessage.message = TextBoxMessage.Text;
//send
message immediatelly
Composer.StandardLengthText("user_id",
TextMessage);
The code
sample follows this process:
·
Creates the web service
object to be used
·
Creates a TextMessage
object that will hold all the details of the
message to be sent
·
A message cut-off Date and
Time is assigned (in this case, the message will be
considered expired 6 hours once it hits our queue should
it have problems e.g. bad mobile number and such),
please ensure that you have at least a
cut-of time of no less than
40min or the send
will fail.
·
A destination number is
assigned (note, international format *without*
the ‘+’ sign is required
or the send will fail)
·
Then the text message (no
more than 160 characters,
of the message will fail)
·
The Composer is then called
to send the message using the StandardLengthText()
method where you will pass your user_id and the message
object.
·
The StandardLengthText()
method returns a True if the message was successfully
sent or False if the message did not meet any of our
requirements.
We
have many more commands in the following service
addresses that can help you build a world-class SMS
system; contact management is included but you do not
have to use it, especially if you want to manage large
amount of contacts.
Message
Composition & Scheduling:
http://www.smsguys.co.za/api/compose.asmx
Account & Contacts Management:
http://www.smsguys.co.za/api/account.asmx
Inbox/Received Messages Control:
http://www.smsguys.co.za/api/inbox.asmx
Sent
Messages Control:
http://www.smsguys.co.za/api/sent.asmx
Please
do not hesitate to contact us if you need help
integrating these web services to your private
environment.
|