(PowerBuilder) Akeneo: Delete Product
Demonstrates how to delete product.
integer li_rc
oleobject loo_Http
integer li_Success
string ls_RespStr
// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
loo_Http = create oleobject
// Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
li_rc = loo_Http.ConnectToNewObject("Chilkat.Http")
if li_rc < 0 then
destroy loo_Http
MessageBox("Error","Connecting to COM object failed")
return
end if
// Use your previously obtained access token.
// See Get Akeneo Access Token
loo_Http.AuthToken = "access_token"
loo_Http.SetUrlVar("productCode","123")
ls_RespStr = loo_Http.QuickDeleteStr("http://pim.my-akeneo-site.com/api/rest/v1/products/{$productCode}")
if loo_Http.LastMethodSuccess <> 1 then
Write-Debug loo_Http.LastHeader
Write-Debug loo_Http.LastErrorText
destroy loo_Http
return
end if
Write-Debug "Response Status Code: " + string(loo_Http.LastStatus)
Write-Debug "Response Body: " + ls_RespStr
destroy loo_Http
|