Presentation is loading. Please wait.

Presentation is loading. Please wait.

© 2005 Denise M. Gosnell. All Rights Reserved. Professional Development with Web APIs Presented To: Indy.NET Developer’s Association By: Denise Gosnell.

Similar presentations


Presentation on theme: "© 2005 Denise M. Gosnell. All Rights Reserved. Professional Development with Web APIs Presented To: Indy.NET Developer’s Association By: Denise Gosnell."— Presentation transcript:

1 © 2005 Denise M. Gosnell. All Rights Reserved. Professional Development with Web APIs Presented To: Indy.NET Developer’s Association By: Denise Gosnell July 14, 2005

2 © 2005 Denise M. Gosnell. All Rights Reserved. Based On Topics In My New Book: Professional Development with Web APIs Google, eBay, PayPal, Amazon.com, MapPoint, UPS, FedEx (April 2005) Google, eBay, PayPal, Amazon.com, MapPoint, UPS, FedEx (April 2005) This Presentation Is Available For Download from The Source Code for the book is available for download from

3 © 2005 Denise M. Gosnell. All Rights Reserved. Outline of Topics What Is A Web API? Google API MapPoint API Amazon.Com APIs eBay API PayPal API Other APIs Calling From Mobile Devices and Office Creating Your Own API

4 © 2005 Denise M. Gosnell. All Rights Reserved. What Is a Web API? (Chapter 1) Series or collection of web services Sometimes used interchangeably with “web services” Examples: Google API, Amazon.Com APIs

5 © 2005 Denise M. Gosnell. All Rights Reserved. How Do You Call a Web API? XML web services can be invoked in one of three ways: Using REST (HTTP-GET) Using REST (HTTP-GET) URL includes parameters URL includes parameters Example: mmerceService&SubscriptionId=YOURIDGOESHERE&Oper ation=ItemSearch&SearchIndex=Books&Keywords=Denise% 20Gosnell mmerceService&SubscriptionId=YOURIDGOESHERE&Oper ation=ItemSearch&SearchIndex=Books&Keywords=Denise% 20Gosnell mmerceService&SubscriptionId=YOURIDGOESHERE&Oper ation=ItemSearch&SearchIndex=Books&Keywords=Denise% 20Gosnell Using HTTP-POST Using HTTP-POST You post an XML document XML document returned Using SOAP Using SOAP More complex, allows structured and type information

6 © 2005 Denise M. Gosnell. All Rights Reserved. The Google API (Chapter 2) Available Using SOAP with HTTP Limited to 1000 Calls Per Day Obtain a Developer Key and Developer’s Kit From: Query Syntax: doGoogleSearch (Key, SearchString, Start, MaxResults, Filter, Restrict, SafeSearch, lr, ie, oe) doGoogleSearch (Key, SearchString, Start, MaxResults, Filter, Restrict, SafeSearch, lr, ie, oe) Returns only 10 results at a time – have to change the start index to specify which ones to retrieve doGetCachedPage (Key, URL) doGetCachedPage (Key, URL) doSpellingSuggestion (Key, Phrase) doSpellingSuggestion (Key, Phrase)

7 © 2005 Denise M. Gosnell. All Rights Reserved. The MapPoint API (Chapter 3) Can Be Called Using SOAP with HTTP Examples of Supported Features: Addresses Addresses Reverse Geocoding Reverse Geocoding Finding Nearby Places Finding Nearby Places Custom Locations Custom Locations Map Rendering Map Rendering Points of Interest Points of Interest Evaluation Account / Developer Account: default.mspx default.mspx default.mspx

8 © 2005 Denise M. Gosnell. All Rights Reserved. The Amazon.Com APIs (Chapter 4) There Are Currently 3 Amazon.Com APIs Amazon E-Commerce Service (ECS) Amazon E-Commerce Service (ECS) Alexa Web Information Service (AWIS) – programmatic access to web crawl data Alexa Web Information Service (AWIS) – programmatic access to web crawl datawww.alexa.com Simple Queue Service Simple Queue Service All 3 Can Be Called Using SOAP or HTTP-GET(REST) Info About These 3 Can Be Found At: ?%5Fencoding=UTF8&node= ?%5Fencoding=UTF8&node= ?%5Fencoding=UTF8&node= Sign Up For Subscription ID at: form.html form.html form.html Mention which uses one or more of Amazon.com APIs above

9 © 2005 Denise M. Gosnell. All Rights Reserved. Amazon.Com Demo Create a New VB.NET WinForms Project Add a reference to the Amazon.com API (Project | Add Web Reference): Service.wsdl Service.wsdl Service.wsdl Then, add the following code to your VB.NET WinForms project: Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim AmazonProductData As New _ Dim AmazonProductData As New _ TestAmazonWebService.Amazon.AWSECommerceService TestAmazonWebService.Amazon.AWSECommerceService Dim AmazonSearch As New TestAmazonWebService.Amazon.ItemSearch Dim AmazonSearch As New TestAmazonWebService.Amazon.ItemSearch Dim AmazonResponse As New _ Dim AmazonResponse As New _ TestAmazonWebService.Amazon.ItemSearchResponse TestAmazonWebService.Amazon.ItemSearchResponse Dim AmazonRequest(1) As _ Dim AmazonRequest(1) As _ TestAmazonWebService.Amazon.ItemSearchRequest TestAmazonWebService.Amazon.ItemSearchRequest 'Developer/Subscription Code 'Developer/Subscription Code AmazonSearch.SubscriptionId = "YOUR ID GOES HERE" AmazonSearch.SubscriptionId = "YOUR ID GOES HERE" 'We are only making one request, not batching multiple requests 'We are only making one request, not batching multiple requests 'Thus element 0 of the array is all we need to assign and work with 'Thus element 0 of the array is all we need to assign and work with AmazonRequest(0) = New _ AmazonRequest(0) = New _ TestAmazonWebService.amazon.ItemSearchRequest TestAmazonWebService.amazon.ItemSearchRequest AmazonRequest(0).SearchIndex = "Books" AmazonRequest(0).SearchIndex = "Books" AmazonRequest(0).Keywords = “Denise Gosnell" AmazonRequest(0).Keywords = “Denise Gosnell"

10 © 2005 Denise M. Gosnell. All Rights Reserved. Amazon.Com Demo (continued) 'assign the search object to the request object with the assigned parameters AmazonSearch.Request = AmazonRequest AmazonSearch.Request = AmazonRequest 'run the search and populate the response 'run the search and populate the response AmazonResponse = AmazonProductData.ItemSearch(AmazonSearch) AmazonResponse = AmazonProductData.ItemSearch(AmazonSearch) Dim item As New TestAmazonWebService.Amazon.Item Dim item As New TestAmazonWebService.Amazon.Item Dim strOutput As String Dim strOutput As String strOutput = "Search results for keyword(s): " & AmazonRequest(0).Keywords & " in " & AmazonRequest(0).SearchIndex & ":" & vbCrLf & vbCrLf strOutput = "Search results for keyword(s): " & AmazonRequest(0).Keywords & " in " & AmazonRequest(0).SearchIndex & ":" & vbCrLf & vbCrLf 'loop through the results 'loop through the results For Each item In AmazonResponse.Items(0).Item For Each item In AmazonResponse.Items(0).Item strOutput = strOutput & item.ItemAttributes.Title & vbCrLf & vbCrLf strOutput = strOutput & item.ItemAttributes.Title & vbCrLf & vbCrLf Next Next 'display the results in a message box 'display the results in a message box MsgBox(strOutput) MsgBox(strOutput) End Sub End Sub

11 © 2005 Denise M. Gosnell. All Rights Reserved. The eBay API (Chapter 5) eBay API can be called using HTTP-POST or SOAP Sandbox (Test) and Live Environments Supports most popular features: Retrieve Auction Listings Retrieve Auction Listings Retrieve Customer Reviews Retrieve Customer Reviews Retrieve Status of Auction Retrieve Status of Auction Add New Auction Listing Add New Auction Listing Retrieve Winning Details Retrieve Winning Details Join Developer Program and Obtain Account:

12 © 2005 Denise M. Gosnell. All Rights Reserved. The PayPal API (Chapter 6) PayPal API can be called using SOAP Sandbox (Test) and Live Environments Supports several features: GetTransactionDetails GetTransactionDetails TransactionSearch TransactionSearch RefundTransaction RefundTransaction MassPay MassPay Join Developer Program and Obtain Account:

13 © 2005 Denise M. Gosnell. All Rights Reserved. Demo – Combining APIs (from Chapter 11 Case Study) Uses Google To Retrieve Top 5 web Sites That Mention Your Customer Uses MapPoint To Retrieve Map And/Or Driving Directions To Customer Location

14 © 2005 Denise M. Gosnell. All Rights Reserved.

15

16

17 Other APIs (Chapter 7) InterFax Fax API UPS API panies.html panies.html panies.html panies.html FedEx API (some require DLLs) (some require DLLs) Bloglines API

18 © 2005 Denise M. Gosnell. All Rights Reserved. Finding More Web APIs UDDI Directory BindingPoint Web Site Various Other Locations On Internet

19 © 2005 Denise M. Gosnell. All Rights Reserved. Calling From Mobile Devices (Chapter 8) Use.NET Compact Framework In Visual Studio.NET To Target Pocket PCs and SmartPhones Just Select Project Type In VS.Net Just Select Project Type In VS.Net eMbedded Visual Tools Use To Create Separate From VS.Net Use To Create Separate From VS.Net Web Services For Palm ervices.jsp ervices.jsp ervices.jsp ervices.jsp

20 © 2005 Denise M. Gosnell. All Rights Reserved. Calling From Microsoft Office (Chapter 9) There Are At Least 3 Ways To Call Web API From Microsoft Office Programs: VBA Example in Excel using VBA and HTTP/GET (REST) Example in Excel using VBA and HTTP/GET (REST) VBA using SOAP requires Web Services Toolkit (available for free download from Microsoft) requires Web Services Toolkit (available for free download from Microsoft) Using.NET requires Visual Studio Tools for Microsoft Office System – must purchase requires Visual Studio Tools for Microsoft Office System – must purchase

21 © 2005 Denise M. Gosnell. All Rights Reserved. Creating Your Own APIs (Chapter 10) Create New ASP.NET Web Service Project from VS.NET Add Code Add Code Test The Web Service Using Built-In Testing Utility In Web Browser Test The Web Service Using Built-In Testing Utility In Web Browser Call Web Service From Another Program Using Protocols You Enabled For Service Call Web Service From Another Program Using Protocols You Enabled For Service Can Also Convert Existing.NET App To Web Service By Wrapping With WebMethod Attribute

22 © 2005 Denise M. Gosnell. All Rights Reserved. Questions?


Download ppt "© 2005 Denise M. Gosnell. All Rights Reserved. Professional Development with Web APIs Presented To: Indy.NET Developer’s Association By: Denise Gosnell."

Similar presentations


Ads by Google