Sample code for 30+ languages & platforms
PureBasic

Akeneo: Delete Product

See more HTTP Misc Examples

Demonstrates how to delete product.

Chilkat PureBasic Downloads

PureBasic
IncludeFile "CkHttp.pb"

Procedure ChilkatExample()

    success.i = 0

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

    http.i = CkHttp::ckCreate()
    If http.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    ; Use your previously obtained access token.
    ; See Get Akeneo Access Token
    CkHttp::setCkAuthToken(http, "access_token")

    CkHttp::ckSetUrlVar(http,"productCode","123")

    respStr.s = CkHttp::ckQuickDeleteStr(http,"http://pim.my-akeneo-site.com/api/rest/v1/products/{$productCode}")
    If CkHttp::ckLastMethodSuccess(http) <> 1
        Debug CkHttp::ckLastHeader(http)
        Debug CkHttp::ckLastErrorText(http)
        CkHttp::ckDispose(http)
        ProcedureReturn
    EndIf

    Debug "Response Status Code: " + Str(CkHttp::ckLastStatus(http))
    Debug "Response Body: " + respStr


    CkHttp::ckDispose(http)


    ProcedureReturn
EndProcedure