(DataFlex) Akeneo: Delete Product
Demonstrates how to delete product.
Use ChilkatAx-win32.pkg
Procedure Test
Handle hoHttp
Boolean iSuccess
String sRespStr
String sTemp1
Integer iTemp1
Boolean bTemp1
// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
Get Create (RefClass(cComChilkatHttp)) To hoHttp
If (Not(IsComObjectCreated(hoHttp))) Begin
Send CreateComObject of hoHttp
End
// Use your previously obtained access token.
// See Get Akeneo Access Token
Set ComAuthToken Of hoHttp To "access_token"
Get ComSetUrlVar Of hoHttp "productCode" "123" To iSuccess
Get ComQuickDeleteStr Of hoHttp "http://pim.my-akeneo-site.com/api/rest/v1/products/{$productCode}" To sRespStr
Get ComLastMethodSuccess Of hoHttp To bTemp1
If (bTemp1 <> True) Begin
Get ComLastHeader Of hoHttp To sTemp1
Showln sTemp1
Get ComLastErrorText Of hoHttp To sTemp1
Showln sTemp1
Procedure_Return
End
Get ComLastStatus Of hoHttp To iTemp1
Showln "Response Status Code: " iTemp1
Showln "Response Body: " sRespStr
End_Procedure
|