InvokeDelete()

Invokes the Delete method on a Marketing Cloud Engagement API Object and returns the API status code. Use an ID, external ID, or key as the object reference.

The InvokeDelete() function has four parameters:

  • apiObject (API Object): Required. The API Object to delete.
  • statusMessage (AMPscript variable): Required. An AMPscript variable that stores the API status message.
  • errorCode (AMPscript variable): Required. An AMPscript variable that stores the API error code.
  • deleteOptionsObject (API Object): A DeleteOptions API object.

This example creates a Subscriber API Object and sets a property on it. It then deletes the Object and outputs the status code. If the status code doesn’t equal "OK," it outputs the status message and error code.