(VBScript) Shopify Basic Authentication: Get List of Products
Demonstrates how to send a simple HTTP GET request with Basic authentication to get a list of products.
Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
'Create a Unicode (utf-16) output text file.
Set outFile = fso.CreateTextFile("output.txt", True, True)
' This example requires the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.
' For versions of Chilkat < 10.0.0, use CreateObject("Chilkat_9_5_0.Http")
set http = CreateObject("Chilkat.Http")
' Use your Shopify store's Admin API key and password.
http.Login = "admin3_api_key"
http.Password = "admin3_password"
http.BasicAuth = 1
jsonStr = http.QuickGetStr("https://mystore.myshopify.com/admin/api/2020-07/products.json")
If (http.LastMethodSuccess <> 1) Then
outFile.WriteLine(http.LastErrorText)
WScript.Quit
End If
outFile.WriteLine("Response status code: " & http.LastStatus)
outFile.WriteLine("JSON response:")
outFile.WriteLine(jsonStr)
outFile.Close
|