Sample code for 30+ languages & platforms
Java

Akeneo: Delete Product

See more HTTP Misc Examples

Demonstrates how to delete product.

Chilkat Java Downloads

Java
import com.chilkatsoft.*;

public class ChilkatExample {

  static {
    try {
        System.loadLibrary("chilkat");
    } catch (UnsatisfiedLinkError e) {
      System.err.println("Native code library failed to load.\n" + e);
      System.exit(1);
    }
  }

  public static void main(String argv[])
  {
    boolean success = false;

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

    CkHttp http = new CkHttp();

    // Use your previously obtained access token.
    // See Get Akeneo Access Token
    http.put_AuthToken("access_token");

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

    String respStr = http.quickDeleteStr("http://pim.my-akeneo-site.com/api/rest/v1/products/{$productCode}");
    if (http.get_LastMethodSuccess() != true) {
        System.out.println(http.lastHeader());
        System.out.println(http.lastErrorText());
        return;
        }

    System.out.println("Response Status Code: " + http.get_LastStatus());
    System.out.println("Response Body: " + respStr);
  }
}