Overview
You can use this request to unenroll contacts from an ecommerce workflow.
The Method
| API | - | Method |
|---|---|---|
| REST | POST | https://[Your URL]/api/3.0/workflows/unenroll |
Your URL is the address of your install.
Parameters
| Property | Type | Description | Default | Required | Read Only |
|---|---|---|---|---|---|
| workflow_id | integer | The 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. | empty | Yes | No |
| contact_email | string | Email address to unenroll from the workflow | empty | Yes | No |
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":"[email protected]", "on_duplicate":"update", "list_id":{"1":"subscribed"} }, "2":{ "contact_email":"[email protected]", "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);