This add-on is operated by Glu IO PTY LTD
Easy SMS messaging
Blower.io SMS
Last updated August 26, 2023
Table of Contents
Blower.io is an add-on for providing simple SMS messaging.
Adding SMS functionality to an application allows you to do account verification, offline alerting, send promotional offers, or any number of other possibilities simply by sending a message to both tradition mobile phones and smartphones.
Blower.io is accessible via a REST API and has easy integration options for any language and framework. Examples have been included for Node.js, Ruby, Python, and PHP.
Provisioning the add-on
Blower.io can be attached to a Heroku application via the CLI:
A list of all plans available can be found here.
$ heroku addons:create blowerio
-----> Adding blowerio to sharp-mountain-4005... done, v18 (free)
Once Blower.io has been added a BLOWERIO_URL
setting will be available in the app configuration and will contain the canonical URL used to access the newly provisioned Blower.io service instance. This can be confirmed using the heroku config:get
command.
$ heroku config:get BLOWERIO_URL
http://user:pass@api.blower.io/
After installing Blower.io the application should be configured to fully integrate with the add-on.
Local setup
Environment setup
After provisioning the add-on it’s necessary to locally replicate the config vars so your development environment can operate against the service.
Though less portable it’s also possible to set local environment variables using export BLOWERIO_URL=url
.
Use the Heroku Local command-line tool to configure, run and manage process types specified in your app’s Procfile. Heroku Local reads configuration variables from a .env
file. To view all of your app’s config vars, type heroku config
. Use the following command to add the BLOWERIO_URL value retrieved from heroku config to add to your .env
file.
$ heroku config -s | grep BLOWERIO_URL >> .env
$ more .env
Credentials and other sensitive configuration values should not be committed to source-control. In Git exclude the .env file with: echo .env >> .gitignore
.
For more information, see the Heroku Local article.
Using with Node.js
We’ve built a Node.js example app, the SMSatron: or View Source code
In Node.js we’ve used the Request as a HTTP client, so you’ll need to add it to your package.json
either manually or using the npm
command:
npm install request --save
Then from within your application you can send an SMS by:
var request = require('request'),
var countryCode = '+61',
mobileNumber = '422123456',
message = 'Hello from Blower.io';
request.post({
headers: {
'content-type' : 'application/x-www-form-urlencoded',
'Accepts': 'application/json'
},
url: process.env.BLOWERIO_URL + '/messages',
form: {
to: countryCode + mobileNumber,
message: message
}
}, function(error, response, body){
if (!error && response.statusCode == 201) {
console.log('Message sent!')
} else {
var apiResult = JSON.parse(body)
console.log('Error was: ' + apiResult.message)
}
})
Using with Ruby
Ruby applications will need to add the following entry into their Gemfile
specifying the Rest Client client library.
gem 'rest-client'
Update application dependencies with bundler.
$ bundle install
Then from within your application you can send an SMS by:
blowerio = RestClient::Resource.new(ENV['BLOWERIO_URL'])
blowerio['/messages'].post :to => '+61422123456', :message => 'Hello from Blower.io'
Using with Python
In Python we recommend using the Requests library. The send a messaging using Blower.io with Requests do the following:
import os
import requests
requests.post(os.environ['BLOWERIO_URL'] + '/messages', data={'to': '+61422123456', 'message': 'Hello from Blower.io'})
Using with PHP
The PHP example below uses the built-in support for cURL to POST a message to the API:
$url = $_ENV["BLOWERIO_URL"] . "/messages";
$data = array('to' => '+61422123456', 'message' => 'Hello from Blower.io');
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
Dashboard
The Blower.io dashboard allows you to see your current and historical usage.
The dashboard can be accessed via the CLI:
$ heroku addons:open blowerio
Opening blowerio for sharp-mountain-4005…
or by visiting the Heroku Dashboard and selecting the application in question. Select Blower.io from the Add-ons menu.
Receiving Messages
For plans that include the ability to receive inbound messages you’ll need to chose a dedicated number from the Dashboard and then provide a URL for us to POST
a webhook to whenever we receive a message to your number. The URL provided will receive a POST
request for each message we receive, with a JSON payload of the format:
{
"event": "message-received",
"to": "+61422123456",
"from": "+61488987654",
"body": "Hi there!"
}
Receiving Delivery Statuses
For plans that include the ability to receive delivery status updates you’ll need to chose a dedicated number from the Dashboard and then provide a URL for us to POST
a webhook to whenever we receive a change in status for a message you’ve sent. The URL provided will receive a POST
request for each message we receive, with a JSON payload of the format:
{
"event": "status-change",
"from": "+61488987654
"to": "+61422123456",
"status": "delivered",
"body": "Hi there!"
}
Migrating between plans
Application owners should carefully manage the migration timing to ensure proper application function during the migration process.
Use the heroku addons:upgrade
command to migrate to a new plan.
$ heroku addons:upgrade blowerio:smallbiz
-----> Upgrading blowerio:smallbiz to sharp-mountain-4005... done, v18 ($49/mo)
Your plan has been updated to: blowerio:smallbiz
Removing the add-on
Blower.io can be removed via the CLI.
This will destroy all associated data and cannot be undone!
$ heroku addons:destroy blowerio
-----> Removing blowerio from sharp-mountain-4005... done, v20 (free)
Supported Countries/Regions
Currently you are able to send SMS messages to the following countries:
North America
- Aruba
- Belize
- Costa Rica
- El Salvador
- Guadeloupe
- Guatemala
- Haiti
- Honduras
- Martinique
- Mexico
- Nicaragua
- Panama
South America
- Argentina
- Bolivia
- Brazil
- Chile
- Colombia
- Falkland Islands
- French Guiana
- Guyana
- Paraguay
- Peru
- Suriname
- Uruguay
- Venezuela
Europe
- Aland Islands
- Armenia
- Austria
- Belarus
- Belgium
- Bosnia and Herzegovina
- Bulgaria
- Croatia
- Cyprus
- Czech Republic
- Denmark
- Estonia
- Faroe Islands
- Finland/Aland Islands
- France
- Germany
- Gibraltar
- Greece
- Greenland
- Guernsey
- Hungary
- Iceland
- Ireland
- Isle of Man
- Italy
- Jersey
- Latvia
- Liechtenstein
- Lithuania
- Luxembourg
- Macedonia
- Malta
- Monaco
- Montenegro
- Netherlands
- Norway
- Poland
- Portugal
- Romania
- San Marino
- Serbia
- Slovakia
- Slovenia
- Spain
- Sweden
- Switzerland
- Ukraine
- United Kingdom
Asia
- Afghanistan
- Azerbaijan
- Bangladesh
- Brunei
- Cambodia
- China
- Georgia
- Hong Kong
- India
- Indonesia
- Japan
- Kazakhstan
- Korea Republic of
- Kyrgyzstan
- Laos PDR
- Macau
- Malaysia
- Maldives
- Mongolia
- Nepal
- Pakistan
- Philippines
- Russia/Kazakhstan
- Singapore
- Sri Lanka
- Taiwan
- Tajikistan
- Thailand
- Timor-Leste
- Uzbekistan
- Vietnam
Oceania
- Australia/Cocos/Christmas Island
- Fiji
- Nauru
- New Caledonia
- New Zealand
- Papua New Guinea
- Samoa
- Tonga
Africa & Middle East
- Algeria
- Angola
- Bahrain
- Benin
- Botswana
- Burkina Faso
- Burundi
- Cameroon
- Cape Verde
- Central Africa
- Chad
- Comoros
- Congo
- Djibouti
- Egypt
- Equatorial Guinea
- Ethiopia
- Gabon
- Gambia
- Ghana
- Guinea
- Iran
- Iraq
- Israel
- Ivory Coast
- Jordan
- Kenya
- Kuwait
- Lebanon
- Lesotho
- Liberia
- Libya
- Madagascar
- Malawi
- Mali
- Mauritania
- Mauritius
- Morocco/Western Sahara
- Mozambique
- Namibia
- Niger
- Nigeria
- Oman
- Palestinian Territory
- Qatar
- Rwanda
- Sao Tome and Principe
- Saudi Arabia
- Senegal
- Seychelles
- South Africa
- Sudan
- Swaziland
- Syria
- Tanzania
- Turkey
- Uganda
- United Arab Emirates
- Yemen
- Zambia
- Zimbabwe
Rate limits
New accounts temporarily have a pro-rata rate limit applied to them to prevent abuse of the service by spammers, where the monthly limit is apportioned on a daily basis. Once a credible sending history has been established customers are free to utilize the full account limit intra-month.
Message size limits
SMS messages containing only ASCII characters have a maximum size of 160 characters. Any message containing one or more Unicode characters has a maximum size on 70 characters.
Support
All Blower.io support and runtime issues should be submitted via one of the Heroku Support channels. Any non-support related issues or product feedback is welcome at support@blower.io.