(Unicode C) Akeneo: Delete Product
Demonstrates how to delete product.
#include <C_CkHttpW.h>
void ChilkatSample(void)
{
HCkHttpW http;
BOOL success;
const wchar_t *respStr;
// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
http = CkHttpW_Create();
// Use your previously obtained access token.
// See Get Akeneo Access Token
CkHttpW_putAuthToken(http,L"access_token");
CkHttpW_SetUrlVar(http,L"productCode",L"123");
respStr = CkHttpW_quickDeleteStr(http,L"http://pim.my-akeneo-site.com/api/rest/v1/products/{$productCode}");
if (CkHttpW_getLastMethodSuccess(http) != TRUE) {
wprintf(L"%s\n",CkHttpW_lastHeader(http));
wprintf(L"%s\n",CkHttpW_lastErrorText(http));
CkHttpW_Dispose(http);
return;
}
wprintf(L"Response Status Code: %d\n",CkHttpW_getLastStatus(http));
wprintf(L"Response Body: %s\n",respStr);
CkHttpW_Dispose(http);
}
|