Overview
This request allows you to delete transactional unsubscribe suppressions by email address.
An email address is specified by which the unsubscribe suppression will be removed. If it is successful, the API will respond with a 1 and if it is not successful, a JSON object will be returned with an error message. The most common cause for a failure would be if the email address specified doesn’t have an unsubscribe suppression for transactional.
The Method
API | - | Method |
---|---|---|
REST | DELETE | https://[Your URL]/api/2.0/trans_suppressions/unsubscribe/:email |
Your URL is the address of your install.
Parameters
Property | Type | Description | Default | Required | Read Only |
---|---|---|---|---|---|
string | Email address to delete unsubscribe suppression for | N/A | Yes | No |
Code Samples
Example Request
<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://[your url]/api/2.0/trans_suppressions/unsubscribe/[email protected] CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "DELETE", CURLOPT_POSTFIELDS =>"{}", CURLOPT_HTTPHEADER => array( "Authorization: Basic [base64 encoded string of username and password]", "Content-Type: application/json", ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
Example Response
Success: 1
Error (when a suppression for that email doesn’t exist):
{ "links": [ { "title": "Self", "rel": "self", "href": "http://[your url]/api/2.0/trans_suppressions/[email protected]" }, { "title": "Home", "rel": "home", "href": "http://[your url]/api/2.0/" } ], "error": { "code": "10404", "message": "Transactional Mail Error Occured: Requested Resource Not Found", "additional": null } }