Rust Requires Chilkat v11.0.0+
Rust
Walmart v3 Bulk Item Setup
See more Walmart v3 Examples
Updates items in bulk.Chilkat Rust Downloads
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
let http = chilkat::Http::new();
// Implements the following CURL command:
// curl -X POST \
// https://marketplace.walmartapis.com/v3/feeds?feedType=item \
// -H 'WM_SVC.NAME: Walmart Marketplace'
// -H 'WM_SEC.ACCESS_TOKEN: eyJraWQiOiIzZjVhYTFmNS1hYWE5LTQzM.....'
// -H 'WM_QOS.CORRELATION_ID: b3261d2d-028a-4ef7-8602-633c23200af6'
// -H 'Content-Type: multipart/form-data'
// -H 'Accept: application/xml'
// -F feed=@qa_data/walmart/itemFeed.xml
let req = chilkat::HttpRequest::new();
req.set_http_verb("POST");
req.set_path("/v3/feeds?feedType=item");
req.set_content_type("multipart/form-data");
let _ = req.add_file_for_upload2("feed", "qa_data/walmart/itemFeed.xml", "application/xml").is_ok();
req.add_header("WM_QOS.CORRELATION_ID", "b3261d2d-028a-4ef7-8602-633c23200af6");
req.add_header("Expect", "100-continue");
req.add_header("Content-Type", "multipart/form-data");
req.add_header("WM_SEC.ACCESS_TOKEN", "eyJraWQiOiIzZjVhYTFmNS1hYWE5LTQzM.....");
req.add_header("Accept", "application/xml");
req.add_header("WM_SVC.NAME", "Walmart Marketplace");
let resp = chilkat::HttpResponse::new();
if http.http_s_req("marketplace.walmartapis.com", 443, true, &req, &resp).is_err() {
println!("{}", http.last_error_text());
return;
}
let sb_response_body = chilkat::StringBuilder::new();
let _ = resp.get_body_sb(&sb_response_body);
let xml_response = chilkat::Xml::new();
let _ = xml_response.load_sb(&sb_response_body, true);
println!("{}", xml_response.get_xml().unwrap_or_default());
// Sample XML response:
// (Sample code for parsing the XML response is shown below)
// <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
// <FeedAcknowledgement xmlns:ns2="http://walmart.com/">
// <feedId>E9C04D1FFD99479FBC1341D56DD5F930@AQMB_wA</feedId>
// </FeedAcknowledgement>
// Sample code for parsing the XML response...
// Use the following online tool to generate parsing code from sample XML:
// Generate Parsing Code from XML
let feed_acknowledgement_xmlns_ns2 = xml_response.get_attr_value("xmlns:ns2").unwrap_or_default();
let feed_id = xml_response.get_child_content("feedId").unwrap_or_default();