Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

CHAPTER 4: JavaScript and APIs > Creating an API

Creating an API

When creating an API it's important to think how you're going to use it. For our app, Grandview Ave, I use it for two things, simplifying application design for multiple devices and to publish data to multiple web sites and apps. Let's list these below.

Device-Centric Usage

  • Mobile iPad site
  • Mobile iPhone site
  • Other mobile site (Android and Blackberry)
  • Native iPhone app
  • Native iPad app
  • Native Android app

Data-Centric Usage

  • Publish HTML content to mobile site
  • Publish business category data
  • Publish business detail data
  • Sales and specials
  • Near Me functionality
  • Parking data

The back-end for your API can be anything you want; for my examples I use PHP to create a RESTful web service or API.

images  REST (Representation State Transfer)  REST basically means that you have a URL where you can GET, PUT, POST, and DELETE data. The URL defines the data, and the methods define what you want to do with them.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint