(VBScript) Shopify Delete Product
Delete a product from the shop.
Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
'Create a Unicode (utf-16) output text file.
Set outFile = fso.CreateTextFile("output.txt", True, True)
' For versions of Chilkat < 10.0.0, use CreateObject("Chilkat_9_5_0.Rest")
set rest = CreateObject("Chilkat.Rest")
success = rest.SetAuthBasic("SHOPIFY_PRIVATE_API_KEY","SHOPIFY_PRIVATE_API_SECRET_KEY")
success = rest.Connect("chilkat.myshopify.com",443,1,1)
If (success <> 1) Then
outFile.WriteLine(rest.LastErrorText)
WScript.Quit
End If
' For versions of Chilkat < 10.0.0, use CreateObject("Chilkat_9_5_0.StringBuilder")
set sbResponse = CreateObject("Chilkat.StringBuilder")
success = rest.FullRequestNoBodySb("DELETE","/admin/products/#{id}.json",sbResponse)
If (success <> 1) Then
outFile.WriteLine(rest.LastErrorText)
WScript.Quit
End If
If (rest.ResponseStatusCode <> 200) Then
outFile.WriteLine("Received error response code: " & rest.ResponseStatusCode)
outFile.WriteLine("Response body:")
outFile.WriteLine(sbResponse.GetAsString())
WScript.Quit
End If
outFile.WriteLine("Example Completed.")
outFile.Close
|