public void GetMyeBaySelling() { GetMyeBaySellingCall api = new GetMyeBaySellingCall(this.apiContext); GetMyeBaySellingRequestType req = new GetMyeBaySellingRequestType(); api.ApiRequest = req; ItemListCustomizationType lc = new ItemListCustomizationType(); lc.Include = true; lc.IncludeSpecified = true; lc.IncludeNotes = true; lc.IncludeNotesSpecified = true; lc.Sort = ItemSortTypeCodeType.BidCount; req.ActiveList = lc; lc = new ItemListCustomizationType(); lc.Include = true; lc.IncludeSpecified = true; lc.IncludeNotes = true; lc.IncludeNotesSpecified = true; lc.Sort = ItemSortTypeCodeType.Price; req.SoldList = lc; lc = new ItemListCustomizationType(); lc.Include = true; lc.IncludeSpecified = true; lc.IncludeNotes = true; lc.IncludeNotesSpecified = true; lc.Sort = ItemSortTypeCodeType.EndTime; req.UnsoldList = lc; lc = new ItemListCustomizationType(); lc.Include = true; lc.IncludeSpecified = true; lc.IncludeNotes = true; lc.IncludeNotesSpecified = true; lc.Sort = ItemSortTypeCodeType.StartTime; req.ScheduledList = lc; // Make API call. api.GetMyeBaySelling(); GetMyeBaySellingResponseType resp = api.ApiResponse; }
public void GetMyeBaySelling() { GetMyeBaySellingCall api = new GetMyeBaySellingCall(this.apiContext); GetMyeBaySellingRequestType req = new GetMyeBaySellingRequestType(); api.ApiRequest = req; ItemListCustomizationType lc = new ItemListCustomizationType(); lc.Include = true; lc.IncludeSpecified = true; lc.IncludeNotes = true; lc.IncludeNotesSpecified = true; lc.Sort = ItemSortTypeCodeType.BidCount; req.ActiveList = lc; lc = new ItemListCustomizationType(); lc.Include = true; lc.IncludeSpecified = true; lc.IncludeNotes = true; lc.IncludeNotesSpecified = true; lc.Sort = ItemSortTypeCodeType.Price; req.SoldList = lc; lc = new ItemListCustomizationType(); lc.Include = true; lc.IncludeSpecified = true; lc.IncludeNotes = true; lc.IncludeNotesSpecified = true; lc.Sort = ItemSortTypeCodeType.EndTime; req.UnsoldList = lc; lc = new ItemListCustomizationType(); lc.Include = true; lc.IncludeSpecified = true; lc.IncludeNotes = true; lc.IncludeNotesSpecified = true; lc.Sort = ItemSortTypeCodeType.StartTime; req.ScheduledList = lc; // Make API call. api.GetMyeBaySelling(); GetMyeBaySellingResponseType resp = api.ApiResponse; }
public static void GetMyeBaySelling() { string endpoint = "https://api.ebay.com/wsapi"; string callName = "GetMyeBaySelling"; string siteId = "2"; string version = "949"; // Build the request URL string requestURL = endpoint + "?callname=" + callName + "&siteid=" + siteId + "&appid=" + Settings.AppId + "&version=" + version + "&routing=default"; // Create the service eBayAPIInterfaceService service = new eBayAPIInterfaceService(); // Assign the request URL to the service locator. service.Url = requestURL; // Set credentials service.RequesterCredentials = new CustomSecurityHeaderType(); service.RequesterCredentials.eBayAuthToken = "AgAAAA**AQAAAA**aAAAAA**c8WOVg**nY+sHZ2PrBmdj6wVnY+sEZ2PrA2dj6AAlIeiCpiLoAydj6x9nY+seQ**JiADAA**AAMAAA**sPiqCG+IiAwqtalGeoTnnESc7Br2D+btBopa9arMMDNaOfglryGRHk3tn/aXAj3p2/KmDiKSmYrg51QGFNokYSGUskmH/jjsOtKgoLyTTJZ+3CtWqeAOz/cbrYadAD8l+s6xUfnTk9mWm4BjyAfYqJ1zkNHUC5YaFTk+oaDZPZ9bE7uGjfw1cvQeX6M7TalgTSygqdVV6hOVJZ3I9UPuO66HchFTPvd4n02aZ2UfsXrcYdOpstNdjLuETQIB5tmUWo6uiCwh/r+eiWt8jIycZegb/9uRHzwEy7rW9Tk7fIpIohoBtryYRLUnMJvy9Dg4l++AhFY0yakWJsWu7VHy7eCuz+OI0Pk+E+uOQhgQRzIji96K6/AnBNV9lLiOa6CiI5MdkcrF2Z4Kr4WoxAgy+4WjoUq+PRG8eDHseFWANwOVhmY9qZJq0ulR9SNcXd8FoRiinxzx3f+lO+MgfrRcea2QKKQVoYDI69jKOQ568FVQ6Zp0ClJy9ru/L9IqB87COBLFP6Ie+Zx+2nhgj+GuARYOu2z0Z7kqx+R6H19hIYoxNncQtGi2ruzqWXG+hbFWXTlqrne8IiJr1udgK1ZxJk9FTCCKQCx0s57SXuBkyaM15y2pqC+ze43ZiLGC3wk94pWEACDNRWu4rH27RZTN+ALBoGWkVdSzGxuVfMD164ak4cAJrIiT2OX77FqnLN+MGcVbfJCAu+BREtguSzW6JmM9qHXHBI+4H/jfGruvYoIt2zg7DzMFv50i+hpnLe5F"; // use your token service.RequesterCredentials.Credentials = new UserIdPasswordType(); service.RequesterCredentials.Credentials.AppId = Settings.AppId; service.RequesterCredentials.Credentials.DevId = Settings.DevId; service.RequesterCredentials.Credentials.AuthCert = Settings.CertId; // Make the call GetMyeBaySellingRequestType request = new GetMyeBaySellingRequestType(); request.Version = "949"; var response = service.GetMyeBaySelling(request); Console.WriteLine(response.Timestamp); }
/// <summary> /// Gets ebay listings - Filtered by order type /// </summary> /// <param name="orderType">Type of order - sold, awaiting payment etc</param> /// <param name="pageNumber">Page number to return. Returns 200 per page</param> /// <returns></returns> public GetMyeBaySellingResponseType GetMyEbayListings(OrderStatusFilterCodeType orderType, int pageNumber = 1) { var service = EbayServiceContext(ServiceCallType.GetMyeBaySelling); var filter = new ItemListCustomizationType { Include = true, Pagination = new PaginationType { EntriesPerPage = Properties.EntriesPerRequest, EntriesPerPageSpecified = true, PageNumber = pageNumber, PageNumberSpecified = true }, OrderStatusFilter = orderType, OrderStatusFilterSpecified = true }; var request = new GetMyeBaySellingRequestType { ActiveList = filter, SoldList = filter }; request.ActiveList.Include = true; SetupRequestType <GetMyeBaySellingRequestType>(request); var credentials = Properties.EbayCredentials; var apicall = service.GetMyeBaySelling(ref credentials, request); if (apicall.Errors != null) { foreach (var e in apicall.Errors.ToArray()) { _logger.WriteToLog(e, EventLogEntryType.Error); } } if ((apicall.Ack == AckCodeType.Success || apicall.Ack == AckCodeType.Warning)) { return(apicall); } return(null); }
/// <summary> /// Gets ebay listings - Filtered by order type /// </summary> /// <param name="orderType">Type of order - sold, awaiting payment etc</param> /// <param name="pageNumber">Page number to return. Returns 200 per page</param> /// <returns></returns> public GetMyeBaySellingResponseType GetMyEbayListings(OrderStatusFilterCodeType orderType, int pageNumber = 1) { var service = EbayServiceContext(ServiceCallType.GetMyeBaySelling); var filter = new ItemListCustomizationType { Include = true, Pagination = new PaginationType { EntriesPerPage = Properties.EntriesPerRequest, EntriesPerPageSpecified = true, PageNumber = pageNumber, PageNumberSpecified = true }, OrderStatusFilter = orderType, OrderStatusFilterSpecified = true }; var request = new GetMyeBaySellingRequestType { ActiveList = filter, SoldList = filter }; request.ActiveList.Include = true; SetupRequestType<GetMyeBaySellingRequestType>(request); var credentials = Properties.EbayCredentials; var apicall = service.GetMyeBaySelling(ref credentials, request); if (apicall.Errors != null) { foreach (var e in apicall.Errors.ToArray()) { _logger.WriteToLog(e, EventLogEntryType.Error); } } if ((apicall.Ack == AckCodeType.Success || apicall.Ack == AckCodeType.Warning)) { return apicall; } return null; }
public List<Seller_Item> GetUserItemsList(string userToken) { string callname = "GetMyeBaySelling"; #region Initialise Needed Variables string version1 = "929"; //Get the Server to use (Sandbox or Production) string serverUrl = ConfigurationManager.AppSettings["TradingService"]; //SiteID = 0 (US) - UK = 3, Canada = 2, Australia = 15, .... string siteID = "15";/*Updated by javed 27-11-2013 --- Previous value was 0*/ eBayAPIInterfaceService service = new eBayAPIInterfaceService(); string requestURL = serverUrl + "?callname=" + callname + "&siteid=" + siteID + "&appid=" + AppID + "&version=" + version1 + "&routing=default"; service.Url = requestURL; // Set credentials service.RequesterCredentials = new CustomSecurityHeaderType(); service.RequesterCredentials.Credentials = new UserIdPasswordType(); service.RequesterCredentials.Credentials.AppId = AppID; service.RequesterCredentials.Credentials.DevId = DevID; service.RequesterCredentials.Credentials.AuthCert = CertID; service.RequesterCredentials.eBayAuthToken = userToken; #endregion GetMyeBaySellingRequestType request = new GetMyeBaySellingRequestType(); request.WarningLevel = WarningLevelCodeType.High; //request.EndTimeFrom = DateTime.Today; //request.EndTimeFromSpecified = true; //request.EndTimeTo = DateTime.Today.AddDays(120); //request.EndTimeToSpecified = true; request.Version = version1; request.DetailLevel = new DetailLevelCodeType[] { DetailLevelCodeType.ItemReturnDescription, DetailLevelCodeType.ItemReturnAttributes }; //request.ActiveList.Pagination = new PaginationType(); //request.ActiveList.Pagination.PageNumber = 1; // request.ActiveList.Pagination.PageNumberSpecified = true; //request.ActiveList.Pagination.EntriesPerPage = 200; // request.ActiveList.Pagination.EntriesPerPageSpecified = true; request.ActiveList.Include = true; request.ActiveList.DurationInDays = 1; request.ActiveList.Include = true; request.ActiveList.IncludeNotes = true; //request.ActiveList.Pagination.PageNumber = 1; //request.ActiveList.Pagination.EntriesPerPage = 200; //request.ActiveList.Pagination.EntriesPerPageSpecified = true; //request.ActiveList.Pagination.PageNumberSpecified = true; try { List<Seller_Item> items = new List<Seller_Item>(); bool moreItem = true; while (moreItem == true) { GetMyeBaySellingResponseType response = service.GetMyeBaySelling(request); foreach (var s in response.ActiveList.ItemArray) { try { Seller_Item si = new Seller_Item() { CustomLabel = s.SKU, PictureURL = s.PictureDetails != null && s.PictureDetails.PictureURL != null ? s.PictureDetails.PictureURL[0] : string.Empty, ItemViewURL = s.ListingDetails.ViewItemURL, BinPrice = s.ListingDetails.ConvertedBuyItNowPrice.Value, CurrentPrice = s.ListingDetails.ConvertedStartPrice.Value, Currency = s.ListingDetails.ConvertedStartPrice.currencyID != null ? s.ListingDetails.ConvertedStartPrice.currencyID.ToString() : string.Empty, EndDate = s.ListingDetails.EndTime, StartDate = s.ListingDetails.StartTime, ItemID = s.ItemID, ItemName = s.Title, IsPromoItem = s.SellingStatus.PromotionalSaleDetails != null && s.SellingStatus.PromotionalSaleDetails.StartTime.Date <= System.DateTime.Today.Date && s.SellingStatus.PromotionalSaleDetails.EndTime.Date >= System.DateTime.Today.Date ? true : false, Height = s.ShippingPackageDetails.PackageDepth != null ? (decimal?)s.ShippingPackageDetails.PackageDepth.Value : null, Length = s.ShippingPackageDetails.PackageLength != null ? (decimal?)s.ShippingPackageDetails.PackageLength.Value : null, Width = s.ShippingPackageDetails.PackageWidth != null ? (decimal?)s.ShippingPackageDetails.PackageWidth.Value : null, Weight = s.ShippingPackageDetails.WeightMajor != null ? (decimal?)s.ShippingPackageDetails.WeightMajor.Value : null, WeightMinor = s.ShippingPackageDetails.WeightMinor != null ? (decimal?)s.ShippingPackageDetails.WeightMinor.Value : null, CategoryID = s.PrimaryCategory.CategoryID, CategoryName = s.PrimaryCategory.CategoryName, Quantity = s.Quantity, Discription = s.Description, CountryCode = countryID, CountryShortCode = countryShortID, CurrentSales = s.SellingStatus.QuantitySold, QuantityAvailable = s.QuantityAvailable }; items.Add(si); } catch (Exception ex) { Logging.WriteLog(LogType.Critical, ex.ToString()); } } if (response.ActiveList.ItemArray.Count() == 200) response.ActiveList.PaginationResult.TotalNumberOfPages += 1; else moreItem = false; } return items; //List<Seller_Item> items = response.ItemArray.Select(s => new Seller_Item //{ // CustomLabel = s.SKU, // //PictureURL = s.PictureDetails != null && s.PictureDetails.PictureURL != null ? s.PictureDetails.PictureURL[0] : string.Empty, // //ItemViewURL = s.ListingDetails.ViewItemURL, // BinPrice = s.ListingDetails.ConvertedBuyItNowPrice.Value, // CurrentPrice = s.ListingDetails.ConvertedStartPrice.Value, // Currency = s.ListingDetails.ConvertedStartPrice.currencyID != null ? s.ListingDetails.ConvertedStartPrice.currencyID.ToString() : string.Empty, // EndDate = s.ListingDetails.EndTime, // StartDate = s.ListingDetails.StartTime, // ItemID = s.ItemID, // ItemName = s.Title, // IsPromoItem = s.SellingStatus.PromotionalSaleDetails != null && s.SellingStatus.PromotionalSaleDetails.StartTime.Date <= System.DateTime.Today.Date && s.SellingStatus.PromotionalSaleDetails.EndTime.Date >= System.DateTime.Today.Date ? true : false, // Height = s.ShippingPackageDetails.PackageDepth != null ? (decimal?)s.ShippingPackageDetails.PackageDepth.Value : null, // Length = s.ShippingPackageDetails.PackageLength != null ? (decimal?)s.ShippingPackageDetails.PackageLength.Value : null, // Width = s.ShippingPackageDetails.PackageWidth != null ? (decimal?)s.ShippingPackageDetails.PackageWidth.Value : null, // //Weight = s.ShippingPackageDetails.WeightMajor != null ? (decimal?)s.ShippingPackageDetails.WeightMajor.Value : null, // //WeightMinor = s.ShippingPackageDetails.WeightMinor != null ? (decimal?)s.ShippingPackageDetails.WeightMinor.Value : null, // CategoryID = s.PrimaryCategory.CategoryID, // CategoryName = s.PrimaryCategory.CategoryName //}).ToList(); } catch (Exception ex) { if (ex.Message.ToLower().Contains("auth token")) throw new InvalidEbayCredentialsException(); else throw ex; } }
/// <summary> /// /// </summary> /// <param name="ApiContext">The <see cref="ApiCall.ApiContext"/> for this API Call of type <see cref="ApiContext"/>.</param> public GetMyeBaySellingCall(ApiContext ApiContext) { ApiRequest = new GetMyeBaySellingRequestType(); this.ApiContext = ApiContext; }
/// <summary> /// /// </summary> public GetMyeBaySellingCall() { ApiRequest = new GetMyeBaySellingRequestType(); }
/// <summary> /// /// </summary> /// <param name="ApiContext">The <see cref="ApiCall.ApiContext"/> for this API Call of type <see cref="ApiContext"/>.</param> public GetMyeBaySellingCall(ApiContext ApiContext) { ApiRequest = new GetMyeBaySellingRequestType(); this.ApiContext = ApiContext; }
/// <summary> /// /// </summary> public GetMyeBaySellingCall() { ApiRequest = new GetMyeBaySellingRequestType(); }
public static void GetMyeBaySelling() { string endpoint = "https://api.ebay.com/wsapi"; string callName = "GetMyeBaySelling"; string siteId = "2"; string version = "949"; // Build the request URL string requestURL = endpoint + "?callname=" + callName + "&siteid=" + siteId + "&appid=" + Settings.AppId + "&version=" + version + "&routing=default"; // Create the service eBayAPIInterfaceService service = new eBayAPIInterfaceService(); // Assign the request URL to the service locator. service.Url = requestURL; // Set credentials service.RequesterCredentials = new CustomSecurityHeaderType(); service.RequesterCredentials.eBayAuthToken = "AgAAAA**AQAAAA**aAAAAA**c8WOVg**nY+sHZ2PrBmdj6wVnY+sEZ2PrA2dj6AAlIeiCpiLoAydj6x9nY+seQ**JiADAA**AAMAAA**sPiqCG+IiAwqtalGeoTnnESc7Br2D+btBopa9arMMDNaOfglryGRHk3tn/aXAj3p2/KmDiKSmYrg51QGFNokYSGUskmH/jjsOtKgoLyTTJZ+3CtWqeAOz/cbrYadAD8l+s6xUfnTk9mWm4BjyAfYqJ1zkNHUC5YaFTk+oaDZPZ9bE7uGjfw1cvQeX6M7TalgTSygqdVV6hOVJZ3I9UPuO66HchFTPvd4n02aZ2UfsXrcYdOpstNdjLuETQIB5tmUWo6uiCwh/r+eiWt8jIycZegb/9uRHzwEy7rW9Tk7fIpIohoBtryYRLUnMJvy9Dg4l++AhFY0yakWJsWu7VHy7eCuz+OI0Pk+E+uOQhgQRzIji96K6/AnBNV9lLiOa6CiI5MdkcrF2Z4Kr4WoxAgy+4WjoUq+PRG8eDHseFWANwOVhmY9qZJq0ulR9SNcXd8FoRiinxzx3f+lO+MgfrRcea2QKKQVoYDI69jKOQ568FVQ6Zp0ClJy9ru/L9IqB87COBLFP6Ie+Zx+2nhgj+GuARYOu2z0Z7kqx+R6H19hIYoxNncQtGi2ruzqWXG+hbFWXTlqrne8IiJr1udgK1ZxJk9FTCCKQCx0s57SXuBkyaM15y2pqC+ze43ZiLGC3wk94pWEACDNRWu4rH27RZTN+ALBoGWkVdSzGxuVfMD164ak4cAJrIiT2OX77FqnLN+MGcVbfJCAu+BREtguSzW6JmM9qHXHBI+4H/jfGruvYoIt2zg7DzMFv50i+hpnLe5F"; // use your token service.RequesterCredentials.Credentials = new UserIdPasswordType(); service.RequesterCredentials.Credentials.AppId = Settings.AppId; service.RequesterCredentials.Credentials.DevId = Settings.DevId; service.RequesterCredentials.Credentials.AuthCert = Settings.CertId; // Make the call GetMyeBaySellingRequestType request = new GetMyeBaySellingRequestType(); request.Version = "949"; var response = service.GetMyeBaySelling(request); Console.WriteLine(response.Timestamp); }