Looking for a VBA / HTTPS guru who can troubleshoot our simple function which aims to update a product on Shopify using JSON.
We already have this feature working in PHP so we know we have correct credential, url values.
This is what we have so far, the open method triggers an error "Invalid procedure call or argument".
Public Function sfyExec()
Dim sAPI_KEY As String
Dim sPASSWORD As String
Dim sSTORE_URL As String
Dim sTargetURL As String
Dim sTESTPRODUCTNUMBER As String
Dim sData As String
Dim HTTPReq As Object
sAPI_KEY = "xxxxxxxx"
sPASSWORD = "xxxxxxx"
sSTORE_URL = "xxxxxxx"
sTESTPRODUCTNUMBER = "xxxxxxxx"
sTargetURL = "https://" & sAPI_KEY & ":" & sPASSWORD & "@" & sSTORE_URL & "/admin/products/" & sTESTPRODUCTNUMBER & ".json"
sData = "{product: {""id"": 5961033925, ""body_html"": ""<h1>...penguin...</h1>""}}"
Set HTTPReq = CreateObject("WinHttp.WinHttpRequest.5.1")
[login to view URL](4) = 13056 ' The actual value for [login to view URL](WinHttpRequestOption_SslErrorIgnoreFlags) that I have set to 13056 (hexadecimal 0x3300) is an addition of all switches found at the WinHttpRequestOption documentation at WinHttpRequestOption_SslErrorIgnoreFlags.
[login to view URL] "PUT", TargetURL, False
[login to view URL] sAPI_KEY, sPASSWORD, 0
[login to view URL] "Content-Type", "application/json"
[login to view URL] "Accept", "application/json"
[login to view URL] (sData)
MsgBox ([login to view URL])
End Function
I'm PHP and VBA expert with many completed projects that's why I'm sure you'll be impressed with my work.
I can help you if you show me working PHP script and let me run it couple of times (may be I'll not need to run it).
Thanks.
Roman