Return to Snippet

Revision: 6782
at June 13, 2008 23:41 by mountainash


Updated Code
javascript:var username = 'CLICKATELL-USERNAME'; var password = 'CLICKATELL-PASSWORD'; var api_id = 'CLICKATELL-APIID '; var recipient = prompt('To: (international mobile number)', '61412888999'); if (recipient) var message = prompt('Message: (over 160 characters will send multiple SMS)', '61412888999'); if (recipient && message) window.location.href = 'http://api.clickatell.com/http/sendmsg?user=' + username + '&password=' + password + '&api_id=' + api_id + '&to=' + recipient + '&text=' + message

Revision: 6781
at June 13, 2008 23:41 by mountainash


Initial Code
<p><a href="javascript:var username = 'CLICKATELL-USERNAME'; var password = 'CLICKATELL-PASSWORD'; var api_id = 'CLICKATELL-APIID '; var recipient = prompt('To: (international mobile number)', '61412888999'); if (recipient) var message = prompt('Message: (over 160 characters will send multiple SMS)', '61412888999'); if (recipient && message) window.location.href = 'http://api.clickatell.com/http/sendmsg?user=' + username + '&password=' + password + '&api_id=' + api_id + '&to=' + recipient + '&text=' + message">SMS Now!</a></p>

Initial URL
http://affiliates.clickatell.com/central/campaigns/redir.php?cid=29705

Initial Description
I made this simple JavaScript to save me time. I was sick of having to thumb-bash on a tiny keypad or login to the slow Clickatell site and use their clunky interface (nothing it simpler than 2 text boxes and an OK button).

You will need an HTTP API POST account with Clickatell's Bulk SMS Gateway. I choose them as they are reliable and they are under half the price of most local providers (and they have simple, well documented APIs)

This script is on 1 line intentionally. In your favourite browser create a new bookmark with this as the URL/address. Change the 'username', 'password' and 'api_id' values to your own. Then test it out. Easy.

NOTE: It's not that pretty but you get sent to the API output on submission. If you get a session ID it all went OK, if not you will get an error with a simple explanation of what went wrong.

Initial Title
Favlet: Clickatell SMS sender

Initial Tags
text, api

Initial Language
JavaScript