Sample code for 30+ languages & platforms
JavaScript

Akeneo: Delete Product

See more HTTP Misc Examples

Demonstrates how to delete product.
Note
This example is intended for running within a Chilkat.Js embedded JavaScript engine. All Chilkat JavaScript examples require Chilkat v11.4.0 or greater.
JavaScript
var success = false;

// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.

var http = new CkHttp();

// Use your previously obtained access token.
// See Get Akeneo Access Token
http.AuthToken = "access_token";

http.SetUrlVar("productCode","123");

var respStr = http.QuickDeleteStr("http://pim.my-akeneo-site.com/api/rest/v1/products/{$productCode}");
if (http.LastMethodSuccess !== true) {
    console.log(http.LastHeader);
    console.log(http.LastErrorText);
    return;
}

console.log("Response Status Code: " + http.LastStatus);
console.log("Response Body: " + respStr);