Sample code for 30+ languages & platforms
PowerBuilder

Walmart v3 Get All Feed Statuses

See more Walmart v3 Examples

Returns the feed statuses for all the specified Feed IDs.

Chilkat PowerBuilder Downloads

PowerBuilder
integer li_rc
long li_Success
oleobject loo_Http
oleobject loo_SbResponseBody
oleobject loo_XmlResponse
string ls_Ns2_list_xmlns_ns2
long li_Ns2_totalResults
long li_Ns2_offset
long li_Ns2_limit
long i
long li_Count_i
string ls_Ns2_feedId
string ls_Ns2_feedSource
string ls_Ns2_feedType
long li_Ns2_partnerId
long li_Ns2_itemsReceived
long li_Ns2_itemsSucceeded
long li_Ns2_itemsFailed
long li_Ns2_itemsProcessing
string ls_Ns2_feedStatus
string ls_Ns2_feedDate
string ls_Ns2_batchId
string ls_Ns2_modifiedDtm
string ls_Ns2_fileName
long li_Ns2_itemDataErrorCount
long li_Ns2_itemSystemErrorCount
long li_Ns2_itemTimeoutErrorCount
string ls_Ns2_channelType

li_Success = 0

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

loo_Http = create oleobject
li_rc = loo_Http.ConnectToNewObject("Chilkat.Http")
if li_rc < 0 then
    destroy loo_Http
    MessageBox("Error","Connecting to COM object failed")
    return
end if

//  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'

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

loo_SbResponseBody = create oleobject
li_rc = loo_SbResponseBody.ConnectToNewObject("Chilkat.StringBuilder")

li_Success = loo_Http.QuickGetSb("https://marketplace.walmartapis.com/v3/feeds?feedId={feedId}&limit={limit}&offset={offset}",loo_SbResponseBody)
if li_Success = 0 then
    Write-Debug loo_Http.LastErrorText
    destroy loo_Http
    destroy loo_SbResponseBody
    return
end if

loo_XmlResponse = create oleobject
li_rc = loo_XmlResponse.ConnectToNewObject("Chilkat.Xml")

loo_XmlResponse.LoadSb(loo_SbResponseBody,1)

//  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

ls_Ns2_list_xmlns_ns2 = loo_XmlResponse.GetAttrValue("xmlns:ns2")
li_Ns2_totalResults = loo_XmlResponse.GetChildIntValue("ns2:totalResults")
li_Ns2_offset = loo_XmlResponse.GetChildIntValue("ns2:offset")
li_Ns2_limit = loo_XmlResponse.GetChildIntValue("ns2:limit")
i = 0
li_Count_i = loo_XmlResponse.NumChildrenHavingTag("ns2:results|ns2:feed")
do while i < li_Count_i
    loo_XmlResponse.I = i
    ls_Ns2_feedId = loo_XmlResponse.GetChildContent("ns2:results|ns2:feed[i]|ns2:feedId")
    ls_Ns2_feedSource = loo_XmlResponse.GetChildContent("ns2:results|ns2:feed[i]|ns2:feedSource")
    ls_Ns2_feedType = loo_XmlResponse.GetChildContent("ns2:results|ns2:feed[i]|ns2:feedType")
    li_Ns2_partnerId = loo_XmlResponse.GetChildIntValue("ns2:results|ns2:feed[i]|ns2:partnerId")
    li_Ns2_itemsReceived = loo_XmlResponse.GetChildIntValue("ns2:results|ns2:feed[i]|ns2:itemsReceived")
    li_Ns2_itemsSucceeded = loo_XmlResponse.GetChildIntValue("ns2:results|ns2:feed[i]|ns2:itemsSucceeded")
    li_Ns2_itemsFailed = loo_XmlResponse.GetChildIntValue("ns2:results|ns2:feed[i]|ns2:itemsFailed")
    li_Ns2_itemsProcessing = loo_XmlResponse.GetChildIntValue("ns2:results|ns2:feed[i]|ns2:itemsProcessing")
    ls_Ns2_feedStatus = loo_XmlResponse.GetChildContent("ns2:results|ns2:feed[i]|ns2:feedStatus")
    ls_Ns2_feedDate = loo_XmlResponse.GetChildContent("ns2:results|ns2:feed[i]|ns2:feedDate")
    ls_Ns2_batchId = loo_XmlResponse.GetChildContent("ns2:results|ns2:feed[i]|ns2:batchId")
    ls_Ns2_modifiedDtm = loo_XmlResponse.GetChildContent("ns2:results|ns2:feed[i]|ns2:modifiedDtm")
    ls_Ns2_fileName = loo_XmlResponse.GetChildContent("ns2:results|ns2:feed[i]|ns2:fileName")
    li_Ns2_itemDataErrorCount = loo_XmlResponse.GetChildIntValue("ns2:results|ns2:feed[i]|ns2:itemDataErrorCount")
    li_Ns2_itemSystemErrorCount = loo_XmlResponse.GetChildIntValue("ns2:results|ns2:feed[i]|ns2:itemSystemErrorCount")
    li_Ns2_itemTimeoutErrorCount = loo_XmlResponse.GetChildIntValue("ns2:results|ns2:feed[i]|ns2:itemTimeoutErrorCount")
    ls_Ns2_channelType = loo_XmlResponse.GetChildContent("ns2:results|ns2:feed[i]|ns2:channelType")
    i = i + 1
loop


destroy loo_Http
destroy loo_SbResponseBody
destroy loo_XmlResponse