Home / Subscriber / forgetById
forget a subscriber from the database by id. If the subscriber is subscribed the subscriber is then being unsubscribed and forgotten, else it will look for the archived subscriber and deleting the data.
The following errors can occur:
- Token not present in request.
- Token not in the required format.
- Session does not exist.
- Session has expired.
- The user does not exist.
- No database specified.
- Database parameter not in correct format.
- You are not allowed to access this database.
- The id parameter is required.
- The id parameter is invalid.
- The parameter perfomed should be subscriber or listowner (defaults to subscriber).
- The selected archived subscriber is already forgotten
- Failed to unsubscribe the subscriber.
- Failed to forget the subscriber, but the subscribers is unsubscribed
- The given email does not exist in our database
You should call this function as followed:
- rest/v2/subscriber/forgetById?token=TOKEN&database=DATABASE_ID&id=SUBSCRIBER_ID&performed=subscriber&reason=STRING
require_once 'Rest.php';
$username = 'my_username';
$password = 'my_password';
$database = '999';
$rest = new Rest($username, $password, $database);
$result = $rest->call('subscriber/forgetById', [
'id' => 'SUBSCRIBER_ID',
'performed' => 'subscriber',
'reason' => 'STRING'
], 'GET');
var_dump($result);
The following parameters this method can/should be called with:
key: id
values: integer, required
what: The ID of the subscriber or archived subscriber
key: performed
values: string ('subscriber' or 'listowner'), standard uses 'subscriber', not required
what: By who is this action performed
key: reason
values: string, not required
what: What is the reason of the unsubscribe
The following items:
- user/login For the TOKEN.
- user/database For the DATABASE_ID
- subscriber/findByEmail For the SUBSCRIBER_ID
- subscriber/findArchivedById For the SUBSCRIBER_ARCHIVE_ID