Sample code for 30+ languages & platforms
AutoIt

Walmart v3 Get All Feed Statuses

See more Walmart v3 Examples

Returns the feed statuses for all the specified Feed IDs.

Chilkat AutoIt Downloads

AutoIt
Local $bSuccess = False

; This example assumes the Chilkat API to have been previously unlocked.
; See Global Unlock Sample for sample code.

$oHttp = ObjCreate("Chilkat.Http")

; Implements the following CURL command:

; curl -X GET \
;   https://marketplace.walmartapis.com/v3/feeds?feedId={feedId}&limit={limit}&offset={offset} \
;   -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: application/xml'
;   -H 'Accept: application/xml'

$oHttp.SetRequestHeader "WM_QOS.CORRELATION_ID","b3261d2d-028a-4ef7-8602-633c23200af6"
$oHttp.SetRequestHeader "Content-Type","application/xml"
$oHttp.SetRequestHeader "WM_SEC.ACCESS_TOKEN","eyJraWQiOiIzZjVhYTFmNS1hYWE5LTQzM....."
$oHttp.SetRequestHeader "Accept","application/xml"
$oHttp.SetRequestHeader "WM_SVC.NAME","Walmart Marketplace"

$oSbResponseBody = ObjCreate("Chilkat.StringBuilder")
$bSuccess = $oHttp.QuickGetSb("https://marketplace.walmartapis.com/v3/feeds?feedId={feedId}&limit={limit}&offset={offset}",$oSbResponseBody)
If ($bSuccess = False) Then
    ConsoleWrite($oHttp.LastErrorText & @CRLF)
    Exit
EndIf

$oXmlResponse = ObjCreate("Chilkat.Xml")
$oXmlResponse.LoadSb($oSbResponseBody,True)

; Sample XML response:
; (Sample code for parsing the XML response is shown below)

; <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
; <ns2:list xmlns:ns2="http://walmart.com/">
;     <ns2:totalResults>2</ns2:totalResults>
;     <ns2:offset>0</ns2:offset>
;     <ns2:limit>50</ns2:limit>
;     <ns2:results>
;         <ns2:feed>
;             <ns2:feedId>12234EGGT564YTEGFA@AQMBAQA</ns2:feedId>
;             <ns2:feedSource>MARKETPLACE_PARTNER</ns2:feedSource>
;             <ns2:feedType>item</ns2:feedType>
;             <ns2:partnerId>1413254255</ns2:partnerId>
;             <ns2:itemsReceived>1</ns2:itemsReceived>
;             <ns2:itemsSucceeded>1</ns2:itemsSucceeded>
;             <ns2:itemsFailed>0</ns2:itemsFailed>
;             <ns2:itemsProcessing>0</ns2:itemsProcessing>
;             <ns2:feedStatus>PROCESSED</ns2:feedStatus>
;             <ns2:feedDate>2018-07-20T21:56:12.605Z</ns2:feedDate>
;             <ns2:batchId>HP_REQUEST_BATCH</ns2:batchId>
;             <ns2:modifiedDtm>2018-07-20T21:56:17.948Z</ns2:modifiedDtm>
;             <ns2:fileName>ItemFeed99_ParadiseCounty_paperback.xml</ns2:fileName>
;             <ns2:itemDataErrorCount>0</ns2:itemDataErrorCount>
;             <ns2:itemSystemErrorCount>0</ns2:itemSystemErrorCount>
;             <ns2:itemTimeoutErrorCount>0</ns2:itemTimeoutErrorCount>
;             <ns2:channelType>WM_TEST</ns2:channelType>
;         </ns2:feed>
;         <ns2:feed>
;             <ns2:feedId>12234EGGT564YTEGFA@AQMBAQA</ns2:feedId>
;             <ns2:feedSource>MARKETPLACE_PARTNER</ns2:feedSource>
;             <ns2:feedType>item</ns2:feedType>
;             <ns2:partnerId>1413254255</ns2:partnerId>
;             <ns2:itemsReceived>1</ns2:itemsReceived>
;             <ns2:itemsSucceeded>1</ns2:itemsSucceeded>
;             <ns2:itemsFailed>0</ns2:itemsFailed>
;             <ns2:itemsProcessing>0</ns2:itemsProcessing>
;             <ns2:feedStatus>PROCESSED</ns2:feedStatus>
;             <ns2:feedDate>2018-07-20T21:56:12.605Z</ns2:feedDate>
;             <ns2:batchId>HP_REQUEST_BATCH</ns2:batchId>
;             <ns2:modifiedDtm>2018-07-20T21:56:17.948Z</ns2:modifiedDtm>
;             <ns2:fileName>ItemFeed99_ParadiseCounty_paperback.xml</ns2:fileName>
;             <ns2:itemDataErrorCount>0</ns2:itemDataErrorCount>
;             <ns2:itemSystemErrorCount>0</ns2:itemSystemErrorCount>
;             <ns2:itemTimeoutErrorCount>0</ns2:itemTimeoutErrorCount>
;             <ns2:channelType>WM_TEST</ns2:channelType>
;         </ns2:feed>
;     </ns2:results>
; </ns2:list>

; Sample code for parsing the XML response...
; Use the following online tool to generate parsing code from sample XML:
; Generate Parsing Code from XML

Local $sNs2_list_xmlns_ns2
Local $iNs2_totalResults
Local $iNs2_offset
Local $iNs2_limit
Local $i
Local $iCount_i
Local $sNs2_feedId
Local $sNs2_feedSource
Local $sNs2_feedType
Local $iNs2_partnerId
Local $iNs2_itemsReceived
Local $iNs2_itemsSucceeded
Local $iNs2_itemsFailed
Local $iNs2_itemsProcessing
Local $sNs2_feedStatus
Local $sNs2_feedDate
Local $sNs2_batchId
Local $sNs2_modifiedDtm
Local $sNs2_fileName
Local $iNs2_itemDataErrorCount
Local $iNs2_itemSystemErrorCount
Local $iNs2_itemTimeoutErrorCount
Local $sNs2_channelType

$sNs2_list_xmlns_ns2 = $oXmlResponse.GetAttrValue("xmlns:ns2")
$iNs2_totalResults = $oXmlResponse.GetChildIntValue("ns2:totalResults")
$iNs2_offset = $oXmlResponse.GetChildIntValue("ns2:offset")
$iNs2_limit = $oXmlResponse.GetChildIntValue("ns2:limit")
$i = 0
$iCount_i = $oXmlResponse.NumChildrenHavingTag("ns2:results|ns2:feed")
While $i < $iCount_i
    $oXmlResponse.I = $i
    $sNs2_feedId = $oXmlResponse.GetChildContent("ns2:results|ns2:feed[i]|ns2:feedId")
    $sNs2_feedSource = $oXmlResponse.GetChildContent("ns2:results|ns2:feed[i]|ns2:feedSource")
    $sNs2_feedType = $oXmlResponse.GetChildContent("ns2:results|ns2:feed[i]|ns2:feedType")
    $iNs2_partnerId = $oXmlResponse.GetChildIntValue("ns2:results|ns2:feed[i]|ns2:partnerId")
    $iNs2_itemsReceived = $oXmlResponse.GetChildIntValue("ns2:results|ns2:feed[i]|ns2:itemsReceived")
    $iNs2_itemsSucceeded = $oXmlResponse.GetChildIntValue("ns2:results|ns2:feed[i]|ns2:itemsSucceeded")
    $iNs2_itemsFailed = $oXmlResponse.GetChildIntValue("ns2:results|ns2:feed[i]|ns2:itemsFailed")
    $iNs2_itemsProcessing = $oXmlResponse.GetChildIntValue("ns2:results|ns2:feed[i]|ns2:itemsProcessing")
    $sNs2_feedStatus = $oXmlResponse.GetChildContent("ns2:results|ns2:feed[i]|ns2:feedStatus")
    $sNs2_feedDate = $oXmlResponse.GetChildContent("ns2:results|ns2:feed[i]|ns2:feedDate")
    $sNs2_batchId = $oXmlResponse.GetChildContent("ns2:results|ns2:feed[i]|ns2:batchId")
    $sNs2_modifiedDtm = $oXmlResponse.GetChildContent("ns2:results|ns2:feed[i]|ns2:modifiedDtm")
    $sNs2_fileName = $oXmlResponse.GetChildContent("ns2:results|ns2:feed[i]|ns2:fileName")
    $iNs2_itemDataErrorCount = $oXmlResponse.GetChildIntValue("ns2:results|ns2:feed[i]|ns2:itemDataErrorCount")
    $iNs2_itemSystemErrorCount = $oXmlResponse.GetChildIntValue("ns2:results|ns2:feed[i]|ns2:itemSystemErrorCount")
    $iNs2_itemTimeoutErrorCount = $oXmlResponse.GetChildIntValue("ns2:results|ns2:feed[i]|ns2:itemTimeoutErrorCount")
    $sNs2_channelType = $oXmlResponse.GetChildContent("ns2:results|ns2:feed[i]|ns2:channelType")
    $i = $i + 1
Wend