Sample code for 30+ languages & platforms
Ruby

Akeneo: Delete Product

See more HTTP Misc Examples

Demonstrates how to delete product.

Chilkat Ruby Downloads

Ruby
require 'chilkat'

success = false

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

http = Chilkat::CkHttp.new()

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

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

respStr = http.quickDeleteStr("http://pim.my-akeneo-site.com/api/rest/v1/products/{$productCode}")
if (http.get_LastMethodSuccess() != true)
    print http.lastHeader() + "\n";
    print http.lastErrorText() + "\n";
    exit
end

print "Response Status Code: " + http.get_LastStatus().to_s() + "\n";
print "Response Body: " + respStr + "\n";