Denise Gosnell
Book Details
Price
|
2.50 |
---|---|
Pages
| 329 p |
File Size
|
12,029 KB |
File Type
|
PDF format |
ISBN-13 ISBN-10
| 978-0-7645-8445-9 0-7645-8445-6 |
Copyright©
| 2005 by Denise Gosnell |
Denise Gosnell is a software attorney with Woodard, Emhardt, Moriarty, McNett & Henry LLP
(www.uspatent.com), a worldwide intellectualproperty law firm based in Indianapolis, Indiana. Denise
has a unique background in both technology and law, and presently uses her deep technical and legal
expertise to counsel hightech clients on intellectual property and technical matters.
Denise has over ten years of experience creating software applications, ranging from standalone and
clientserver to enterprisewide applications. Denise has worked for leading software companies, such as
Microsoft and EDS, and has earned a worldwide reputation for her technology expertise. She received a
Bachelor of Arts degree in Computer Science – Business (summa cum laude) from Anderson University, and a Doctor of Jurisprudence degree from Indiana University School of Law in Indianapolis. Denise has coauthored six other software development books to date: Beginning Access 2003 VBA (Wiley Publishing, Inc.), Visual Basic .NET and SQL Server 2000: Building An Effective Data Layer (Wrox Press), Beginning Visual Basic.NET Databases (Wrox Press), Professional .NET Framework (Wrox Press), Professional SQL Server 2000 (Wrox Press), and MSDE Bible (IDG Books). Denise was a featured technology speaker at the Microsoft European Professional Developer’s Conference in December 2001 and has on numerous occasions
assisted Microsoft’s Training and Certification group in creating new exams for their MCSD and MCSE certifications. She herself holds the MCSD certification.
Denise can be reached at dgosnell@uspatent.com or denisegosnell@yahoo.com.
Introduction
Web APIs are a set of application programming interfaces that can be called over standard Internet protocols. Web APIs and Web services are finally getting real attention in the mainstream. Various types of Web APIs are now available from leading technology companies such as Google, Amazon, eBay, Microsoft, and others. Federal Express, UPS, and many other leading companies have recently released or are working on Web APIs as well. Most of these companies offer a free account for limited use of their Web APIs, but some charge a fee for certain levels of usage.
If you like the idea of generating applications that capitalize on the services of some of these wellknown companies, or if you just want to learn from what these leading companies are doing to aid you in implementing your own Web APIs, then this is the book for you.
What This Book Covers
This book provides a handson guide to using some of the most popular Web APIs in software applications. It provides the nutsandbolts details on how several APIs work, and then offers numerous examples of how to use the APIs in real world situations.
While reading this book, you will learn:
❑ Basic concepts of Web APIs
❑ How Web APIs can be used for professional application development
❑ How to call Web APIs using SOAP over HTTP
❑ How to call Web APIs using HTTPGET (REST)
❑ How to call Web APIs using HTTPPOST
❑ How to use the Google API
❑ How to use the MapPoint API
❑ How to use the Amazon API
❑ How to use the eBay API and SDK
❑ How to use the PayPal API
❑ How to locate additional APIs
❑ Some thirdparty extensions of existing APIs
❑ How to create your own API
❑ How to call Web APIs from Microsoft Office applications
❑ How to call Web APIs from mobile devices
❑ How to use multiple APIs together in realworld case studies
Table of Contents
Acknowledgments ix
Introduction xvii
Chapter 1: Anatomy of a Web API 1
Web APIs versus Web Services 1
Web APIs as XML Web Services 2
What Is XML? 2
Invoking an XML Web Service 3
Summary 14
Chapter 2: Using the Google API 15
Google 101 15
cache: 16
daterange: 17
filetype: 17
inanchor: 18
info: 18
intext: 18
intitle: 18
inurl: 18
link: 19
phonebook: 19
related: 19
site: 19
Introduction to the Google API 19
Signing Up and Obtaining a Key 19
Anatomy of a Google API Query 23
Query Syntax 23
Executing a Query 25
Looping through Results 31
Five Creative Ways to Use the Google API 33
#1—Build a Google Search Feature 33
#2—Return Random Pages 36
#3—Save the Results of a Google Search to a File 37
#4—Use Google to Check Spelling 40
#5—Use the Google Cache to Retrieve a Web Site That Is No Longer Available 42
Other Ways to Use the Google API 45
Third-Party Google Extensions 46
Summary 48
Chapter 3: Using the MapPoint API 49
MapPoint 101 50
Introduction to the MapPoint API 51
Signing Up for an Evaluation Account 52
The MapPoint Software Developer’s Kit (SDK) 58
Anatomy of a MapPoint API Query 59
Available Services 59
Using the Test Environment versus Production 63
Executing a MapPoint Query 63
Five Creative Ways to Use the MapPoint API 71
#1—Obtain Driving Directions 72
#2—Retrieve a Map 75
#3—Perform a Geocode Lookup 77
#4—Find Nearby Places 80
#5—Obtain Information on Points of Interests 82
Other Ways to Use the MapPoint API 84
Third-Party MapPoint Extensions 85
Summary 85
Chapter 4: Using the Amazon.com APIs 87
Amazon 101 88
Introduction to the Amazon APIs 90
Supported Features 90
Signing Up for a Subscription ID 91
Anatomy of Amazon API Queries 96
Amazon.com E-Commerce Service API Query Syntax 97
Help Operation 102
Transaction Operation 102
Alexa Web Information Service API Query Syntax 102
Simple Queue Service API Query Syntax 103
Executing a Query Using HTTP-GET (REST) 104
Executing a Query Using SOAP 106
Looping Through Results 109
Five Creative Ways to Use the Amazon APIs 110
#1—Retrieve Feedback about a Seller with ECS 110
#2—Retrieve Product Pricing with ECS 110
#3—Look Up a Friend or Family Member’s Wish List with ECS 110
#4—Create an Amazon.com Shopping Cart with ECS 111
#5—Retrieve URL Information with Alexa Web Information Service 112
Other Ways to Use the Amazon APIs 112
Third-Party Amazon Extensions 113
Summary 115
Chapter 5: Using the eBay API 117
eBay 101 118
Introduction to the eBay API 118
Supported Features 119
Licensing Options 119
Joining the Developer’s Program and Establishing an Account 119
The eBay API Documentation 124
The eBay Software Developer’s Kit (SDK) 124
Anatomy of an eBay API Query 125
Query Syntax 125
Executing a Query Using HTTP-POST 127
Executing a Query Using SOAP 130
Five Creative Ways to Use the eBay API 132
#1—List an Item for Sale 133
#2—Retrieve a List of Categories 137
#3—Retrieve List of Pending Auctions for Seller 138
#4—Retrieve Winning Bidders of Dutch Auction 141
#5—Retrieve Feedback about a Seller 142
Other Ways to Use the eBay API 144
Third-Party eBay Extensions 145
Summary 146
Chapter 6: Using the PayPal API 147
PayPal 101 148
Introduction to the PayPal API 148
Supported Features 149
Getting Set Up to Use the PayPal API 149
Anatomy of a PayPal API Query 158
Query Syntax 158
Executing a Query 160
Other Ways to Use the PayPal API 162
Third-Party PayPal Extensions 162
Summary 162
Chapter 7: Other Web APIs 163
Faxing APIs 163
Setting Up a Free Developer Account 164
Sending a Test Fax 165
The UPS API 168
Setting Up a UPS Developer Account 168
Submitting a Request to the UPS API 170
The FedEx APIs 172
Setting Up a FedEx Developer Account 173
Submitting Transactions Using FedEx Ship Manager Direct 175
Bloglines Web API 176
Locating Additional Web APIs 178
Summary 180
Chapter 8: Calling Web APIs from Mobile Devices 181
What Devices Support XML Web APIs? 181
Windows Pocket PCs and Smartphones 182
Palm and Other Devices 183
Calling Web APIs from Pocket PC Applications 184
Example 1—Call MapPoint API Using SOAP Protocol to Retrieve Driving Directions 184
Example 2—Call Amazon.com API Using HTTP/GET (REST) Protocol 189
Summary 192
Chapter 9: Calling Web APIs from Microsoft Office 193
Calling Web APIs from VBA Code 193
Calling Web APIs Using VBA with HTTP/POST and HTTP/GET (REST) 194
Calling Web APIs Using SOAP Protocol 196
Calling a Web API from Microsoft Office Using .NET 202
Installing the Necessary Tools 203
Example—Calling Amazon.com Web Service from Word Using
Visual Basic .NET and SOAP 205
Summary 211
Chapter 10: Creating Your Own Web API 213
Designing the API 213
What Features Should the API Offer? 213
Which Protocols Should the API Support? 214
Should the Features Be Free or for a Fee? 215
Creating a Web API 215
Building an API Using Visual Studio .NET 216
Calling the Web API from a Client Application 222
Creating a Web API That Uses Other Programs or Services 224
Summary 224
Chapter 11: Case Study 1—Customer Relations
Management Application 225
Introduction to the Customer Relations Management (CRM) Application 225
Building the Project 228
Build the Database 228
Build the User Interface 230
Build the Modules 237
Touring the Completed Application 260
Summary 263
Chapter 12: Case Study 2—Executive Dashboard Application 265
Introduction to the Executive Dashboard Application 265
Building the User Interface 267
Creating the New Project 267
Adding References to the Web APIs 268
Adding Controls to the Form 270
Building the Code Modules 272
Touring the Completed Application 276
Summary 279
Index 281
Who This Book Is ForI
The ideal reader has had prior experience with Microsoft .NET development, such as WinForms and
WebForms applications because most or all code examples will be written with .NET. However, the book also provides general explanations that will be useful for people who are familiar with other languages. Thus, prior .NET development experience is not required, but people with prior .NET development experience will find the code examples more familiar and easier to follow.