Overview
CSV Feed
PHP SDK
API Integration
API For Partners
Remove subscriber
This method can be applied on your server-side, when a visitor requests his email to be unsubscribed.
Method: GET
Field | Type | Required | Description |
---|---|---|---|
k | number or text | True | The REST API Key can be found into your account Settings -> Integration -> REST API Key, second field. |
True | Email to unsubscribe | ||
phone | text | False | Subscriber's phone. When present the phone number will be unsubscribed from the mailing list and SMS. |
Your account status must be in one of the states: PAID, PAYMENT ERROR or ACCOUNT SUSPENDED.
If your account is Inactive or Closed the API call will not work.
The API call will respond with JSON format.
Example
<?php require_once "vendor/autoload.php"; $apiURL = "https://api.retargeting.app/v1/"; $apiKey = "MyAPI_REST_Key"; $client = new GuzzleHttp\Client(); $unsubscribeData = [ "k" => $apiKey, "email" => "email@example.com", "phone" => "0712345678" ]; $unsubscribeRequest = $client->request("GET", $apiURL . "subscriber-unsubscribe", ["query" => $unsubscribeData]);
If the API call succeeds, then the response will be as seen below:
{ status: "success", data: null }
The imported subscribers will have the source label details in Settings -> Subscribers -> Subscriber.
If the API call fails, the response will be as seen below:
{ status: "error", data: "Subscriber not found!" }