Пример #1
0
        /**
         * Perform GET request to get product offers..
         *
         * @param marketplace the marketplace from which the products shall be exported Please see {@link ListMarketplaces } for choose available marketplace.
         * @param format      support  Format.JSON and  Format.CSV (optional, if don't set, default Format.JSON
         * @param sortBy      support SortBy.TOTAL_PRICE, SortBy.SHIPPING_COST, SortBy.RANKING  and SortBy.PRICE (optional, default value SortBy.RANKING)
         * @param offerId     return only the offers with the given index after sorting them. If no offeridx is given, it will return all offers
         * @param productsIds A (possibly comma- separated list of) product IDs whose data is to be exported. If this parameter is not specified, all products will be exported
         * @param pformat_dec support Pformat_dec.INTEGER and Pformat_dec.FLOAT (optional, default Pformat_dec.INTEGER)
         * @param exportAll   support ExportAll.TRUE and ExportAll.FALSE (optional, default Export.TRUE)
         * @return response from monitor price server
         */

        public void GetProductOffers(ref String response,
                                     String marketplace,
                                     Format format             = Format.JSON,
                                     SortBy sortBy             = SortBy.RANKING,
                                     int offerId               = 0,
                                     List <String> productsIds = null,
                                     Pformat_dec pformat_dec   = Pformat_dec.INTEGER,
                                     ExportAll exportAll       = ExportAll.TRUE)
        {
            CheckMarketplace(marketplace);

            String products = ConvertListToString(productsIds);

            String fullUrl = BASE_URL +
                             apiKey +
                             PATH_SEPAR +
                             Action.EXPORT.ToString().ToLower() +
                             QUERY_BEGIN +
                             GetQuery(marketplace, "marketplace") +
                             GetQuery(format) +
                             GetQuery(sortBy) +
                             (offerId > 0 ? GetQuery(offerId, "offeridx") : "") +
                             GetQuery(products, "ids") +
                             GetQuery(pformat_dec) +
                             GetQuery(exportAll);


            DoRequest(ref response, Method.GET, fullUrl);
        }
Пример #2
0
        /**
         * Perform GET request to get price updates.
         *
         * @param marketplace the marketplace from which the products shall be exported Please see {@link ListMarketplaces } for choose available marketplace.
         * @param id          product Id (optional), get an update only for the product with the specified internal product id (SKU).
         * @param format      support  Format.JSON and  Format.CSV (optional, if don't set, default Format.JSON)
         * @param pformat_dec support Pformat_dec.INTEGER and Pformat_dec.FLOAT (optional, default Pformat_dec.INTEGER)
         * @param exportAll   support ExportAll.TRUE and ExportAll.FALSE (optional, default Export.TRUE)
         * @param test        support Test.TRUE and Test.FALSE (optional, defautl Test.FALSE)
         * @return response from monitor price server
         */
        public void GetPriceUpdates(ref String response,
                                    String marketplace,
                                    String id               = null,
                                    Format format           = Format.JSON,
                                    Pformat_dec pformat_dec = Pformat_dec.INTEGER,
                                    ExportAll exportAll     = ExportAll.TRUE,
                                    Test test               = Test.FALSE)
        {
            CheckMarketplace(marketplace);

            String fullUrl = BASE_URL +
                             apiKey +
                             PATH_SEPAR +
                             Action.GET_PRICE_UPDATES.ToString().ToLower() +
                             QUERY_BEGIN +
                             GetQuery(marketplace, "marketplace") +
                             GetQuery(id, "id") +
                             GetQuery(format) +
                             GetQuery(pformat_dec) +
                             GetQuery(exportAll) +
                             GetQuery(test);


            DoRequest(ref response, Method.GET, fullUrl);
        }
Пример #3
0
        /**
         * Perform GET request to get reprice settings.
         *
         * @param marketplace the marketplace from which the products shall be exported Please see {@link ListMarketplaces } for choose available marketplace.
         * @param productsIds a  list of of product IDs whose settings are to be exported.
         * @param format      support  Format.JSON and  Format.CSV (optional, if don't set, default Format.JSON
         * @param pformat_dec support Pformat_dec.INTEGER and Pformat_dec.FLOAT (optional, default Pformat_dec.INTEGER)
         * @return response from monitor price server
         */

        public void GetRepriceSettings(ref String response,
                                       String marketplace,
                                       List <String> productsIds,
                                       Format format           = Format.JSON,
                                       Pformat_dec pformat_dec = Pformat_dec.INTEGER)
        {
            CheckMarketplace(marketplace);
            String products = ConvertListToString(productsIds);

            String fullUrl = BASE_URL +
                             apiKey +
                             PATH_SEPAR +
                             Action.REPRICE_SETTINGS.ToString().ToLower() +
                             QUERY_BEGIN +
                             GetQuery(marketplace, "marketplace") +
                             GetQuery(products, "ids") +
                             GetQuery(format) +
                             GetQuery(pformat_dec);


            DoRequest(ref response, Method.GET, fullUrl);
        }