legacy.delete_subscribers

‹ BACK TO API PAGE


Description

WARNING: This method cannot be combined with any other method call within the same POST command.

The main purpose of this method is to delete multiple subscriber contact records without explicitly opting them out.

Provide a text file that contains the email addresses of the contact records that you want to delete. If you do have additional data in this file, make sure that the email address is in the first data column. Failure to follow this standard format will cause your request to fail. Your data file must be accessible either via HTTP or via FTP.

Arguments

Field Description Field Type Required Example
reply_email The email address which will receive the email confirmation when the deletion is complete string Yes jsmith@example.com
optout Specifies the option to additionally unsubscribe the subscriber contact records where:
  • N – do not opt-out contact record (default)
  • Y – also opt-out contact record
string No Y
data_url The URL of the data source. Allowable file extensions are .txt, .csv or .zip string Conditional; required if not using FTP as the transfer protocol https://www.mysite.com/data/segment5.csv
ftp_server IP address or host name of your FTP server string Conditional; required if file transfer is via FTP ftp.mysite.com
sftp Indicator of whether connection is via the sFTP protocol where:
  • 0 – Do not connect via sFTP (default)
  • 1 – Connect via sFTP
boolean No 1
ftp_user_name FTP username string Conditional; required if file transfer is via FTP ftp_user
ftp_user_pass FTP password string Conditional; required if file transfer is via FTP ftp_pass
filename name of data file on FTP server. Allowable file extensions are .txt, .csv or .zip string Conditional; required if file transfer is via FTP datafile.txt
server_folder name of file folder on FTP server. string Conditional; required if file transfer is via FTP and the data file is contained in sub-folders within the root directory. /folder1/folder2

Response

Field Description Example
message A code indicating either a success ('1') or a failure ('2') of the file upload for deletion request. 1
job_id This element only appears in the response message in the case of a successful file upload for deletion request. It will include the job ID number of the request. 862254
reason This element only appears in the response message in the case of a failed file upload for deletion request. It will contain a human-readable explanation of the reason for failure. file not found on FTP

Response Codes

Response Code Response Text Description
201 Success Subscribers provided in the text file have been successfully deleted from your subscriber database.
402 data source not specified The source of the file to be uploaded was not provided in the request.
405 not all variables passed through required elements were not all provided in the request.
406 file is empty: <file name> The file provided in the <data_url> element or the <filename> element did not include any records.
407 zip files can only contain one file The ZIP-encoded file specified in the <data_url> element or the <filename> element included more than one file.
408 there was something wrong with the zip file The ZIP-encoded file specified in the <data_url> element or the <filename> element could not be extracted
409 Failed to download file from: <specified file location> The file specified in the <data_url> element or the <filename> element could not be downloaded.

Example Post

<methodCall>

<methodName>legacy.delete_subscribers</methodName>

<reply_email>adam@bluehornet.com</reply_email>

<optout>N</optout>

<data_url>https://www.mysite.com/list.txt</data_url>

</methodCall>

Example Response

<methodResponse>

<item>

<methodName>legacy.delete_subscribers</methodName>

<responseData>

<message>1</message>

<job_id>862254</job_id>

</responseData>

<responseNum>1</responseNum>

</item>

</methodResponse>

Example Error

<methodResponse>

<item>

<methodName>legacy.delete_subscribers</methodName>

<responseData>

<message>2</message>

<reason>file is empty</reason>

</responseData>

<responseNum>1</responseNum>

</item>

</methodResponse>


Back to API Reference Guide