I can successfully make API calls for other Walmart API endpoints (in particular, endpoints of a GET request), but the mass element endpoint (POST request) leads to errors, although I seem to be all right.
Here is a link to this endpoint https://developer.walmartapis.com/#bulk-createupdate-items
HTTP RESPONSE INFORMATION
500 Internal Server Error
XML
HTTP RESPONSE
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ns2:errors xmlns:ns2="http://walmart.com/"> <ns2:error> <ns2:code>SYSTEM_ERROR.GMP_GATEWAY_API</ns2:code> <ns2:description>Couldn't determine the boundary from the message!</ns2:description> <ns2:info>System encountered some internal error.</ns2:info> <ns2:severity>ERROR</ns2:severity> <ns2:category>DATA</ns2:category> <ns2:causes/> <ns2:errorIdentifiers/> </ns2:error> </ns2:errors>
HTTP REQUEST:
URL https://marketplace.walmartapis.com/v2/feeds?feedType=item
post method
request headers
WM_SVC.NAME: Walmart Marketplace WM_CONSUMER.ID: {my consumer id key} WM_QOS.CORRELATION_ID: {my arbitrary text key} Content-Type: multipart/form-data Accept: application/xml WM_SEC.AUTH_SIGNATURE:{my jar-file-generated key} WM_SEC.TIMESTAMP:{my jar-file-generated timestamp}
POST payload (text only, no key for parameter)
<?xml version="1.0" encoding="UTF-8"?> <MPItemFeed xmlns="http://walmart.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://walmart.com/ MPItem.xsd "> <MPItemFeedHeader> <version>2.1</version> <requestId>qqq</requestId> <requestBatchId>qqq1</requestBatchId> </MPItemFeedHeader> <MPItem> <sku>qqq</sku> <Product> <productName>QQQ 1-Foot S-Video Male to 2 S-Video Female Y Cable (CSV2F)</productName> <longDescription><![CDATA[<div class="productDescriptionWrapper"> QVS Premium S-Video Mini4 Male to Two Female Splitter Cable CSV2F A/V Device Cables <div class="emptyClear"> </div> </div>]]></longDescription> <shelfDescription><![CDATA[QVS 1-Foot S-Video Male to 2 S-Video Female Y Cable (CSV2F)]]></shelfDescription> <shortDescription>QQQ 1-Foot S-Video Male to 2 S-Video Female Y Cable (CSV2F)</shortDescription> <mainImage> <mainImageUrl>http://images.antonline.com/img-main/500/037229400328.jpg</mainImageUrl> </mainImage> <productIdentifiers> <productIdentifier> <productIdType>Item ID</productIdType> <productId>46817049</productId> </productIdentifier> </productIdentifiers> <productTaxCode>2038710</productTaxCode> <Electronics> <brand>QQQ</brand> <ElectronicsCables> </ElectronicsCables> </Electronics> </Product> <price> <currency>USD</currency> <amount>12.34</amount> </price> <shippingWeight> <value>1.234</value> <unit>LB</unit> </shippingWeight> </MPItem> </MPItemFeed>
NOTES:
I tried using Google's "Advanced REST Client Application" as well as POSTMAN when making HTTP requests to eliminate issues related to my code.
I tried to tweak everything that came to mind.
I have other endpoints with GET requests, so I know this is not a problem with authentication, IP, firewall, or something like that.
I know the credentials created by the jar file provided by walmart (see the authentication section of the document https://developer.walmartapis.com/#jar-executable-recommended ) the URL you submit should be sent. Therefore, I know that this is not a problem generating the wrong key with the jar file.
Hypotheses:
- Based on the answer, something should be wrong with the data or headers that I am sending.
Could not determine border from message!
sounds like xml doesn't have symmetric tags, but I checked this xml
- The walmart api documentation for this endpoint says to use the
Content-Type: multipart/form-data; header Content-Type: multipart/form-data; . So what I did leads to failure.
But using this header does not make sense to me, since the payload body is an xml string. Shouldn't it be Content-Type: application/xml ? I tried this too, but it failed with the failed answer above (500, SYSTEM_ERROR.GMP_GATEWAY_API, Failed to determine the border from the message!)
Thus, it seems that Content-Type: application/xml can be excluded.
- The walmart api documentation only gives an example of how to change the product or sku identifier, but not to create. I assume that I just omit the xml tags specific to updating the product id or sku, but this xml payload also leads to a 500 response.
I have no ideas, has anyone else got the opportunity to create / update elements for work? Does anyone have some sample code that really works?