Sample code for 30+ languages & platforms
C

Akeneo: Delete Product

See more HTTP Misc Examples

Demonstrates how to delete product.

Chilkat C Downloads

C
#include <C_CkHttp.h>

void ChilkatSample(void)
    {
    BOOL success;
    HCkHttp http;
    const char *respStr;

    success = FALSE;

    // 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);

    }