Overview

You can use this request to unenroll contacts from an ecommerce workflow.

The Method

API-Method
RESTPOSThttps://[Your URL]/api/3.0/workflows/unenroll

Parameters

PropertyTypeDescriptionDefaultRequiredRead Only
workflow_idintegerThe ID of the Workflow you want to add the contacts to. This can be found by hovering over the checkbox of the Workflow on the Workflow History page.emptyYes No
contact_emailstringEmail address to unenroll from the workflowemptyYesNo

Responses

Success Response

{
    "result":"success", - 200
    "data":{
       "message":" Contact successfully unenrolled from workflow",
  }
}

Error Response

Workflow not found - 404
{
    "result":"error",
    "data":”Workflow does not exist”
}

Workflow not active - 404
{
    "result":"error",
    "data":” Workflow is not active”
}

Error no contact found - 404
{
    "result":"error",
    "data":”A contact with the given email address not found”
}


Code Samples

Example Request

$json = ' { "contacts":{ "1":{ "contact_email":"michael1@email.com", "on_duplicate":"update", "list_id":{"1":"subscribed"} }, "2":{ "contact_email":"michael2@email.com", "on_duplicate":"update", "list_id":{"1":"subscribed"} } } } '; $url = '(Your URL)/api/2.0/contacts/import'; $method = 'POST'; $cSession = curl_init(); $headers = array(); $auth = base64_encode($username . ':' . $apikey); $headers[] = 'Authorization: Basic ' . $auth; curl_setopt($cSession, CURLOPT_URL, $url); curl_setopt($cSession, CURLOPT_RETURNTRANSFER, true); curl_setopt($cSession, CURLOPT_HEADER, false); curl_setopt($cSession, CURLOPT_CUSTOMREQUEST, strtoupper($method)); curl_setopt($cSession, CURLOPT_POSTFIELDS, $json); $headers[] = 'Content-Type: application/json'; curl_setopt($cSession, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($cSession); curl_close($cSession);