APIs for the Internet of Things

Max Katz

Subscribe to Max Katz: eMailAlertsEmail Alerts
Get Max Katz via: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn

Related Topics: Cloud Computing, MySQL Journal, Internet of Things Journal

Blog Feed Post

Instant APIs for the 'Internet of Things' By @Apperyio | @ThingsExpo [#IoT]

Appery.io makes it very easy to build mobile apps with any API

How to Make an App Fast with Appery.io and Instant API

Instant API is a true API-as-a-Service which makes it easy and cost-effective to build an API. Instant API has simplified all of the key areas of an API’s lifecycle, covering API creation, hosting, management, discovery, monetization, and documentation.

For example, let’s say you have information and services or data and services you want to expose through an API that can be used internally for BYOD initiatives or externally by developers or your business partners. With the API deployed, you still don’t have a mobile app. That’s where the Appery.io platform comes in. Appery.io makes it very easy to build mobile apps with any API. Combine the Instant API exposed APIs with the Appery.io cloud-based development platform, and you get a fast way to build a complete solution and deploy the mobile app.

In this post, we are going to show you an example of how to do that, but first here’s the info for an upcoming webinar in which Appery.io and Instant API will demo this process in action.

An Example of How It’s Done
In the rest of this post we are going to show you an example of how to expose a relational database via REST API and then use Appery.io to build a mobile app with that API.

Getting started
The first thing is to sign up for Appery.io and Instant API accounts (if you already have an account you can skip to the next section)

  • Sign up for Appery.io Starter plan (free)
  • Sign up for Instant API (free)
    • If your account is not instantly activated, please email team@instantapi.co to get priority access

Creating an API with Instant API
The first step is to expose a database via REST API. Instant API makes it very easy to do this. We will first connect to a database and then define a REST API. That database we are going to use holds information about nutrition/energy drinks.

Connecting to a database

  1. From Instant API dashboard select API Creation > Backend Services
  2. Click Add Data Silo
  3. Select My SQL database
  4. Next enter the following information:
    • Name: nutrition
    • Address: http://mysql.demo.instantapi.co
    • Port: 3306
    • Username: iademo
    • Password: iademo
    • Database name: nutrition
  5. Click Done, and a quick connection test will be made, if successful your data silo configuration will be saved and ready for use.

Creating an API
Now that we have connected to a database we can create an API

  1. From the dashboard, select API Creation > API Call Mappings
  2. Click Add API Call
  3. Next enter the following information:
    1. URL end point enter: /product/{?name}
    2. Click on the data silo created in the previous step: my_info (that’s the data source which has a connection to our database)
    3. Command Type: select
    4. For the actual query Command set: select * from products where product_name like ‘%[[name:string]]%’
    5. Click Save to save this API and its mapping to the database
      • Should you want paging support, you can turn it on by selecting Paging support

Deploying the API
Now that we have created an API, the next step is to deploy the API.

  1. From the dashboard, select API Creation > Deploy API
  2. Click Deploy > Create New Version

The API is now deployed.

Testing the API
With the API deployed, we can run a quick test.

  1. From the dashboard, select API Creation > Documentation
  2. Select API tab (at the bottom)
  3. Click on the API end point, then click on Make API call
  4. For name enter: monster, click Continue. You should see a result with 14 records found. You can try another drink, such as red bull

To summarize, we connected to a relational database, created a REST API service that’s mapped to a SQL query, deployed and tested the service. With the REST API up and running, we are ready to build a mobile app that uses this API.

Building a mobile app with Appery.io
In this section we are going to show you how to build and publish a mobile app with the just created REST API

Creating a new app
The first step is to create the app

  1. From the Appery.io Apps tab, click Create new app.
  2. For app name enter: NutritionApp and click Create

Building UI to search for drinks

  1. Once the visual app builder loads, open Pages > startScreen.
  2. Using drag and drop visual app builder create the following UI:
    • Page header set in caption
    • Input component with placeholder set to Search
    • Button (inline option on)
    • List (with one item)

That’s all for the first page.

Testing the page
Testing the app is incredible easy. Simply click the Test button in the menu to launch the app in the browser. If you would like to test the app on a mobile device, expend the Test menu and click Public. You can now scan the QR code to launch the app on a mobile device.

Creating the drink details page

  1. Click Create new > Page. For page name enter: details and click Create
  2. Using drag and drop visual app builder create the following UI:
    • Delete caption – we will display the selected drink name there
    • Turn on the back button
    • There are two Collapsible components, both include a Label component
    • Optionally, you can collapse the Nutrition block (select the component root and set Collapsed to on)

We are done with the second page. Next we are going to work on defining data model in the app

Creating app model
Before we define REST API services in our app, we are going to create a model. The app model allows us to mimic the database design and will simply app development. For instance, we will be able to load all the data for a particular search and store it in the app.

  1. Inside Appery.io app builder, open Project > Model and Storage
  2. Inside the Model tab define the following objects:
    • Food (Object)
    • Food object has the following properties:
      • product_name (type: String)
      • ingredients (type: String)
      • notes (type: String)
    • FoodList (type: Array). This array will host a lost of Foods
      The result should look like this:
  3. As we will be storing the data in local storage, we need to create local storage variables. Switch to Storage tab
  4. Inside the Storage tab define the following objects:
    • foodList (type: FoodList)
    • selectedFood (type: Food)

We are done. We just defined the app model and are ready to define the REST API service.

Defining REST API
Let’s go back to Instant API and look at the service Curl command to help us define the service in Appery.io builder.

  1. From the dashboard, select API Creation > Documentation
  2. Click on the API end pointed we defined earlier (/product{?name})
  3. Click Make API Call
  4. Enter: Monster and click Continue
  5. You will see the response in the Response tab. Switch to Sample Code tab to see the Curl command that will help us define the service
  6. In Appery.io app builder, click Create New > Service
  7. For service name enter: NutritionInfo and click Create
  8. In service editor Settings tab enter the following values:
    • URL: https://api.instantapi.co/v1/product
  9. Switch to Request tab and enter the following values:
    • In Query String tab: name (leave Value blank)
    • Switch to Headers tab and create: apikey
    • We need to set the API key value. From Instant API dashboard select API Management > Dashboard > API Keys. Copy and the API key and set it as value for apikey header parameter
  10. We are ready to test the service. Switch to Test tab, enter Monster and click Test. You should get the service response (14 records)
  11. Click Import as Response to define the service response based on the response JSON.

We are done defining and testing the service.

Binding the service to the page

  1. Open startScreen and switch to DATA tab
  2. For datasource select Service > NutritionInfo, click Add
  3. Rename restservice1 to info_service
  4. Next we need to map the service input. Click Mapping for Before Send event
  5. Define the following mapping:
    servicemapping_input (1)
  6. Click Save and return
  7. Open Mapping for Success event
  8. Define the following mapping (check Storage option on the right side):
    • When the service is invoked we save the search result into local storage (the model we defined earlier)
  9. Click Save and return
  10. Once the data is in the model we want to display on the page. In Success event row, click Add > Mapping.
  11. Define the following mapping:
    • Note that mapping is done from the Storage to the page
  12. Click Save and return.

Just one more step before we can test the app.

Invoking the service

  1. Switch to DESIGN tab
  2. Select the button (Find) and open the Events tab
  3. Add the following action (button and event should already be selected):
    • mobilebutton_x > Click > Invoke service > nutrition_info > Save

Testing app
Click Test to launch the app in the browser. Enter monster for input and you should see the result displayed in a list

Displaying item details

All is left is to display drink details on the second page. First we need to know which item was clicked in the list. To do that we are going to add a small JavaScript snippet.

  1. Open startScreen > DATA > click second Mapping in Success event
  2. Click JS icon for the first connection (mobilelistitem_x)
  3. Enter the following code:
    element.on(“click”, function () {
    • This code adds a click action to each item and when the item is clicked we will store the item into local storage variable (we defined it earlier)
    • Apperyio.storage — is a wrapper on top of local storage API
  4. Click Save and then Save and return
  5. Switch to DESIGN tab
  6. Select the list item and open Events tab
  7. Add the following action (listitem and event should already be selected):
    • mobilelistitem_x > Click > Navigate to page >details > Save
  8. Open details page
  9. Select details in breadcrumbs
  10. Open Events tab
  11. Add the following action (note that we change the event from Load to Page show):
    • mobilebutton_x > Page show > Mapping
  12. Define the following mapping:
    • We are mapping from a value saved in local storage to the page
  13. Click Save and return

Testing the app

Click Test to test the final app in the browser

Publishing the app

Now that you are done with the app you can build a binary for iOS, Android or Windows Phone. To package the app for one of the platforms click the Export button:


Alternatively, you can publish the app as mobile web app that has a custom URL. To do this exit the app builder and go to Hosting section. You can us an appery.io domain or enter a custom domain name:


Instant API is an easy-to-use and cost-effective service for creating and managing APIs. Combine it with Appery.io development tools — and you get a high-productivity platform for creating enterprise mobile apps.

Learn More!
Sign up for our joint webinar for a live demo and Q&A:

How to Build and Deploy a Complete Mobile App with Appery.io and Instant API
Tuesday, Mar 10, 2015 11:00 AM – 12:00 PM PDT

Cloud, Big Data, and the 'Internet of Things'

Are you ready to put your data in the cloud?

What is the future of security in the cloud?

Does Docker quickly advance the development of an IoT application?

What are the implications of Moore's Law on Hadoop deployments?

Cloud Expo / @ThingsExpo 2015 New York
(June 9-11, 2015, at the Javits Center, Manhattan)

Cloud Expo / @ThingsExpo 2015 Silicon Valley
(November 3-5, 2015, at the Santa Clara Convention Center)

@ThingsExpo Silicon Valley 2014 Exhibit Floor was packed for three days!

Get all these questions and hundreds more like them answered at the 2015 Cloud Expo and @ThingsExpo June 9-11, 2015, at the Javits Center in New York City, and November 3-5, 2015, at the Santa Clara Convention Center in Santa Clara, California.

Our upcoming June 9-11, 2015, event in New York City will present a total of 10 simultaneous tracks (the largest conference content in the world) by an all-star faculty, over three days, plus the popular two-day "Cloud Computing Bootcamp" presented by Janakiram MSV, an analyst with the Gigaom Research analyst network where he covers the Cloud Services landscape.

Cloud and Big Data topics and tracks include: Enterprise Cloud AdoptionAPM & Cloud Computing | Hot TopicsCloud APIs & BusinessCloud Security | Mobility, and Big Data | Analytics.

@ThingsExpo content also tripled from a single track last year to three simultaneous (all sold-out) IoT tracks: Consumer IoTEnterprise IoT, and IoT Developer | WebRTC Convergence.

Our DevOps Summit content also doubled from a single track last June to two simultaneous tracks in November: "Dev" Developer Focus and "Ops" Operations Focus.

Please check back for daily updates as we are working with our distinguished faculty members to finalize new session abstracts. If you have any questions please contact us at events (at) sys-con.com. Last but not least we will announce our keynotes to be delivered by world-class speakers on the hottest topics!

Cloud Expo / @ThingsExpo Silicon Valley 2014 Exhibit Floor Day 3

The largest 'Internet of Things' event in the world has announced "sponsorship opportunities" and "call for papers."

The 1st International Internet of @ThingsExpo was launched this June at the Javits Center in New York City with over 6,000 delegates in attendance. The 2nd International Internet of @ThingsExpo took place November 4-6, 2014, at the Santa Clara Convention Center in Santa Clara, California, with an estimated 6,000 plus delegates attending over three days.

@ThingsExpo is co-located with 16th International Cloud Expo and will feature technical sessions from a rock star conference faculty and the leading IoT industry players in the world. In 2015, more than 200 companies will be present on the @ThingsExpo show floor, including global players and the hottest new technology pioneers.

Cloud Expo / @ThingsExpo New York 2014 registration desk at the Javits

Sponsorship and Exhibit Opportunities Are Now Available
Sponsors and exhibitors of Internet of @ThingsExpo will benefit from unmatched branding, profile building and lead generation opportunities through:

  • Featured on-site presentation and ongoing on-demand webcast exposure to a captive audience of industry decision-makers.
  • Showcase exhibition during our new extended dedicated expo hours
  • Breakout Session Priority scheduling for sponsors that have been guaranteed a 35-minute technical session
  • Online advertising in SYS-CON's i-Technology publications
  • Capitalize on our comprehensive marketing efforts leading up to the show with print mailings, e-newsletters and extensive online media coverage.
  • Unprecedented PR Coverage: Editorial coverage on IoT.sys-con.com, Tweets to our 75,000 plus followers, press releases sent on major wire services to over 500 combined analysts and press members who attended Internet of @ThingsExpo - making it the best-covered "Internet of Things" conference in the world

For more information on sponsorship, exhibit, and keynote opportunities contact Carmen Gonzalez by email at events (at) sys-con.com, or by phone 201 802-3021. Book both events for additional savings!

@ThingsExpo 2015 New York (June 9-11 in New York City)
@ThingsExpo 2015 Silicon Valley (November 3-5 in Santa Clara, CA)

@ThingsExpo New York 2014 Power Panel on SYS-CON.tv

World's Top 2nd Wave Cloud and IoT Players: 2014 Sponsors and Exhibitors
In 2014 roughly 12,000 (audited) delegates registered and participated in the world's largest 2nd wave Cloud and 'Internet of Things' event. Conference delegates met with over 150 of the world's leading Cloud and 'Internet of Things' technology pioneers that were among the sponsors and exhibitors, including:

Acision (Exhibitor), ActiveState (Silver), AgilePoint (Exhibitor), Ambernet (Exhibitor), Amplidata (Exhibitor), Apacer Memory America (Exhibitor), Appcore (Exhibitor), AppDynamics (Exhibitor), AppZero (Exhibitor), Aria Systems (Bronze), Automic (Gold), Avere Systems (Exhibitor), Axis Communications (Exhibitor), Basic6 (Exhibitor), Bitium (Exhibitor), BlueBox (Bronze), Brother Office (Bronze), BSQUARE  (Bronze), BUMI (Exhibitor), CA Technologies (Platinum), Calm.io (Bronze), CiRBA (Bronze), Cisco (Gold), Cloudant (Exhibitor), Cloudian (Bronze), CodeFutures (Bronze), Connect2.me (Exhibitor), Connected Data (Exhibitor), CrashPlan/Code42 (Exhibitor), Creative Business Solutions (Exhibitor), Cynny Italia (Exhibitor), Dasher Technologies (Exhibitor), DEAC Data Centers (Silver), Dell (Silver), Distrix (Exhibitor), Dyn (Bronze), e-SignLive by Silanis (Exhibitor), Edgecast Networks (Platinum), ElasticBox (Exhibitor), Endstream/Open Data Centers (Exhibitor),

ESRI (Bronze), Evident.io (Exhibitor), FireHost (Bronze), Gigamon (Silver), GoodData (Bronze), Gridstore (Exhibitor), Harbinger Group (Exhibitor), HP (DevOps Track Sponsor), IAPP (Exhibitor), IBM (Platinum), IDenticard (Exhibitor), Imperva (Exhibitor), IndependenceIT (Exhibitor), Infor (Platinum), InMage (Exhibitor), Innodisk (Exhibitor), ITinvolve (Silver), iwNetworks (Exhibitor), Ixia (Exhibitor), iXsystems (Exhibitor), Jelastic (Exhibitor), MangoApps (Exhibitor), Matrix.org (Silver), MetraTech (Bronze), Microsoft (Diamond), NaviSite (Silver), Net Access Corporation (Exhibitor), NuoDB (Bronze), NY Times (Exhibitor), Objectivity (Exhibitor), OpenCrowd (Exhibitor), Oracle (Platinum Plus), OutSystems (Bronze), Parasoft (Exhibitor), Peak10 (Exhibitor), Peer 1 Hosting (Exhibitor), Pluralsight (Exhibitor), PubNub (Exhibitor), QTS Data Centers (Bronze), Quantum (Exhibitor), Qubell (Platinum), r-evolutionapp (Exhibitor), RackWare (Exhibitor), Red Hat (Bronze), RingStor (e-Bulletin Sponsor), SAP (Gold), ScaleMP (Exhibitor), Seagate (Exhibitor), SendGrid (Exhibitor), Serena Software (Exhibitor), SherWeb (Exhibitor),

SimpleECM (Exhibitor), Smartvue (Exhibitor), SOA Software (Bronze), SOASTA CloudTest (Exhibitor), SoftLayer (Gold), SoftwareAG (Exhibitor), Solgenia (Exhibitor), SPAN Systems (Exhibitor), StackIQ (Exhibitor), Stateless Networks (Exhibitor), Stratogent (Exhibitor), Telecity (Exhibitor), Telehouse (Exhibitor), Telestax (Exhibitor), Transparent Cloud Computing Consortium (Exhibitor), Ulunsoft (Exhibitor), Utimaco (Exhibitor), VASCO Data Security (Bronze), Veeam (Exhibitor), Verizon (Platinum), VictorOps (Exhibitor), Virtustream (Power Panel Sponsor), Vormetric (Bronze), Will Jaya (Exhibitor), Windstream (Silver), WSM - Website Movers International (Exhibitor), Zentera (Exhibitor), Zerto (Exhibitor)

Secure Your VIP Pass to Attend @ThingsExpo New York 2015
@ThingsExpo announced a limited time FREE "Expo Plus" registration option. The onsite registration price of $600 will be set to 'free' for delegates who register before the end of this month.

To take advantage of this opportunity, attendees can use the special "coupon code" on the registration page and secure their "@ThingsExpo Plus" registration to attend all keynotes and general sessions, as well as a limited number of technical sessions each day of the show, in addition to full access to the expo floor and the @ThingsExpo hackathons throughout the week.

The registration page is located at the @ThingsExpo site here.

@ThingsExpo New York 2015 'Call for Papers' Now Open
The 3rd International Internet of @ThingsExpo, to be held June 9-11, 2015, at the Javits Center in New York City, New York, announces that its 'Call for Papers' is now open. The event will feature a world class, all-star faculty with the hottest IoT topics covered in three distinct tracks.

Track 1 - Consumer IoT and Wearables: Smart Appliances, Wearables, Smart Cars, Smartphones 2.0, Smart Travel, Personal Fitness, Health Care, Personalized Marketing, Customized Shopping, Personal Finance, The Digital Divide, Mobile Cash & Markets, Games & the IoT, The Future of Education, Virtual Reality

Track 2 - Enterprise IoT: The Business Case for IoT, Smart Grids, Smart Cities, Smart Transportation, The Smart Home, M2M, Authentication/Security, Wiring the IoT, The Internet of Everything, Digital Transformation of Enterprise IT, Agriculture, Transportation, Manufacturing, Local & State Government, Federal Government

Track 3 - IoT Developer | WebRTC Convergence: WebRTC, Eclipse Foundation, Cloud Foundry, Docker & Linux Containers, Node-Red, Open Source Hardware, Leveraging SOA, Multi-Cloud IoT, Evolving Standards, WebSockets, Security & Privacy Protocols, GPS & Proximity Services, Bluetooth/RFID/etc., XMPP, Nest Labs

@ThingsExpo billboard is viewed by more than 1.3 million motorists per week on Highway 101, in the heart of Silicon Valley

Help plant your flag in the fast-expanding business opportunity that is the Internet of Things: Submit your speaking proposal today here!

Download @ThingsExpo Newsletter Today ▸ Here

Chris Matthieu Named @ThingsExpo Tech Chair

Internet of @ThingsExpo named Chris Matthieu tech chair of Internet of @ThingsExpo 2014 Silicon Valley.

Chris Matthieu has two decades of telecom and web experience. He launched his Teleku cloud communications-as-a-service platform at eComm in 2010, which was acquired by Voxeo. Next he built an open source Node.JS PaaS called Nodester, which was acquired by AppFog. His latest startups include Twelephone. Leveraging HTML5 and WebRTC, Twelephone's BHAG (Big Hairy Audacious Goal) is to become the next generation telecom company running in the Web browser. Chris is currently co-founder and CTO of Octoblu.

Website: http://www.ThingsExpo.com
Twitter: http://www.Twitter.com/ThingsExpo

CEO Power Panel in Silicon Valley Examined Agility, Cloud, Big Data, and the 'Internet of Things'

Things are being built upon cloud foundations to transform organizations. This CEO Power Panel at 15th Cloud Expo, moderated by Roger Strukhoff, Cloud Expo and @ThingsExpo conference chair, addressed the big issues involving these technologies and, more important, the results they will achieve. Rodney Rogers, chairman and CEO of Virtustream; Brendan O'Brien, co-founder of Aria Systems, Bart Copeland, president and CEO of ActiveState Software; Jim Cowie, chief scientist at Dyn; Dave Wagstaff, VP and chief architect at BSQUARE Corporation; Seth Proctor, CTO of NuoDB, Inc.; and Andris Gailitis, CIO of DEAC, discussed how important public, private, and hybrid cloud are to the enterprise. How does one define Big Data? And how is the IoT tying all this together?

About SYS-CON Media & Events
SYS-CON Media (www.sys-con.com) has since 1994 been connecting technology companies and customers through a comprehensive content stream - featuring over forty focused subject areas, from Cloud Computing to Web Security - interwoven with market-leading full-scale conferences produced by SYS-CON Events. The company's internationally recognized brands include among others Cloud Expo® (CloudComputingExpo.com@CloudExpo), Big Data Expo(BigDataExpo.net@BigDataExpo), DevOps Summit (DevOpsSummit.sys-con.com@DevOpsSummit), Internet of @ThingsExpo (ThingsExpo.com@ThingsExpo) and Cloud Computing Bootcamp (CloudComputingBootcamp.com).

Cloud Expo®, Big Data Expo® and @ThingsExpo® are registered trademarks of Cloud Expo, Inc., a SYS-CON Events company.


Read the original blog entry...

More Stories By Max Katz

Max Katz heads Developer Relations for Appery.io, a cloud-based mobile app platform. He loves trying out new and cool REST APIs in mobile apps. Max is the author of two books “Practical RichFaces” (Apress 2008, 2011), DZone MVB (Most Valuable Blogger), and is a frequent speaker at developer conferences. You can find out what Max is up to on his blog: http://maxkatz.org and Twitter: @maxkatz.