DeleteDownloads

Status

Command status: Active
Supported by OpenApps API: Yes
Supported by Internal/Reseller API: Yes
Possibly queued processing: No

Purpose

Call this command to delete downloads once they have been fully retrieved.

Resources consumed

As no actual analysis is caused by calling this command, this command uses no resources.

Parameters

Parameter Description

cmd

Required: must be set to: DeleteDownloads

datasource

Optional - defaults to historic

Either: "fresh" - to query against Fresh Index, or "historic" - to query against Historic Index.

DownloadJobIDs

Required: One or more comma delimited DownloadJobID returned by DownloadBackLinks command.

Note: deleting a download will only delete it from the server database, leaving any files that have been uploaded to your FTP. If this command is called during the loading or processing stage, the download will be aborted.

Sample queries and response

XML response

<?xml version="1.0" encoding="UTF-8"?>
<Result Code="OK" ErrorMessage="" FullError="">
<GlobalVars IndexBuildDate="2013-02-24 21:47:24" IndexType="1" ServerBuild="2017-11-06 16:39:24" ServerName="XSTHEMACHINE" ServerVersion="1.0.6519.29982" UniqueIndexID="20130224214724-FRESH" />
<DataTables Count="1">
<DataTable Name="DeletionResults" RowsCount="1" Headers="DownloadJobID|Result|Description|FileName">
<Row>C710BBB32EDAE41A3096022B93A71CC7|Deleted successfully.|API Job: DownloadBackLinks (C710BBB32EDAE41A3096022B93A71CC7)|download_historical_www_majestic_com_url_27_Nov_17_C710BBB32EDAE41A3096022B93A71CC7.csv.gz</Row>
</DataTable>
</DataTables>
</Result>

JSON response

{
  "Code": "OK",
  "ErrorMessage": "",
  "FullError": "",
  "IndexBuildDate": "2013-02-24 21:47:24",
  "IndexType": 1,
  "ServerBuild": "2017-10-13 13:57:22",
  "ServerName": "XSTHEMACHINE",
  "ServerVersion": "1.0.6495.23321",
  "UniqueIndexID": "20130224214724-FRESH",
  "DataTables": {
    "DeletionResults": {
      "Headers": {},
      "Data": [
        {
          "DownloadJobID": "BE82255B70F2CD1DCC06762FA68BE9B9",
          "Result": "Deleted successfully.",
          "Description": "API Job: DownloadBackLinks (BE82255B70F2CD1DCC06762FA68BE9B9)",
          "FileName": ""download_13_Mar_13_BE82255B70F2CD1DCC06762FA68BE9B9.csv.gz"
        }
      ]
    }
  }
}

Returned values

Return value Description
Global variables
Code Code indicating if deleting a download succeeded.
ErrorMessage A message explaining the error. This will be blank if the code is "OK".
FullError A verbose explanation of the error.
IndexBuildDate Date/time on which the index was updated.
IndexType Indicates whether the index was Historic or Fresh.
ServerBuild Date/time on which the server was built.
ServerName Name of the server where the file was stored.
ServerVersion The version of the server when the file was deleted.
UniqueIndexID Unique identifier for the index storing the deleted item.
DeletionResults Data
Return value Description
DownloadJobID Unique identifier for the job to be deleted.
Result Message detailing if the file was deleted successfully.
Description Description of the deleted job.
FileName Filename of the deleted job.

Common problems

Problem Solution
Commands such as AnalyseIndexItem aren't functioning correctly. Please call this command after successfully downloading a file, as this ensures that the download queue is clear.