Sample code for 30+ languages & platforms
VBScript

Woo Commerce Authenticate with Query Params

See more WooCommerce Examples

Demonstrates how to authenticate with Woo Commerce over HTTPS using query params instead of HTTP Basic Authentication.

Chilkat VBScript Downloads

VBScript
Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
'Create a Unicode (utf-16) output text file.
Set outFile = fso.CreateTextFile("output.txt", True, True)

success = 0

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

set http = CreateObject("Chilkat.Http")

' To authentication over HTTPS using query params, put the query params in the URL.
set sbResponseBody = CreateObject("Chilkat.StringBuilder")
success = http.QuickGetSb("https://example.com/wp-json/wc/v3/products?consumer_key=ck_52bf39999999999999999999999999999996da4d&consumer_secret=cs_6e8bb99999999999999999999999999999997054",sbResponseBody)
If (success = 0) Then
    outFile.WriteLine(http.LastErrorText)
    WScript.Quit
End If

outFile.WriteLine("Response Body:")
outFile.WriteLine(sbResponseBody.GetAsString())

respStatusCode = http.LastStatus
outFile.WriteLine("Response Status Code = " & respStatusCode)
If (respStatusCode >= 400) Then
    outFile.WriteLine("Response Header:")
    outFile.WriteLine(http.LastHeader)
    outFile.WriteLine("Failed.")
    WScript.Quit
End If


outFile.Close