loop through and display the feedbackFor Each items In Response.FeedbackDetailArrayTextBox1.Text = TextBox1.Text & vbCrLf & Commenting User: & _ items.CommentingUser & vbCrLfTextBox1.Text = TextBox1.Text & Comment: & items.CommentText & _ vbCrLfNextElse display any errors that occurredTextBox1.Text = For intCount = 0 To Response.Errors.Length - 1TextBox1.Text = TextBox1.Text & Error: & _ Response.Errors(intCount).ErrorCodeTextBox1.Text = TextBox1.Text & vbCrLf & Message: & _ Response.Errors(intCount).LongMessageNext intCountEnd IfExit Subhandleerror: MsgBox( An error occurred: & Err.Number & - & Err.Description) Exit SubEnd Sub2.Run the project, and specify 5when prompted to run this example. XML ExampleThe following XMLcode retrieves feedback about a particular seller using the GetFeedbackmethod. See the earlier instructions for running this example from the existing project. Replace the UserIdvaluewith the User ID of the person for whom you want to retrieve feedback. < ?xml version= 1.0 encoding= utf-8 ?> Your Token Here 1 1 GetFeedback Specify User Id Here Other Ways to Use the eBay APIIn the previous sections, you looked at five examples to give you an idea of how you can use the eBayAPI in your applications. Following are some additional examples of ways you might want to use theeBay API. Additional examples of the eBay API are also included in the later chapters and case studies atthe end of this book. 144Chapter
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Adult Web Hosting services
SOAP Example1.Add the following Example5procedure to the code section of the existing project. Replace where specified with your own eBay credentials. Sub Example5() On Error GoTo handleerrorDim strToken As StringDim strDevId As StringDim strAppId As StringDim strCertId As String specify credentials required to access APIstrToken = Your Token Here strDevId = Your Dev Id Here strAppId = Your App Id Here strCertId = Your Cert Id Here Dim SOAPService As New ebay.eBayAPIInterfaceServiceSOAPService.Url = _ https://api.sandbox.ebay.com/wsapi?callname=GetFeedback&siteid=0&appid= & _ strAppId & version=383 SOAPService.RequesterCredentials = New ebay.CustomSecurityHeaderTypeSOAPService.RequesterCredentials.eBayAuthToken = strTokenSOAPService.RequesterCredentials.Credentials = New ebay.UserIdPasswordTypeSOAPService.RequesterCredentials.Credentials.AppId = strAppIdSOAPService.RequesterCredentials.Credentials.DevId = strDevIdSOAPService.RequesterCredentials.Credentials.AuthCert = strCertIdDim Request As New ebay.GetFeedbackRequestTypeDim Response As New ebay.GetFeedbackResponseType specify the API versionRequest.Version = 383 specify the seller s user id to retrieve feedback forRequest.UserID = Specify a Valid Seller User Id call the GetFeedback method to retrieve the feedbackResponse = SOAPService.GetFeedback(Request) Dim intCount As Integer display the feedback about the sellerIf IsNothing(Response.Errors) ThenDim items As New ebay.FeedbackDetailType if no feedback, then exitIf IsNothing(Response.FeedbackDetailArray) ThenTextBox1.Text = No feedback for this seller Exit SubEnd If143Using
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Adult Web Hosting services
Dim items As ebay.OfferType if no users, then exitIf IsNothing(Response.BidArray) ThenTextBox1.Text = No users were returned. Exit SubEnd IfFor Each items In Response.BidArrayTextBox1.Text = TextBox1.Text & vbCrLf & User Id: & _ items.User.UserID & vbCrLfTextBox1.Text = TextBox1.Text & Quantity: & items.Quantity & _ vbCrLfNextElse display any errors that occurredTextBox1.Text = For intCount = 0 To Response.Errors.Length - 1TextBox1.Text = TextBox1.Text & Error: & _ Response.Errors(intCount).ErrorCodeTextBox1.Text = TextBox1.Text & vbCrLf & Message: & _ Response.Errors(intCount).LongMessageNext intCountEnd IfExit Subhandleerror: MsgBox( An error occurred: & Err.Number & - & Err.Description) Exit SubEnd Sub2.Run the project and specify 4when prompted to run this example. XML ExampleThis example shows the XMLcode for retrieving the winning bidders of a Dutch auction using theGetHighBiddersmethod. See the earlier instructions for using this in the existing project. Replace theItemIdvalue with the Item ID of a listing for which you wish to retrieve winning bidders. < ?xml version= 1.0 encoding= utf-8 ?> Your Token Here 1 4501701557 GetHighBidders #5 Retrieve Feedback about a SellerThis final example calls the GetFeedbackmethod to retrieve feedback about a particular seller. 142Chapter
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Adult Web Hosting services
#4 Retrieve Winning Bidders of Dutch AuctionThis example calls the GetHighBiddersmethod to retrieve the winning bidders for a Dutch auction. SOAP Example1.Add the following Example4procedure to the code section of the existing project. Replace where specified with your own eBay credentials. Also specify a valid Dutch auction on the Sandbox test eBay site where indicated. Sub Example4() On Error GoTo handleerrorDim strToken As StringDim strDevId As StringDim strAppId As StringDim strCertId As String specify credentials required to access APIstrToken = Your Token Here strDevId = Your Dev Id Here strAppId = Your App Id Here strCertId = Your Cert Id Here Dim SOAPService As New ebay.eBayAPIInterfaceServiceSOAPService.Url = _ https://api.sandbox.ebay.com/wsapi?callname=GetHighBidders&siteid=0&appid= & strAppId & version=383 SOAPService.RequesterCredentials = New ebay.CustomSecurityHeaderTypeSOAPService.RequesterCredentials.eBayAuthToken = strTokenSOAPService.RequesterCredentials.Credentials = New ebay.UserIdPasswordTypeSOAPService.RequesterCredentials.Credentials.AppId = strAppIdSOAPService.RequesterCredentials.Credentials.DevId = strDevIdSOAPService.RequesterCredentials.Credentials.AuthCert = strCertIdDim Request As New ebay.GetHighBiddersRequestTypeDim Response As New ebay.GetHighBiddersResponseType specify the API versionRequest.Version = 383 specify the item id for the dutch auctionRequest.ItemID = Put Item Id Here call the AddItem method to list the itemResponse = SOAPService.GetHighBidders(Request) Dim intCount As Integer display the successful list of users who purchased this item under the dutch auctionIf IsNothing(Response.Errors) Then141Using
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Adult Web Hosting services
TextBox1.Text = No items for this seller Exit SubEnd If display the itemsFor Each items In Response.ItemArrayTextBox1.Text = TextBox1.Text & vbCrLf & Title: & _ items.Title & vbCrLfTextBox1.Text = TextBox1.Text & Description: & _ items.Description & vbCrLfNextElse display any errors that occurredTextBox1.Text = For intCount = 0 To Response.Errors.Length - 1TextBox1.Text = TextBox1.Text & Error: & _ Response.Errors(intCount).ErrorCodeTextBox1.Text = TextBox1.Text & vbCrLf & Message: & _ Response.Errors(intCount).LongMessageNext intCountEnd IfExit Subhandleerror: MsgBox( An error occurred: & Err.Number & - & Err.Description) Exit SubEnd Sub2.Run this program and specify 3when prompted to run this example. XML ExampleThe following code is an example of XMLcode that retrieves all pending auctions for a specified sellerusing the GetSellerListmethod. Follow the instructions described in the beginning of this section ifyou want to run this example from the existing project. Also, replace the User ID with the ID of someonefor whom you want to retrieve pending auctions. < ?xml version= 1.0 encoding= utf-8 ?> Your Token Here 1 Valid User Id Goes Here GetSellerList 32 10
1 2004-10-20 00:00:01 2004-10-20 23:59:59 140Chapter
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Inexpensive Web Hosting services
SOAP Example1.Add the following Example3procedure to the code section of the existing project. Replace where specified with your own eBay credentials. Also replace the User ID value with User ID of a seller for whom you wish to retrieve a list of items. Sub Example3() On Error GoTo handleerrorDim strToken As StringDim strDevId As StringDim strAppId As StringDim strCertId As String specify credentials required to access APIstrToken = Your Token Here strDevId = Your Dev Id Here strAppId = Your App Id Here strCertId = Your Cert Id Here Dim SOAPService As New ebay.eBayAPIInterfaceServiceSOAPService.Url = _ https://api.sandbox.ebay.com/wsapi?callname=GetSellerList&siteid=0&appid= & strAppId & version=383 SOAPService.RequesterCredentials = New ebay.CustomSecurityHeaderTypeSOAPService.RequesterCredentials.eBayAuthToken = strTokenSOAPService.RequesterCredentials.Credentials = New ebay.UserIdPasswordTypeSOAPService.RequesterCredentials.Credentials.AppId = strAppIdSOAPService.RequesterCredentials.Credentials.DevId = strDevIdSOAPService.RequesterCredentials.Credentials.AuthCert = strCertIdDim Request As New ebay.GetSellerListRequestTypeDim Response As New ebay.GetSellerListResponseType specify the API versionRequest.Version = 383 specify user id for seller you wish to retrieve list forRequest.UserID = Specify User Id Here call the GetSellerList method to get the listResponse = SOAPService.GetSellerList(Request) Dim intCount As Integer display the list of items for this sellerIf IsNothing(Response.Errors) ThenDim items As New ebay.ItemTypeTextBox1.Text = Number of items for seller: & _ Response.ReturnedItemCountActual & vbCrLf if no items, then exitIf IsNothing(Response.ItemArray) Then139Using
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Inexpensive Web Hosting services
if no categories, then exitIf IsNothing(Response.CategoryArray) ThenTextBox1.Text = No categories returned for this site id. Exit SubEnd If display the categoriesFor Each items In Response.CategoryArrayTextBox1.Text = TextBox1.Text & vbCrLf & Category ID: & _ items.CategoryID & vbCrLfTextBox1.Text = TextBox1.Text & Category Name: & _ items.CategoryName & vbCrLfNextElse display any errors that occurredTextBox1.Text = For intCount = 0 To Response.Errors.Length - 1TextBox1.Text = TextBox1.Text & Error: & _ Response.Errors(intCount).ErrorCodeTextBox1.Text = TextBox1.Text & vbCrLf & Message: & _ Response.Errors(intCount).LongMessageNext intCountEnd IfExit Subhandleerror: MsgBox( An error occurred: & Err.Number & - & Err.Description) Exit SubEnd Sub2.Run the project and specify 2when prompted to run this example. XML ExampleThe following XMLcode retrieves categories for the specified site using the GetCategoriesmethod.Torun this example from the existing project, see the earlier instructions. Also, replace theCategorySiteIdvalue with the identifier corresponding to the eBay site you wish to use in yoursearch. < ?xml version= 1.0 encoding= utf-8 ?> Your Token Here 1 0 GetCategories 4 #3 Retrieve List of Pending Auctions for SellerThis example calls the GetSellerListmethod to retrieve all pending auctions for a specified seller. 138Chapter
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Mac Web Hosting services
#2 Retrieve a List of CategoriesIn this example, you use the GetCategoriesmethod to retrieve all of the categories for a particulareBay site. SOAP Example1.Add the following Example2procedure to the code section of the existing project. Replace where specified with your own eBay credentials. Sub Example2() On Error GoTo handleerrorDim strToken As StringDim strDevId As StringDim strAppId As StringDim strCertId As String specify credentials required to access APIstrToken = Your Token Here strDevId = Your Dev Id Here strAppId = Your App Id Here strCertId = Your Cert Id Here Dim SOAPService As New ebay.eBayAPIInterfaceServiceSOAPService.Url = _ https://api.sandbox.ebay.com/wsapi?callname=GetCategories&siteid=0&appid= & strAppId & version=383 SOAPService.RequesterCredentials = New ebay.CustomSecurityHeaderTypeSOAPService.RequesterCredentials.eBayAuthToken = strTokenSOAPService.RequesterCredentials.Credentials = New ebay.UserIdPasswordTypeSOAPService.RequesterCredentials.Credentials.AppId = strAppIdSOAPService.RequesterCredentials.Credentials.DevId = strDevIdSOAPService.RequesterCredentials.Credentials.AuthCert = strCertIdDim Request As New ebay.GetCategoriesRequestTypeDim Response As New ebay.GetCategoriesResponseType specify the API versionRequest.Version = 383 get the categories for the U.S. Request.CategorySiteID = 0 call the GetCategories methodResponse = SOAPService.GetCategories(Request) Dim intCount As Integer display the list of eBay categoriesIf IsNothing(Response.Errors) ThenDim items As ebay.CategoryType137Using
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Mac Web Hosting services
eBay after the listing was successfulTextBox1.Text = Item Listed & vbCrLf & Item ID: & Response.ItemIDElse display the errors that were returnedTextBox1.Text = For intCount = 0 To Response.Errors.Length - 1TextBox1.Text = TextBox1.Text & Error: & _ Response.Errors(intCount).ErrorCodeTextBox1.Text = TextBox1.Text & vbCrLf & Message: & _ Response.Errors(intCount).LongMessageNext intCountEnd IfExit Subhandleerror: MsgBox( An error occurred: & Err.Number & - & Err.Description) Exit SubEnd Sub4.Run the program, and specify 1when prompted to run this example. XML ExampleThe following code is an example of XMLthat lists an item using the AddItemmethod. Follow theinstructions described in the beginning of this section if you want to run this example from the existingproject. Also, replace the values with the information for the item you wish to list. < ?xml version= 1.0 encoding= utf-8 ?> Your Token Here 0 1 0 0 0 US 1 < ![CDATA[ A forgotten classic! ]]> 7 Indianapolis, IN 6 1.00
1 1 60 0 2 1 AddItem 136Chapter
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Clan Web Hosting services
SOAPService.RequesterCredentials.Credentials.DevId = strDevIdSOAPService.RequesterCredentials.Credentials.AuthCert = strCertIdDim Request As New ebay.AddItemRequestTypeDim Response As New ebay.AddItemResponseTypeDim Item As New ebay.ItemType specify the API versionRequest.Version = 383 Item.Title = Johnny Horton Greatest Hits CD Item.Description = A forgotten classic! specify the listing detailsItem.QuantitySpecified = TrueItem.Quantity = 1Item.CurrencySpecified = TrueItem.Currency = New ebay.CurrencyCodeTypeItem.Currency = ebay.CurrencyCodeType.USDItem.CountrySpecified = TrueItem.Country = New ebay.CountryCodeTypeItem.Country = ebay.CountryCodeType.USItem.ListingDurationSpecified = TrueItem.ListingDuration = New ebay.ListingDurationCodeTypeItem.ListingDuration = ebay.ListingDurationCodeType.Days_7Item.Location = Indianapolis, IN Item.ListingDetails = New ebay.ListingDetailsTypeItem.ListingDetails.ConvertedBuyItNowPrice = New ebay.AmountTypeItem.ListingDetails.ConvertedBuyItNowPrice.currencyID = New _ ebay.CurrencyCodeTypeItem.ListingDetails.ConvertedBuyItNowPrice.currencyID = _ ebay.CurrencyCodeType.USDItem.ListingDetails.ConvertedBuyItNowPrice.Value = 5.0Item.StartPrice = New ebay.AmountTypeItem.StartPrice.currencyID = New ebay.CurrencyCodeTypeItem.StartPrice.currencyID = ebay.CurrencyCodeType.USDItem.StartPrice.Value = 1.0Item.RegionID = 60Item.ShippingTerms = ebay.ShippingTermsCodeType.BuyerPaysItem.PrimaryCategory = New ebay.CategoryTypeItem.PrimaryCategory.CategoryID = 1573Item.ListingTypeSpecified = TrueItem.ListingType = ebay.ListingTypeCodeType.FixedPriceItemItem.ShippingOption = ebay.ShippingOptionCodeType.WorldWide assign the item object to the request objectRequest.Item = Item call the AddItem method to list the itemResponse = SOAPService.AddItem(Request) Dim intCount As IntegerIf IsNothing(Response.Errors) Then display the new item ID returned from135Using
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Clan Web Hosting services