I am trying to authenticate to walmart.com using Token-based authentication (New preferred method) on vba. You can read more here: https://developer.walmart.com/#/apicenter/marketPlace/latest#introduction
What can be the reason for the error message? How to fix this error? After all, Consumer id is not required in the code.
Base64EncodeString is my personal function. I checked how it works by comparing the result with web resources.
WalmartAPIUserKey - my ClientID
WalmartSecretKey - my ClientSecret
Dim xmlhttp As New MSXML2.XMLHTTP60
Dim encodeData As String
encodeData = Base64EncodeString(WalmartAPIUserKey & ":" & WalmartSecretKey)
xmlhttp.Open "POST", "https://marketplace.walmartapis.com/v3/token", False
xmlhttp.SetRequestHeader "WM_SVC.NAME", "Walmart marketplace"
xmlhttp.SetRequestHeader "WM_QOS.CORRELATION_ID", "123456abcdef"
xmlhttp.SetRequestHeader "Authorization", "Basic " & encodeData
xmlhttp.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
xmlhttp.SetRequestHeader "Accept", "application/xml"
xmlhttp.send
MsgBox (xmlhttp.responseText)
Debug.Print (xmlhttp.responseText)
Set xmlhttp = Nothing
However, I get the following error:
<?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>consumer id not found in PRS</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>