(C) Akeneo: Delete Product
Demonstrates how to delete product.
#include <C_CkHttp.h>
void ChilkatSample(void)
{
HCkHttp http;
BOOL success;
const char *respStr;
// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
http = CkHttp_Create();
// Use your previously obtained access token.
// See Get Akeneo Access Token
CkHttp_putAuthToken(http,"access_token");
CkHttp_SetUrlVar(http,"productCode","123");
respStr = CkHttp_quickDeleteStr(http,"http://pim.my-akeneo-site.com/api/rest/v1/products/{$productCode}");
if (CkHttp_getLastMethodSuccess(http) != TRUE) {
printf("%s\n",CkHttp_lastHeader(http));
printf("%s\n",CkHttp_lastErrorText(http));
CkHttp_Dispose(http);
return;
}
printf("Response Status Code: %d\n",CkHttp_getLastStatus(http));
printf("Response Body: %s\n",respStr);
CkHttp_Dispose(http);
}
|