(VBScript) Akeneo: Delete Product
Demonstrates how to delete product.
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 previously obtained access token.
' See Get Akeneo Access Token
http.AuthToken = "access_token"
success = http.SetUrlVar("productCode","123")
respStr = http.QuickDeleteStr("http://pim.my-akeneo-site.com/api/rest/v1/products/{$productCode}")
If (http.LastMethodSuccess <> 1) Then
outFile.WriteLine(http.LastHeader)
outFile.WriteLine(http.LastErrorText)
WScript.Quit
End If
outFile.WriteLine("Response Status Code: " & http.LastStatus)
outFile.WriteLine("Response Body: " & respStr)
outFile.Close
|