Razer Megasoma Review

Razer Megasoma is a hybrid of a hard and a soft mouse mat; If you love the softness of a soft mat but want to have the speed of a hard mat, Razer Megasoma delivers (this is debatable and I guess more like a personal preference). Razer Megasoma sits somewhere in between, combining the best [...]

SMSDiscount Web API code







by Michael Aulia on 16 October, 2007

in Technology



How does the SMSDiscount Web API works? If you have an SMSDiscount account (see my SMSDiscount review here), you can create your own web page that can send SMSes using your SMSDiscount account.

I’ve created a simple html file that is very useful for sending a quick SMS to your "top" contacts (basically the people whom you send SMSes the most). You just need to upload this html to a folder in your web hosting/server, and then point your browser to this file to start sending SMSes with ease.

Screenshot:

smsdiscountapi 760942 SMSDiscount Web API code

What my script does:

  • It will display your list of contacts (you have to edit this in the file)
  • You select 1 contact and type your SMS message.
  • The script will show the number of characters (make sure your message is no more than 160 chars!)
  • Click send, and it will pop-up the status of the message you just sent.

Download the file index.html (right click -> save as) : SMSDiscount API sample code

How to use the file (IMPORTANT! PLEASE READ):

  • Open the index.html file in your text editor
  • There are lines like these on the middle of the script

input name="to" value="#########" checked="checked" type="radio">Your Contact Name input name="to" value="#########" type="radio">Your Another Contact Name input name="to" value="#########" type="radio">More of Another Contact Name

Edit them! The value should be a contact’s full mobile number (with country codes, etc). Change "Your Contact Name" to your contact’s name. You can add these lines as many as you want – try to keep it short though :) (or remove the excess lines) The "checked" meaning that this contact will be the default selected (can only be 1 "checked" contact)

  • At the end of the script, find these lines:

 

input name="username" value="YOUR_SMSDISCOUNT_USERNAME" type="hidden"> input name="password" value="YOUR_SMSDISCOUNT_PASSWORD" type="hidden"> input name="from" value="YOUR MOBILE NUMBER" type="hidden">

Modify the values to match your accounts at SMSDiscount.

VERY VERY IMPORTANT: This script will display your username/password on the browser and YES, people can see them if they view the HTML source code from the browser. What you need to do, is password protect your folder!! (if you are hosting, there should be a feature to password protect a folder in the control panel)

  • So, after you modify them, upload the index.html to your web server (say at http://myownserver.com/smsdiscount/index.html)
  • Password protect the smsdiscount folder with your own so other people can’t access this script
  • Run the script on your browser by typing the URL: http://myownserver.com/smsdiscount/
  • It should prompt your with username/password (if not, meaning you haven’t successfully password protected your folder!!)

Done!

Please note that this is as simple as it can be. If you want address books, etc, then I’m afraid this is not intended for that. Use your SMSDiscount desktop application :) If you know a bit of HTML, you may want to make the page prettier, but I can’t be bothered – this is as quick as it can, even if you only have a dial-up connection :)

Also, this script doesn’t show you how many credits you have left, so make sure you check your credits yourselves (from the desktop application or from www.smsdiscount.com) Happy SMS-ing :)

Bookmark and Share



Subscribe Now

If you enjoyed this post, feel free to subscribe to be notified of new posts at Craving Tech!

{ 8 comments… read them below or add one }

John Restrad 16 October, 2007 at 8:22 pm

Thank you very much.

I will try to do something in PHP, so the user/pass won’t be visible :P

Reply to this comment

Lyon 17 October, 2007 at 3:04 pm

You’re welcome to share the PHP code here so other people can benefit from it too :)

Reply to this comment

Jay 27 October, 2007 at 7:00 am

Hi Lyon..
Is there any way I can contact you?

Reply to this comment

Lyon 28 October, 2007 at 5:41 pm

Hey Jay, please use the Contact Me button on the navigational (I’ve just added in.. didn’t want to reveal my email address here to avoid those nasty spammer scripts!)

Reply to this comment

Olli 25 January, 2008 at 5:11 am

No address books, thats clear, but is it possible to make one field to input a phone number which is not in the list?

Reply to this comment

Olli 17 September, 2008 at 1:29 am

A proposal: pls edit this code so that it connects two phones instead of sendins sms between them!

Reply to this comment

Michael Aulia 17 September, 2008 at 9:58 pm

Hi Olli,
Sorry it’s been a while that I get back to this post and it’s great to see you back here after half a year! lol

I don’t use SMSdiscount anymore (no more long distance relationships) so I don’t think I’ll be updating the code anytime soon..

Reply to this comment

EverythingUwant 25 February, 2009 at 8:25 am

Hi all. Who want to buy a SMSDiscount accounts with credit. I have some SMSDiscount accounts and I don’t use anymore. I sell with credit. See the price list below

Price List:
Account with 15euro = you pay 13euro
Account with 30euro = you pay 25euro
account with 45euro = you pay 35euro
Account with 60euro = you pay 50euro

REMEMBER
If you buy credit from SMSDiscount you will be charge for ”Handling Fee” and ”19% VAT”. For example: If you want 10euro for your account you will pay 12.61euro with all charges. So make the difference

To buy or if you have a question you can contact me on everythinguwant@live.com

Reply to this comment

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CommentLuv Enabled

Previous post:

Next post:



ss_blog_claim=90a03beb48f2cae080e36591e278f2e0