SMS to Phone Chrome Extension

June 20, 2012

Good news!

We’ve created our first plugin for Chrome using Hoiio API: SMS to Phone.

At times, you might have read an interesting article and would want to share the link with your friends. You could have fire up your email  client, paste the link and send to your friends. However, that is not awesome because your friends will not get your message immediately.

Hence, here comes SMS to Phone, a convenient Chrome extension that helps you share website links through SMS.

It’s very easy and convenient to use. Just follow these few steps to get started:

  1. Install the Chrome Extension
  2. Register a Hoiio Developer account
  3. Create an application in Hoiio
  4. Paste the app_id and access_token of your application into the Account Settings and save

  5. When you want to share a website, click on the extension icon (the blue icon) and share!

Additionally,  we shorten your link so that you can squeeze more message within a 160 char SMS :).

So, add this extension  to your chrome and try it out today!
Tags: , ,
Posted by:

Hoiio API showcase: BiakiCRM

March 24, 2012

Hey friends,

Let’s welcome our first Vietnamese company using Hoiio API: Biaki, with its product is BiakiCRM.

BiakiCRM is a cross platform solution on the cloud to help small businesses manage customers information and relationships, gather all vital information in a single click with no limitation on accessing devices and busines model.

It’s a complete CRM system with highly flexible user interface where customer can modify to fit the business nature of the company.

Desktop interface

vforce interface

Features that BiakiCRM provides include:

  • Manage customers and customer relationships.
  • E-Office: help users schedule the work and remind, notify users.
  • SMS and email marketing
  • Social network within the company
  • … and lot more features

Moreover, BiakiCRM  provides access to the system through mobile phone. With its iPhone app (Android version is coming soon), business manager can manage the system on the go which helps to boost the productivity of the business.

We are glad that Biaki integrated Hoiio SMS API to strengthen their product. The API is used for sms marketing, user verification, group sms, sms reminder …

Their product is mostly used in Vietnamese, but they also have an English version. So do check out their product at http://www.biaki.com.

Cheers =)

Tags:
Posted by:

Hoiio API Example: WeatherByPhone

February 17, 2012

Another simple yet interesting example was developed using Hoiio API.

This example let you check the weather of your location by using your mobile phone. It makes use of Yahoo weather API.

Application flow:

The app requires the WOEID code which is introduced by Yahoo to uniquely identify any location on Earth. To find the WOEID of your location, you can find by browser/search from the Yahoo weather homepage. The WOEID is in the URL for the forecast page for that city. For example, if you search for Singapore on the Weather home page, the forecast page for that city is http://weather.yahoo.com/singapore/central-singapore/singapore-1062617/. The WOEID is 1062617.

The response user will hear is “It is currently 28 degrees celsius and partly cloudy in Singapore“. The application will keep asking the user until he/she hangs up the phone.

Let’s look closer into the code:

  1. Global variables: we define all global variables like appId, accessToken,…
    $appId       = "[Your appId]";
    $accessToken = "[Your accessToken]";
    $server      = "https://secure.hoiio.com/open";
    $myUrl       = "[Your notify URL address]";
    
    1. The appId and accessToken are generated for you when you create an application in the developer portal
    2. The notify URL is the address that Hoiio will notify developer after each step to ask for the next step (or next building block)
  2. The controller: maintain the state of the call to do correct actions
    if ($_POST['call_state'] == "ringing") {
    	askZip();
    	return;
    }
    else if ($_POST['call_state'] == "ongoing") {
    	switch ($_POST['tag']) {
    		case "askZip":
    			checkDigitPressed();
    			break;
    		case "playMessage":
    			askZip();
    			break;
    	}
    }
    else if ($_POST['call_state'] == "ended") {
    	// Call has ended, can do anything here
    }
  3. The askZip() function: send a Gather API to ask for the WOEID codes
    $data = http_build_query(
    	 array(	"app_id" 		=> $GLOBALS['appId'],
    			"access_token" 	=> $GLOBALS['accessToken'],
    			"tag"		=> "askZip",
    			"session"	=> $_POST['session'],
    			"msg"		=> "Please enter your W-O-E-I-D code.",
    			"max_digits"	=> "9",
    			"notify_url" 	=> $GLOBALS['myUrl']));
    
    do_post_request($GLOBALS['server']."/ivr/middle/gather", $data);
    
  4. The checkDigitPressed() function:
    $zip = $_POST['digits'];
    // Checks the zip code
    if (strpos($zip, '*') !== false) {
    	playMessage("You have entered an invalid W-O-E-I-D code");
    }
    else {
    	// Get the forecast
    	$forecastStr = do_get_request("http://weather.yahooapis.com/forecastrss?w=" . $zip . "&u=c");
    
    	if (strpos($forecastStr, "City not found")) {
    		playMessage("You have entered an invalid W-O-E-I-D code");
    	} else {
    		// Extract the temperature info
    		$rss = new SimpleXMLElement($forecastStr);
    		$temp = $rss->channel->item->children('yweather', true)->condition->attributes()->temp;
    		$condition = $rss->channel->item->children('yweather', true)->condition->attributes()->text;
    		$location = $rss->channel->children('yweather', true)->location->attributes()->city;
    
    		playMessage("It is currently ". $temp ." degrees celsius and ". $condition ." in ". $location .".");
    	}
    }
    

    This function verifies the code then send the http request to Yahoo to get the weather information of that location. If the response is “City not found”, it asks again for the WOEID code.

  5. The playMessage() function: play the result to the user
    $data = http_build_query(
    	array(	"app_id" 		=> $GLOBALS['appId'],
    			"access_token" 	=> $GLOBALS['accessToken'],
    			"tag"			=> "playMessage",
    			"session"		=> $_POST['session'],
    			"msg"			=> $msg,
    			"notify_url" 	=> $GLOBALS['myUrl']));
    
    do_post_request($GLOBALS['server']."/ivr/middle/play", $data);
    

That’s it! It’s simple and straight forward and you can do it in less than 30 minutes.

Download

The source code you can download here.

Tags: , ,
Posted by: